Pagination
To keep response times low and make responses easier to handle, we paginate the results by breaking up a large number of items into multiple pages.
All list endpoints (GET
on a resource collection) are paginated. The exceptions are helper endpoints that, in some cases, might be unpaginated. Look at the individual endpoints for details.
These parameters are optional. If they are not provided, the system will use the defaults. The table below lists the default and maximum values for the limit
and the offset
parameters.
Parameter | Default | Minimum | Maximum | Notes |
---|---|---|---|---|
limit | 100 | 1 | 100 | The |
offset | 0 | 0 | 19900 | Setting |
Responses from paginated endpoints all have the same format at the top level.
Attribute | Type | Description |
---|---|---|
_links | Contains links to the current, previous, and next result set with the specified query parameters. | |
count | This number represents the total number of items found in the resource collection. The number of items found will be limited by permissions and, optionally, by filtering. The number is unaffected by
| |
data | The items on the current page. The type of item returned depends on which endpoint is being used. The number of items in the list must not exceed |
Get all entities at once
To get all entities, pass the all
value in the limit
attribute. In this case, the system will return all entities at once. Currently, this option is available only for the following child endpoints:
Examples
Get paginated response
Request example
curl --request GET \
--url https://api.oneflow.com/v1/template_types/?limit=1&offset=2 \
--header 'content-type: application/json' \
--header 'x-oneflow-api-token: API_TOKEN' \
--header 'x-oneflow-user-email: USER_EMAIL' \
Expected response
{
"_links": {
"next": {
"href": "https://api.oneflow.com/v1/template_types?limit=1&offset=3"
},
"previous": {
"href": "https://api.oneflow.com/v1/template_types?limit=1&offset=1"
},
"self": {
"href": "https://api.oneflow.com/v1/template_types?limit=1&offset=2"
}
},
"count": 12,
"data": [
{
"_links": {
"self": {
"href": "https://api.oneflow.com/v1/template_types/3"
}
},
"created_time": "2021-05-20T06:49:23+00:00",
"description": "Templates of this type will be available in Salesforce when creating contracts from an opportunity.",
"extension_type": "salesforce_v2",
"id": 3,
"name": "Salesforce Template",
"updated_time": "2021-05-20T06:49:23+00:00"
}
]
}
Get all entities at once
Request example
curl --request GET \
--url https://api.oneflow.com/v1/contracts/110330/data_fields?limit=all \
--header 'content-type: application/json' \
--header 'x-oneflow-api-token: API_TOKEN' \
--header 'x-oneflow-user-email: USER_EMAIL' \
Expected response
{
"_links": {
"next": {
"href": null
},
"previous": {
"href": null
},
"self": {
"href": "https://api.oneflow.com/v1/contracts/110330/data_fields?limit=all&offset=0"
}
},
"count": 2,
"data": [
{
"_links": {
"contract": {
"href": "https://api.oneflow.com/v1/contracts/110330"
},
"self": {
"href": "https://api.oneflow.com/v1/contracts/110330/data_fields/146861"
}
},
"_private_ownerside": {
"created_time": "2021-09-22T07:35:16+00:00",
"custom_id": "company_address",
"updated_time": "2021-09-22T07:35:16+00:00"
},
"description": "",
"id": 146861,
"name": "Company address",
"placeholder": "",
"value": ""
},
{
"_links": {
"contract": {
"href": "https://api.oneflow.com/v1/contracts/110330"
},
"self": {
"href": "https://api.oneflow.com/v1/contracts/110330/data_fields/146862"
}
},
"_private_ownerside": {
"created_time": "2021-09-22T07:35:16+00:00",
"custom_id": "participant_last_name",
"updated_time": "2021-09-22T07:35:16+00:00"
},
"description": "The last name of a participant in a contract.",
"id": 146862,
"name": "Participant Last Name",
"placeholder": "Last Name",
"value": "Gagan"
}
]
}
Updated about 1 month ago