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.

ParameterDefaultMinimumMaximumNotes
limit1001100The limit attribute is independent of the count attribute (see response format in Expected response). For example, if count is 50, but the limit is 10, then the count attribute will remain 50, but only 10 items will be returned.
See more in Get all entities at once.
offset0019900Setting offset greater than the available number of items will return nothing.

Responses from paginated endpoints all have the same format at the top level.

AttributeTypeDescription
_linksobjectContains links to the current, previous, and next result set with the specified query parameters.
If pagination parameters are not specified in the request, the default request parameters will be shown. See Links.
countintegerThis 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 offset and limit and will only change if the permissions or filtering parameters change, or if items are added or removed from the resource collection.

count is never below 0.
dataarrayThe 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 limit.

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"
        }
    ]
}