docs: add get fields by id
This commit is contained in:
@@ -114,6 +114,12 @@ export const versionOne: DocsStructure = {
|
||||
copy: 'copy.md',
|
||||
example: 'example.md',
|
||||
},
|
||||
{
|
||||
title: 'Get Field by Id',
|
||||
folder: 'get_field_by_id',
|
||||
copy: 'copy.md',
|
||||
example: 'example.md',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Get Field by Id {% #get-field-by-id %}
|
||||
|
||||
This endpoint returns a [Field](#fields) by its id.
|
||||
|
||||
## Path Parameters
|
||||
|
||||
{% table %}
|
||||
|
||||
- Property Name
|
||||
- Data Type
|
||||
- Description
|
||||
|
||||
---
|
||||
|
||||
- fieldId
|
||||
- `number`
|
||||
- The id of the field to retrieve.
|
||||
|
||||
{% /table %}
|
||||
@@ -0,0 +1,64 @@
|
||||
# Retrieve a field by its id
|
||||
|
||||
{% code method="GET" heading="/Fields/{fieldId}" defaultLanguage="bash" %}
|
||||
|
||||
```bash
|
||||
curl --location 'https://api.onspring.com/v1/Fields/6986' \
|
||||
--header 'X-ApiKey: 000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000'
|
||||
```
|
||||
|
||||
```csharp
|
||||
using Onspring.API.SDK;
|
||||
|
||||
var onspringClient = new OnspringClient(
|
||||
config.BaseUrl,
|
||||
config.ApiKey
|
||||
);
|
||||
|
||||
var response = await onspringClient.GetFieldAsync(6986);
|
||||
var field = response.Value;
|
||||
|
||||
Console.WriteLine($"{field.Id}");
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
|
||||
{% code heading="RESPONSE" defaultLanguage="json" %}
|
||||
|
||||
```json
|
||||
{
|
||||
"Multiplicity": 0,
|
||||
"Values": [
|
||||
{
|
||||
"Id": "4118d53a-9121-4345-8682-07f23d606daa",
|
||||
"Name": "In Progress",
|
||||
"SortOrder": 1,
|
||||
"NumericValue": 1.0,
|
||||
"Color": "#db3e3e"
|
||||
},
|
||||
{
|
||||
"Id": "1c1c5f7e-cd03-4b70-9790-0f83b24b5863",
|
||||
"Name": "Complete",
|
||||
"SortOrder": 2,
|
||||
"NumericValue": 2.0,
|
||||
"Color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"Id": "42493542-f77c-4298-91a0-18455ba0c764",
|
||||
"Name": "Not Started",
|
||||
"SortOrder": 3,
|
||||
"NumericValue": 0.0,
|
||||
"Color": "#ffffff"
|
||||
}
|
||||
],
|
||||
"Id": 6986,
|
||||
"AppId": 195,
|
||||
"Name": "Status",
|
||||
"Type": 400,
|
||||
"Status": 0,
|
||||
"IsRequired": false,
|
||||
"IsUnique": false
|
||||
}
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
@@ -20,3 +20,33 @@ foreach (var field in httpHelper.GetAppFields(195))
|
||||
Console.WriteLine($"{field.Id}, {field.Name}");
|
||||
}
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
|
||||
{% code heading="RESPONSE" defaultLanguage="json" %}
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"Id": 6989,
|
||||
"AppId": 195,
|
||||
"Name": "Attachments",
|
||||
"Type": 800,
|
||||
"Status": 0,
|
||||
"IsRequired": false,
|
||||
"IsUnique": false
|
||||
},
|
||||
{
|
||||
"Multiplicity": 0,
|
||||
"Id": 6980,
|
||||
"AppId": 195,
|
||||
"Name": "Created By",
|
||||
"Type": 500,
|
||||
"Status": 0,
|
||||
"IsRequired": false,
|
||||
"IsUnique": false
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
|
||||
Reference in New Issue
Block a user