docs: add get fields by app section. add get apps section.

This commit is contained in:
Stevan Freeborn
2023-04-24 06:24:08 -05:00
parent b6145c0deb
commit fad39f4ce5
5 changed files with 95 additions and 1 deletions
+14 -1
View File
@@ -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}");
}
```