feat: add more content
This commit is contained in:
@@ -27,6 +27,12 @@ export const versionTwo: DocsStructure = {
|
||||
copy: 'copy.md',
|
||||
example: 'example.md',
|
||||
children: [
|
||||
{
|
||||
title: 'Field Values',
|
||||
folder: 'resources/records/field_values',
|
||||
copy: 'copy.md',
|
||||
example: 'example.md',
|
||||
},
|
||||
{
|
||||
title: 'Get Records by App',
|
||||
folder:
|
||||
|
||||
@@ -1 +1,31 @@
|
||||
# The Record Object
|
||||
# Records {% #records %}
|
||||
|
||||
These are objects representing a content record in your instance. You can create new records in your instance, retrieve existing records to see the data that has been entered into a record, you can update a record to change the data in it, and you can delete a record to remove it from the instance.
|
||||
|
||||
## Record Properties
|
||||
|
||||
{% table .propertiesTable %}
|
||||
|
||||
- Property Name
|
||||
- Data Type
|
||||
- Description
|
||||
|
||||
---
|
||||
|
||||
- App Id
|
||||
- integer
|
||||
- The id of the app or survey.
|
||||
|
||||
---
|
||||
|
||||
- recordId
|
||||
- integer
|
||||
- The id of the record.
|
||||
|
||||
---
|
||||
|
||||
- fieldData
|
||||
- array
|
||||
- An array of field value objects.
|
||||
|
||||
{% /table %}
|
||||
|
||||
@@ -1 +1,19 @@
|
||||
# Records
|
||||
# The Record Object
|
||||
|
||||
{% code heading="RECORD" defaultLanguage="json" %}
|
||||
|
||||
```json
|
||||
{
|
||||
"appId": 195,
|
||||
"recordId": 1,
|
||||
"fieldData": [
|
||||
{
|
||||
"type": "Integer",
|
||||
"fieldId": 6976,
|
||||
"value": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Field Values {% #field-values %}
|
||||
|
||||
These are objects representing a field value in a record. They will comprise the `fieldData` array in a [Record](#records) object.
|
||||
|
||||
## Field Value Properties
|
||||
|
||||
{% table .propertiesTable %}
|
||||
|
||||
- Property Name
|
||||
- Data Type
|
||||
- Description
|
||||
|
||||
---
|
||||
|
||||
- type
|
||||
- string
|
||||
- The type of the field.
|
||||
|
||||
---
|
||||
|
||||
- fieldId
|
||||
- integer
|
||||
- The id of the field.
|
||||
|
||||
---
|
||||
|
||||
- value
|
||||
- object
|
||||
- The value of the field.
|
||||
|
||||
{% /table %}
|
||||
@@ -0,0 +1,13 @@
|
||||
# The Field Value Object
|
||||
|
||||
{% code heading="FIELD VALUE" defaultLanguage="json" %}
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "Integer",
|
||||
"fieldId": 6976,
|
||||
"value": 1
|
||||
}
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
@@ -1,3 +1,3 @@
|
||||
# Get Records by App
|
||||
# Get Records by App {% #get-records-by-app %}
|
||||
|
||||
Some place holder text.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# Retrieving records for an app
|
||||
|
||||
{% code heading="GET /Records/appId/{appID}" defaultLanguage="bash" %}
|
||||
|
||||
```bash
|
||||
@@ -5,8 +7,61 @@ curl --location 'https://api.onspring.com/Records/appId/195' \
|
||||
--header 'X-ApiKey: 000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000'
|
||||
```
|
||||
|
||||
```csharp
|
||||
using Onspring.API.SDK;
|
||||
|
||||
const string baseUrl = "https://api.onspring.com/";
|
||||
const string apiKey = "000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000";
|
||||
var onspringClient = new OnspringClient(baseUrl, apiKey);
|
||||
|
||||
var apps = await onspringClient.GetAppsAsync();
|
||||
foreach (App app in apps)
|
||||
{
|
||||
Console.WriteLine($"{app.Id}, {app.Name}");
|
||||
}
|
||||
```
|
||||
|
||||
```javascript
|
||||
var request = require('request');
|
||||
import dotenv from 'dotenv';
|
||||
import { OnspringClient } from 'onspring-api-sdk';
|
||||
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
|
||||
from OnspringApiSdk.OnspringClient import OnspringClient
|
||||
from configparser import ConfigParser
|
||||
|
||||
cfg = ConfigParser()
|
||||
cfg.read('config.ini')
|
||||
|
||||
key = cfg['prod']['key']
|
||||
url = cfg['prod']['url']
|
||||
|
||||
client = OnspringClient(url, key)
|
||||
response = client.GetApps()
|
||||
|
||||
print(f'Status Code: {response.statusCode}')
|
||||
print(f'Page Size: {response.data.pageSize}')
|
||||
print(f'Page Number: {response.data.pageNumber}')
|
||||
print(f'Total Pages: {response.data.totalPages}')
|
||||
print(f'Total Records: {response.data.totalRecords}')
|
||||
|
||||
for app in response.data.apps:
|
||||
print(f'Id: {app.id}')
|
||||
print(f'Name: {app.name}')
|
||||
print(f'href: {app.href}')
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
|
||||
Reference in New Issue
Block a user