The _links object contains links to endpoints of associated resources and is meant to be used manually by new developers to easily navigate our API.

The _links object can contain several objects. Each object has a descriptive name and the resource link as the href attribute value.

For example, the party object may contain the _links object with the link to the endpoint of the contract party and the link to the endpoint itself, as shown below:

📘

Note:

If the associated resource does not exist or is not accessible, the href attribute will be null.

Links attributes

There are two types of _links attributes that will differ depending on the endpoint you use.

Paginated endpoints

The table below contains all the attributes available only for the paginated endpoints.

Attribute

Type

Description

self

object

The link to the current page with the specified query parameters.
If pagination parameters are not specified in the request, the default request parameters will be shown.

previous

object

The link to the previous result set. If there are no previous results in the response, the link will be null.

next

object

The link to the next set of results. If there are no following results in the response, the link will be null.

{
    "_links": {
        "next": {
            "href": "https://api.oneflow.com/v1/contracts?limit=1&offset=2"
        },
        "previous": {
            "href": "https://api.oneflow.com/v1/contracts?limit=1&offset=0"
        },
        "self": {
            "href": "https://api.oneflow.com/v1/contracts?limit=1&offset=1"
        }
    },
  ...
}

Entity objects

The table below contains all the _links attributes available for the current entity object.

Attribute

Type

Description

self

object

The link refers to the object to which the _links attribute belongs.

contract

object

The link for getting the current contract.
See Get a contract by ID.

data_fields

object

The link for getting the list of data fields that exist within the current contract.
See Get contract data fields.

events

object

The link for getting the list of events that occur for the current contract.
See Get contract events.

files

object

The link for getting the list of files available for the current contract.
See Get contract files.

parties

object

The link for getting the list of parties in the current contract.
See Get contract parties.

publish

object

The link for publishing the current contract.
See Publish a contract by ID.

template

object

The link for getting the template used for creating the current contract.
See Get a template by ID.

template_type

object

The link for getting the template type to which the current contract template belongs.
See Get template type by ID.

workspace

object

The link for getting the current workspace.
See Get a workspace by ID.

{
    "_links": {
        "data_fields": {
            "href": "https://api.oneflow.com/v1/contracts/110338/data_fields"
        },
        "events": {
            "href": "https://api.oneflow.com/v1/contracts/110338/events"
        },
        "files": {
            "href": "https://api.oneflow.com/v1/contracts/110338/files"
        },
        "parties": {
            "href": "https://api.oneflow.com/v1/contracts/110338/parties"
        },
        "publish": {
            "href": "https://api.oneflow.com/v1/contracts/110338/publish"
        },
        "self": {
            "href": "https://api.oneflow.com/v1/contracts/110338"
        },
        "template": {
            "href": "https://api.oneflow.com/v1/templates/110048"
        },
        "template_type": {
            "href": "https://api.oneflow.com/v1/template_types/1"
        },
        "workspace": {
            "href": "https://api.oneflow.com/v1/workspaces/190000"
        }
    },
 ...
}

Did this page help you?