docs: add list values resource section

This commit is contained in:
Stevan Freeborn
2023-04-17 23:00:51 -05:00
parent dfac4e90ad
commit 07b7aff742
9 changed files with 85 additions and 11 deletions
+20 -8
View File
@@ -127,14 +127,6 @@ export const versionTwo: DocsStructure = {
folder: 'list_field',
copy: 'copy.md',
example: 'example.md',
children: [
{
title: 'List Value',
folder: 'list_value',
copy: 'copy.md',
example: 'example.md',
},
],
},
{
title: 'Get Fields by App',
@@ -156,6 +148,26 @@ export const versionTwo: DocsStructure = {
},
],
},
{
title: 'List Values',
folder: 'list_values',
copy: 'copy.md',
example: 'example.md',
children: [
{
title: 'Save List Value',
folder: 'save_list_value',
copy: 'copy.md',
example: 'example.md',
},
{
title: 'Delete List Value by Id',
folder: 'delete_list_value_by_id',
copy: 'copy.md',
example: 'example.md',
},
],
},
{
title: 'Records',
folder: 'records',
@@ -20,6 +20,6 @@ Formula fields are a special type of field that can be used to calculate values
- values
- `object[]`
- An array of [List Value](#list-value) objects that define the possible values of the formula field. This array will only be populated with values if the `outputType` is set to `ListValue`.
- An array of [List Value](#list-values) objects that define the possible values of the formula field. This array will only be populated with values if the `outputType` is set to `ListValue`.
{% /table %}
@@ -26,6 +26,6 @@ List fields are a special type of field that allow you to define a list of value
- values
- `object[]`
- An array of [List Value](#list-value) objects that define the possible values of the list field.
- An array of [List Value](#list-values) objects that define the possible values of the list field.
-
@@ -1,4 +1,4 @@
# List Value {% #list-value %}
# List Values {% #list-values %}
These are objects that represent the defined values of a [List Field](#list-field) or a [Formula Field](#formula-field) with a `ListValue` output type.
@@ -0,0 +1,3 @@
# Delete List Value by Id {% #delete-list-value-by-id %}
This endpoint deletes a list value. When request is successful a `204` status code will be returned with no response body.
@@ -0,0 +1,10 @@
# Delete a list value
{% code method="DELETE" heading="/Lists/id/{listId}/itemId/{itemId}" defaultLanguage="bash" %}
```bash
curl --location --request DELETE 'https://api.onspring.com/Lists/id/906/itemId/e3371dbf-b557-4a31-b32f-33c0265d2a59' \
--header 'X-ApiKey: 000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000'
```
{% /code %}
@@ -0,0 +1,21 @@
# Save List Value {% #save-list-value %}
This endpoint adds or updates a list value. If a list value id is provided, the list value will be updated. If no list value id is provided, a new list value will be created. When request is successful a `200` status code will be returned if updating a list value or a `201` status code will be returned if creating a new list value.
## Path Parameters
{% table %}
{% /table %}
## Request Body Properties
{% table %}
{% /table %}
## Response Body Properties
{% table %}
{% /table %}
@@ -0,0 +1,28 @@
# Add a list value
{% code method="PUT" heading="/Lists/id/{listId}/items" defaultLanguage="bash" %}
```bash
curl --location --request PUT 'https://api.onspring.com/Lists/id/906/items' \
--header 'X-ApiKey: 000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000' \
--header 'Content-Type: application/json' \
--data '{
"id": null,
"name": "Not Started",
"numericValue": 0,
"color": "#ffffff",
"weight": 0
}'
```
{% /code %}
{% code heading="RESPONSE" defaultLanguage="json" %}
```json
{
"id": "4118d53a-9121-4345-8682-07f23d606daa"
}
```
{% /code %}