# Format & Pagination

### Format/ Pagination

The Red Flag Alert API follows the JSON API ([http://jsonapi.org](http://jsonapi.org/)) format and uses the REST architectural style with JSON throughout.

All responses will be returned as JSON, with the requested data being returned in the '`data`' key of the response.

When performing a search, pagination links will be available as per the JSONAPI standard in a field called '`links`', with '`first`', '`previous`', '`next`' and '`last`' links allowing navigation.

### MIME Types

JSON API has been properly registered with the IANA. Its media type designation is [`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json).

### Generating PDF Responses

In addition to the standard JSON response, companies can be requested formatted as PDF documents. In order to request this, change the 'Accept' header of your request to '**application/pdf**'. Currently, this is only supported by the company/ endpoint.

The PDF document will also include any extra resources requested in the '`?include=`' GET parameter and therefore can be used to construct a full company report by appending '`?include=all`' to the URL (See 'Including Additional Resources').

### Browsable API

To assist developers, a browsable API is available enabling the viewing and navigation of records in the browser. This can be accessed by visiting the corresponding URL in a browser; the API will detect that a browser is being used and displays records accordingly. A username and password will be requested; this is simply the API key and secret.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.redflagalert.net/format-and-pagination.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
