API Request Headers¶
API Headers are available for:
Pagination of choices and macro results in an API call.
The headers are
X-rangeandRange, with the starting value as 0. These override and can be used instead of theskipandlimitAPI parameters.For example, the following examples return the same results:
GET /api/tool/Macro/?method=evaluate &hierarchy=[hierarchy] &input={{fn.lines}} &skip=0 &limit=6 GET /api/tool/Macro/?method=evaluate &hierarchy=[hierarchy] &input={{fn.lines}} Request headers: X-Range: items=0-5 Range: items=0-5If the request is
items=0-199(for 200 items) and there are more results, the response will show:Content-Range:items 0-199/999999999
Since it is undetermined how many items there are, the value
999999999represents the total.In this example, we have a total of 298 items. if a subsequent request is for the next 200 items (200-399), this includes the total. The response will then also show the total number of items (298) returned by the macro:
Content-Range:items 200-399/298
Backward compatibility. The
X-Versionheader is available to take an API version as value.For example:
GET /api/data/Countries/?hierarchy=[hierarchy] &schema=true &format=json Request headers X-Version: 10.1.2Refer to the topics on API backwards compatibility.