This commit is contained in:
2020-01-28 20:27:20 +00:00
parent 5ad9c95f8c
commit 1db4636a76
2 changed files with 82 additions and 17 deletions

View File

@@ -25,13 +25,13 @@ All successful GET responses have a standard format:
The results of the response are always contained in the `data` property and could be a single object, a collection or in some cases nothing at all.
HTTP Status Code is set in the header. A ReadOnly property is set on the returned data for the convenience of the client software however note that the server will always determine this independently so if this property is ignored and the client attempts to update the record a error 2004 NOT_AUTHORIZED would be returned.
### GET COLLECTION RESPONSE
### GET DATALIST RESPONSE
In the case of a collection most routes support paging, here is an example paged collection request and response:
In the case of a DataList routes support paging and filtering, here is an example paged collection request and response:
Request (note the `offset` and `limit` parameters):
`http://localhost:3000/api/v8.0/Widget?Offset=2&Limit=3`
`http://localhost:7575/api/v8/DataList/List?Offset=2&Limit=2&DataListKey=TestWidgetDataList`
Limit must be a value between 1 and 1000.
@@ -40,21 +40,90 @@ Response:
```json
{
"data": [
...collection...
[
{
"v": 3
},
{
"v": "Handcrafted Fresh Keyboard 27",
"i": 3
},
{
"v": 3
},
{
"v": 697.34
},
{
"v": 128
},
{
"v": "2020-01-28T12:10:46.212435Z"
},
{
"v": true
},
{
"v": "Doug Effertz 17 - OpsAdminFull",
"i": 18
}
],
...etc...
],
"paging": {
"count": 2000,
"count": 100,
"offset": 2,
"limit": 3,
"first": "http://localhost:3000/api/v8.0/Widget?pageNo=1&pageSize=3",
"previous": "http://localhost:3000/api/v8.0/Widget?pageNo=1&pageSize=3",
"next": "http://localhost:3000/api/v8.0/Widget?pageNo=3&pageSize=3",
"last": "http://localhost:3000/api/v8.0/Widget?pageNo=667&pageSize=3"
}
"limit": 2,
"first": "http://localhost:7575/api/v8/DataList/List?DataListKey=TestWidgetDataList&pageNo=1&pageSize=2",
"previous": "http://localhost:7575/api/v8/DataList/List?DataListKey=TestWidgetDataList&pageNo=1&pageSize=2",
"next": "http://localhost:7575/api/v8/DataList/List?DataListKey=TestWidgetDataList&pageNo=3&pageSize=2",
"last": "http://localhost:7575/api/v8/DataList/List?DataListKey=TestWidgetDataList&pageNo=50&pageSize=2"
},
"columns": [
{
"cm": "df",
"dt": 0,
"ay": 2
},
{
"cm": "WidgetName",
"dt": 4,
"ay": 2
},
{
"cm": "WidgetSerial",
"dt": 5
},
{
"cm": "WidgetDollarAmount",
"dt": 8
},
{
"cm": "WidgetRoles",
"dt": 10
},
{
"cm": "WidgetStartDate",
"dt": 1
},
{
"cm": "Active",
"dt": 6
},
{
"cm": "User",
"dt": 4,
"ay": 3
}
]
}
```
`Previous` or `next` properties will contain "null" instead of an url on boundaries where there is no record to link to.
`columns` collection is the list of columns returned in the same order as the individual data arrays for each object.
Note that the `df` column is the default column and contains the object type and id to open for that row which guarantees an openable object for the row regardless of which columns are templated to be returned.
### PUT RESPONSE