docs: add get fields by app section. add get apps section.
This commit is contained in:
@@ -55,7 +55,14 @@ export const versionOne: DocsStructure = {
|
||||
folder: 'apps',
|
||||
copy: 'copy.md',
|
||||
example: 'example.md',
|
||||
children: [],
|
||||
children: [
|
||||
{
|
||||
title: 'Get Apps',
|
||||
folder: 'get_apps',
|
||||
copy: 'copy.md',
|
||||
example: 'example.md',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Reports',
|
||||
@@ -101,6 +108,12 @@ export const versionOne: DocsStructure = {
|
||||
copy: 'copy.md',
|
||||
example: 'example.md',
|
||||
},
|
||||
{
|
||||
title: 'Get Fields by App',
|
||||
folder: 'get_fields_by_app',
|
||||
copy: 'copy.md',
|
||||
example: 'example.md',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Get Apps {% #get-apps %}
|
||||
|
||||
This endpoint returns an array of [apps](#apps) that the given API key can access.
|
||||
@@ -0,0 +1,37 @@
|
||||
# Retrieve apps accessible to the API key
|
||||
|
||||
{% code method="GET" heading="/Apps" defaultLanguage="bash" %}
|
||||
|
||||
```bash
|
||||
curl --location 'https://api.onspring.com/v1/Apps' \
|
||||
--header 'X-ApiKey: 000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000'
|
||||
```
|
||||
|
||||
```csharp
|
||||
using Onspring.API.SDK.Helpers;
|
||||
|
||||
var httpHelper = new HttpHelper(
|
||||
config.baseUrl,
|
||||
config.apiKey
|
||||
);
|
||||
|
||||
foreach (var app in httpHelper.GetApps())
|
||||
{
|
||||
Console.WriteLine($"{app.Id}, {app.Name}");
|
||||
}
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
|
||||
{% code heading="RESPONSE" defaultLanguage="json" %}
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"Id": 195,
|
||||
"Name": "Tasks"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
@@ -0,0 +1,19 @@
|
||||
# Get Fields by App {% #get-fields-by-app %}
|
||||
|
||||
This endpoint returns an array of [Fields](#fields) for the given app.
|
||||
|
||||
## Query Parameters
|
||||
|
||||
{% table %}
|
||||
|
||||
- Parameter Name
|
||||
- Data Type
|
||||
- Description
|
||||
|
||||
---
|
||||
|
||||
- appId
|
||||
- `number`
|
||||
- The id of the app to retrieve fields for.
|
||||
|
||||
{% /table %}
|
||||
@@ -0,0 +1,22 @@
|
||||
# Retrieve all fields for an app
|
||||
|
||||
{% code method="GET" heading="/Fields" defaultLanguage="bash" %}
|
||||
|
||||
```bash
|
||||
curl --location 'https://api.onspring.com/v1/Fields?appId=195' \
|
||||
--header 'X-ApiKey: 000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000'
|
||||
```
|
||||
|
||||
```csharp
|
||||
using Onspring.API.SDK.Helpers;
|
||||
|
||||
var httpHelper = new HttpHelper(
|
||||
config.baseUrl,
|
||||
config.apiKey
|
||||
);
|
||||
|
||||
foreach (var field in httpHelper.GetAppFields(195))
|
||||
{
|
||||
Console.WriteLine($"{field.Id}, {field.Name}");
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user