feat: add more content

This commit is contained in:
Stevan Freeborn
2023-04-12 10:54:07 -05:00
parent 46018970d7
commit 955de7db83
13 changed files with 199 additions and 10 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ export default function CodeSnippet({
if (React.isValidElement(child)) {
const languageClassParts =
child.props.className.split('-');
if (languageClassParts.length == 2) {
if (languageClassParts.length > 1) {
const language = languageClassParts[1];
return language;
}
+2
View File
@@ -1,6 +1,8 @@
import Prism from 'prismjs';
import 'prismjs/components/prism-bash';
import 'prismjs/components/prism-csharp';
import 'prismjs/components/prism-json';
import 'prismjs/components/prism-python';
import './prism-custom.css';
export default function Fence({
+27
View File
@@ -44,4 +44,31 @@
.container>article:nth-child(2)>h1 {
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;
}
+3 -1
View File
@@ -51,7 +51,9 @@ function TreeNode({ doc }: { doc: Doc }) {
</div>
) : (
<a
href={`#${doc.title.toLowerCase()}`}
href={`#${doc.title
.replaceAll(' ', '-')
.toLowerCase()}`}
className={styles.link}
>
{doc.title}
+6
View File
@@ -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:
+31 -1
View File
@@ -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 %}