Version 2.1 introduces minor changes to authorisation and response data formats. All other functionality remains the same as documented in API V2.
To use V2.1 in any of the API endpoints listed in Config V2 and Reports V2, simply replace v2 in the URL path with v2.1.
For example:
https://api.infinitycloud.com/reports/v2/igrps/
Becomes:
https://api.infinitycloud.com/reports/v2.1/igrps/
V2.1 requires the use of API Keys to authenticate, rather than using your standard Infinity Hub credentials.
To create an API key for your user, please follow this guide.
When making a request to Infinity APIs, the Authorization header should have the value ApiKey xxx, where xxx is the key generated.
For example, if using cURL, you would send a request in the following format:
curl -H 'Authorization: ApiKey xxx' "https://api.infinitycloud.com/config/v2.1/..."
In API V2, the response format can be influenced by the format query parameter (see output format).
However, the actual Content-Type header in the response will still be one of:
text/plain;charset=UTF-8
text/html;charset=UTF-8
text/xml;charset=UTF-8
This has been problematic for some integration partners. In V2.1, you can use the Accept header to define the response format, and the API will return a matching Content-Type in the response.
The supported values are:
| Accept Header | Notes |
|---|---|
| application/json | Returns a JSON array |
| application/stream+json | May return a single JSON object (streamed) |
| application/xml | |
| text/xml | |
| application/xhtml+xml | Requires display parameter |
| text/csv | Requires display parameter |
See: Display parameter usage.