2023-04-16 21:59:23 -05:00
|
|
|
# Retrieve apps accessible to the API key
|
|
|
|
|
|
|
|
|
|
{% code method="GET" heading="/Apps" defaultLanguage="bash" %}
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
curl --location 'https://api.onspring.com/Apps' \
|
|
|
|
|
--header 'X-ApiKey: 000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```csharp
|
|
|
|
|
using Onspring.API.SDK;
|
|
|
|
|
|
|
|
|
|
var onspringClient = new OnspringClient(
|
|
|
|
|
config.BaseUrl,
|
|
|
|
|
config.ApiKey
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
var response = await onspringClient.GetAppsAsync();
|
|
|
|
|
|
|
|
|
|
foreach (var app in response.Value.Items)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine($"{app.Id}, {app.Name}");
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
import { OnspringClient } from 'onspring-api-sdk';
|
2023-04-17 08:33:31 -05:00
|
|
|
import dotenv from 'dotenv';
|
2023-04-16 21:59:23 -05:00
|
|
|
dotenv.config();
|
|
|
|
|
|
|
|
|
|
const client = new OnspringClient(
|
|
|
|
|
process.env.BASE_URL,
|
|
|
|
|
process.env.API_KEY
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const res = await client.getApps();
|
|
|
|
|
const apps = res.data.items;
|
|
|
|
|
|
|
|
|
|
for (const app of apps) {
|
|
|
|
|
console.log(app);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```python
|
2026-06-26 16:51:54 -05:00
|
|
|
from onspring_api_sdk import OnspringClient
|
2023-04-16 21:59:23 -05:00
|
|
|
from configparser import ConfigParser
|
|
|
|
|
|
|
|
|
|
cfg = ConfigParser()
|
|
|
|
|
cfg.read('config.ini')
|
|
|
|
|
|
|
|
|
|
key = cfg['prod']['key']
|
|
|
|
|
url = cfg['prod']['url']
|
|
|
|
|
|
|
|
|
|
client = OnspringClient(url, key)
|
2026-06-26 16:51:54 -05:00
|
|
|
response = client.get_apps()
|
2023-04-16 21:59:23 -05:00
|
|
|
|
2026-06-26 16:51:54 -05:00
|
|
|
print(f'Status Code: {response.status_code}')
|
|
|
|
|
print(f'Page Size: {response.data.page_size}')
|
|
|
|
|
print(f'Page Number: {response.data.page_number}')
|
|
|
|
|
print(f'Total Pages: {response.data.total_pages}')
|
|
|
|
|
print(f'Total Records: {response.data.total_records}')
|
2023-04-16 21:59:23 -05:00
|
|
|
|
|
|
|
|
for app in response.data.apps:
|
|
|
|
|
print(f'Id: {app.id}')
|
|
|
|
|
print(f'Name: {app.name}')
|
|
|
|
|
print(f'href: {app.href}')
|
2026-06-26 16:51:54 -05:00
|
|
|
|
2023-04-16 21:59:23 -05:00
|
|
|
```
|
|
|
|
|
|
2026-03-26 21:53:02 -05:00
|
|
|
```rust
|
|
|
|
|
use onspring::{OnspringClient, PagingRequest};
|
|
|
|
|
|
|
|
|
|
let client = OnspringClient::builder(
|
|
|
|
|
"000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000"
|
|
|
|
|
)
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
let paging = PagingRequest {
|
|
|
|
|
page_number: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let response = client.list_apps(Some(paging)).await?;
|
|
|
|
|
|
|
|
|
|
for app in response.items.unwrap_or_default() {
|
|
|
|
|
println!(
|
|
|
|
|
"{}, {}",
|
|
|
|
|
app.id,
|
|
|
|
|
app.name.unwrap_or_default()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2026-03-26 22:09:26 -05:00
|
|
|
```go
|
|
|
|
|
import onspring "github.com/StevanFreeborn/onspring-api-sdk-go"
|
|
|
|
|
|
|
|
|
|
client := onspring.NewClient(
|
|
|
|
|
"000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
page, _ := client.Apps.List(
|
|
|
|
|
context.Background(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
for _, app := range page.Items {
|
|
|
|
|
fmt.Printf("%d, %s\n", app.Id, app.Name)
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-04-16 21:59:23 -05:00
|
|
|
{% /code %}
|
2023-04-16 22:01:53 -05:00
|
|
|
|
|
|
|
|
{% code heading="RESPONSE" defaultLanguage="json" %}
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"pageSize": 1,
|
|
|
|
|
"pageNumber": 1,
|
|
|
|
|
"totalPages": 1,
|
|
|
|
|
"totalRecords": 1,
|
|
|
|
|
"items": [
|
|
|
|
|
{
|
|
|
|
|
"id": 195,
|
|
|
|
|
"name": "Tasks",
|
|
|
|
|
"href": "https://api.onspring.com/Apps/195"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
{% /code %}
|