Include type | Query | Description |
---|---|---|
Embedded | ?include=embedded | JSON representations of related resources. For example: the employee the requested leave object belongs to. |
Links | ?include=links | Links to related resources and/or actions. For example: links to the previous and next pages of a collection. |
Total count | ?include=totalCount | For collections, the total number of resources that satisfy the query filters across all pages. |
You can retrieve multiple types of includes by chaining the query parameter values:
?include=totalCount,embedded,links
.Access rights are evaluated when including embedded resources, thus you may not systematically retrieve them even when including them.
About Embedded
When adding?include=embedded
to your HTTP GET requests, the Lucca API will attempt to include the representations of related resource in the response. For example: you may retrieve the first and last name of the employee when retrieving his leaves.
Notes:
- Embedded resources may not actually be included in responses if you do not have access to them.
- The included representation may be partial, i.e. only give you a subset of the resource properties.
- It may also be stale from cache in the very short term.
- You cannot choose which resources to embed. The list of available resources is dictated by each API endpoint. Including embedded resource is a binary affair: do include them, or do not.
type
(e.g. leave
, employee
, etc…) then by id
.
About Links
Links are objects that represent navigational references to other resources and/or actions on the target resource. Examples are:- links to the previous and next pages of a collection.
- link to the approval process of a leave-request.
include
query parameter.