docs: add report object sections

This commit is contained in:
Stevan Freeborn
2023-04-17 13:57:08 -05:00
parent a880b219e0
commit df490c4124
11 changed files with 179 additions and 0 deletions
+34
View File
@@ -70,6 +70,40 @@ export const versionTwo: DocsStructure = {
}, },
], ],
}, },
{
title: 'Reports',
folder: 'reports',
copy: 'copy.md',
example: 'example.md',
children: [
{
title: 'Report Data',
folder: 'report_data',
copy: 'copy.md',
example: 'example.md',
children: [
{
title: 'Report Row',
folder: 'report_row',
copy: 'copy.md',
example: 'example.md',
},
],
},
{
title: 'Get Reports by App',
folder: 'get_reports_by_app',
copy: 'copy.md',
example: 'example.md',
},
{
title: 'Get Report by Id',
folder: 'get_report_by_id',
copy: 'copy.md',
example: 'example.md',
},
],
},
{ {
title: 'Records', title: 'Records',
folder: 'records', folder: 'records',
@@ -0,0 +1,31 @@
# Reports {% #reports %}
These are objects that represent reports and their data for apps and surveys in an Onspring instance. You can retrieve a list of reports for an app or survey, or get a specific report and its data.
## Report Properties
{% table %}
- Property Name
- Data Type
- Description
---
- appId
- `number`
- The id of the app or survey that the report belongs to.
---
- id
- `number`
- The id of the report.
---
- name
- `string`
- The name of the report.
{% /table %}
@@ -0,0 +1,13 @@
# The Report Object
{% code heading="REPORT" defaultLanguage="json" %}
```json
{
"appId": 195,
"id": 613,
"name": "Test 1"
}
```
{% /code %}
@@ -0,0 +1 @@
# Get Report by Id {% #get-report-by-id %}
@@ -0,0 +1 @@
# Retrieving data from a report
@@ -0,0 +1 @@
# Get Reports by App {% #get-reports-by-app %}
@@ -0,0 +1 @@
# Retrieving reports for the given app
@@ -0,0 +1,25 @@
# Report Data {% #report-data %}
These are objects that represent the data for a report in an Onspring instance. They will be returned when you request a specific report by id.
## Report Data Properties {% #reports-data-properties %}
{% table %}
- Property Name
- Data Type
- Description
---
- columns
- `string[]`
- The names of the [fields](#fields) in the report.
---
- rows
- `object[]`
- An array of [Report Row](#report-row) objects.
{% /table %}
@@ -0,0 +1,29 @@
# The Report Data Object
{% code heading="REPORT DATA" defaultLanguage="json" %}
```json
{
"columns": [
"Name",
"Owner",
"Due Date",
"Status",
"Description"
],
"rows": [
{
"recordId": 72,
"cells": [
"A New Test Task",
null,
null,
null,
"<p>This is a test task.</p>"
]
}
]
}
```
{% /code %}
@@ -0,0 +1,25 @@
# Report Row {% #report-row %}
These are objects representing a row in a report. They will comprise the `rows` array in the [Report Data](#report-data) object. Each row contains the data for a record in the report.
## Report Row Properties
{% table %}
- Property Name
- Data Type
- Description
---
- recordId
- `number`
- The id of the record that the row represents.
---
- cells
- `string[]`
- An array of strings representing the data for each field in the report. The order of the strings in the array will match the order of the fields in the `columns` array in the [Report Data](#report-data) object.
{% /table %}
@@ -0,0 +1,18 @@
# The Report Row Object
{% code heading="REPORT ROW" defaultLanguage="json" %}
```json
{
"recordId": 72,
"cells": [
"A New Test Task",
null,
null,
null,
"<p>This is a test task.</p>"
]
}
```
{% /code %}