Result Control

Introduction

This section describes how you can control the quantity of information provided in responses of the intratool API.

Includes

If an object has related content, you can request this data without firing additional requests.

The structure to apply includes is as follows:

  • {route} - The endpoint you want to retrieve data of

  • ?include - To identify the incoming URL parameter

  • {relations} - Relation identifiers are seperated by |

GET /api/{route}?include={relations}

You can combine includes with selects. Just add the fields to select seperated by a :.

relation:field1,field2

Note

If you include a relation and also pass Selects, make sure to select the field that represents the relation - otherwise the included relation can not be resolved.

Selects

Selects can be used to control which fields of an entity should be returned by our API.

The structure to apply select fields is as follows:

  • {route} - The endpoint you want to retrieve data of

  • ?select - To identify the incoming URL parameter

  • {selects} - Field keys to include are seperated by ,

GET /api/{route}?select={selects}

Limiting

Limiting can be used to control how many records are returned by our API.

The structure to apply a limit is as follows:

  • {route} - The endpoint you want to retrieve data of.

  • ?limit - To identify the incoming URL parameter

  • {value} - The limit value.

GET /api/{route}?limit={value}

Sorting

Sorting can be used to define the order of the records returned by our API.

The structure to apply an ordering is as follows:

  • {route} - The endpoint you want to retrieve data of.

  • ?sort - To identify the incoming URL parameter

  • {fields} - Field keys for sorting seperated by ,. To order descending, prefix field keys with -.

GET /api/{route}?sort={fields}

WithCount

The withCount can be used to get the count of related objects for relation fields instead of object information.

The structure to apply a withCount is as follows:

  • {route} - The endpoint you want to retrieve data of.

  • ?withCount - To identify the incoming URL parameter

  • {relations} - The relation identifiers to get a count for seperated by |

GET /api/{route}?withCount={relations}

Last Updated: 05/14/2019