{% extends "rest_framework/api_basics.html" %} {% block description %}

The InfiniMetrics API returns JSON responses by default. It is however possible to ask for responses in CSV format. This is particularly desirable when downloading raw monitored entity data, which can potentially include a large number of records.

A CSV response can be requested by appending ?format=csv to the URL, or sending the following request header: Accept: text/csv.

Pagination

CSV responses are paginated just like JSON responses, but the response body does not include any metadata information. Instead, the current page and total number of pages appear in the filename contained in the Content-Disposition response header, for example:

Content-Disposition: attachment; filename="systems_1007_monitored_entities_1_data.page_3_of_17.csv"

Additionally, the Link header provides the URLs of the next and/or previous result pages. Other metadata fields are also made available via custom response headers:

GET https://infinimetrics/api/rest/systems/1007/monitored_entities/1/data/?page=2&page_size=10000&format=csv
HTTP 200 OK
Vary: Accept
Allow: GET, HEAD, OPTIONS
Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="systems_1007_monitored_entities_1_data.page_2_of_17.csv"
Link: <https://infinimetrics/api/rest/systems/1007/monitored_entities/1/data/?page=1&page_size=10000&format=csv>; rel="previous",
      <https://infinimetrics/api/rest/systems/1007/monitored_entities/1/data/?page=3&page_size=10000&format=csv>; rel="next"
X-Page: 2
X-Page-Size: 10000
X-Pages-Total: 17
X-Number-Of-Objects: 167673
Next: Usage Examples » {% endblock %}