include
or expand
, to obtain the required information.
id
)
x-account-id
and selected one particular employee by specifying the resourceid
in the path
avatar_url
or additional information about the work_location
and employment
. This is where the include
and expand
parameters become handy.
include
and expand
reserved keywords allow retrieving additional information about the employee. As an example, the usage of include
=avatar_url
and expand
=work_location
returns a link to the employee’s avatar and details of work location.
Include
Include is meant to return additional fields not included by default for privacy or performance reasons. For example, the avatar_url
field may require the hosting of the underlying image, which can slow down the response unnecessarily if you do not need it.
Expand
Expand, on the other hand, is used to expand objects (also called models
) for which only the ID would otherwise be given and would therefore require a call to another resource to retrieve the underlying data (such as an employee’s employment or work location details )