Include Parameters
REST APIs return a set of default attributes as part of the response.
Use the include request parameter to retrieve a specific
attribute in the API response.
Syntax: include: "fieldName"
For example, using include:"revenueCenters.num, revenuCenters.name" in the API request returns the RVC name and RVC number
from the getRevenueCenterDimensions API instead of the entire
response.
{
"locRef":"1234",
"busDt: "2020-07-20",
"revenueCenters":[{
"num": 152,
"name": "Bar"
}]
} -
Including parameters in the API request overrides the default inclusion of the response and returns only the attributes referenced in the
includeparameter of the request object. -
Including a child object of the response returns all of the attributes of the child object in response.
-
Always use the parent object's name with the object name when using the
includerequest parameter. -
Use * keyword as the first attribute in the list of attributes to include all default included parameters at once.
-
For example, using
include:"*,locName"in the Get revenueCenters API returns all attributes that are included by default and the location name in the response.
-
-
Using the
includeAllparameter overrides theincludeparameter.