feat: add more content
This commit is contained in:
+3
-3
@@ -10,7 +10,7 @@
|
|||||||
"MD010": true,
|
"MD010": true,
|
||||||
"MD011": true,
|
"MD011": true,
|
||||||
"MD012": true,
|
"MD012": true,
|
||||||
"MD013": true,
|
"MD013": false,
|
||||||
"MD014": true,
|
"MD014": true,
|
||||||
"MD018": true,
|
"MD018": true,
|
||||||
"MD019": true,
|
"MD019": true,
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"MD029": true,
|
"MD029": true,
|
||||||
"MD030": true,
|
"MD030": true,
|
||||||
"MD031": true,
|
"MD031": true,
|
||||||
"MD032": true,
|
"MD032": false,
|
||||||
"MD033": true,
|
"MD033": true,
|
||||||
"MD034": true,
|
"MD034": true,
|
||||||
"MD035": true,
|
"MD035": true,
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
"MD048": true,
|
"MD048": true,
|
||||||
"MD049": true,
|
"MD049": true,
|
||||||
"MD050": true,
|
"MD050": true,
|
||||||
"MD051": true,
|
"MD051": false,
|
||||||
"MD052": true,
|
"MD052": true,
|
||||||
"MD053": true
|
"MD053": true
|
||||||
}
|
}
|
||||||
Vendored
+6
-1
@@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"typescript.tsdk": "node_modules\\typescript\\lib",
|
"typescript.tsdk": "node_modules\\typescript\\lib",
|
||||||
"typescript.enablePromptUseWorkspaceTsdk": true,
|
"typescript.enablePromptUseWorkspaceTsdk": true,
|
||||||
"cSpell.words": ["markdoc", "Onpsring", "prismjs"]
|
"cSpell.words": [
|
||||||
|
"configparser",
|
||||||
|
"markdoc",
|
||||||
|
"Onpsring",
|
||||||
|
"prismjs"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export default function CodeSnippet({
|
|||||||
if (React.isValidElement(child)) {
|
if (React.isValidElement(child)) {
|
||||||
const languageClassParts =
|
const languageClassParts =
|
||||||
child.props.className.split('-');
|
child.props.className.split('-');
|
||||||
if (languageClassParts.length == 2) {
|
if (languageClassParts.length > 1) {
|
||||||
const language = languageClassParts[1];
|
const language = languageClassParts[1];
|
||||||
return language;
|
return language;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import Prism from 'prismjs';
|
import Prism from 'prismjs';
|
||||||
import 'prismjs/components/prism-bash';
|
import 'prismjs/components/prism-bash';
|
||||||
|
import 'prismjs/components/prism-csharp';
|
||||||
import 'prismjs/components/prism-json';
|
import 'prismjs/components/prism-json';
|
||||||
|
import 'prismjs/components/prism-python';
|
||||||
import './prism-custom.css';
|
import './prism-custom.css';
|
||||||
|
|
||||||
export default function Fence({
|
export default function Fence({
|
||||||
|
|||||||
@@ -45,3 +45,30 @@
|
|||||||
padding-top: 75px;
|
padding-top: 75px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container>article>h2 {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container table>thead>tr>th,
|
||||||
|
.container table>tbody>tr>td {
|
||||||
|
padding: 0.5rem;
|
||||||
|
text-align: left;
|
||||||
|
border-bottom: 1px solid #0b3766;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container table>thead>tr>th {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #64adac;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
@@ -51,7 +51,9 @@ function TreeNode({ doc }: { doc: Doc }) {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<a
|
<a
|
||||||
href={`#${doc.title.toLowerCase()}`}
|
href={`#${doc.title
|
||||||
|
.replaceAll(' ', '-')
|
||||||
|
.toLowerCase()}`}
|
||||||
className={styles.link}
|
className={styles.link}
|
||||||
>
|
>
|
||||||
{doc.title}
|
{doc.title}
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ export const versionTwo: DocsStructure = {
|
|||||||
copy: 'copy.md',
|
copy: 'copy.md',
|
||||||
example: 'example.md',
|
example: 'example.md',
|
||||||
children: [
|
children: [
|
||||||
|
{
|
||||||
|
title: 'Field Values',
|
||||||
|
folder: 'resources/records/field_values',
|
||||||
|
copy: 'copy.md',
|
||||||
|
example: 'example.md',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Get Records by App',
|
title: 'Get Records by App',
|
||||||
folder:
|
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.
|
Some place holder text.
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Retrieving records for an app
|
||||||
|
|
||||||
{% code heading="GET /Records/appId/{appID}" defaultLanguage="bash" %}
|
{% code heading="GET /Records/appId/{appID}" defaultLanguage="bash" %}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -5,8 +7,61 @@ curl --location 'https://api.onspring.com/Records/appId/195' \
|
|||||||
--header 'X-ApiKey: 000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000'
|
--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
|
```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 %}
|
{% /code %}
|
||||||
|
|||||||
Reference in New Issue
Block a user