Pagination and rate limits
A resource which returns a list doesn’t return all results at once. Instead, the number of results is constrained and you can traverse the results. For that purpose, the list requests accept the parameters max and offset.
| Request Parameter | Default Value | Description |
|---|---|---|
| max | 10 | Maximal number of returned resources. Maximal allowed value is 100. |
| offset | 0 | The offset from the first result to list from. |
All list responses return a number of total results in HTTP response header.
| HTTP Response Header | Description |
|---|---|
| x-total-count | Number of total results. |
An example which returns the 21st to 30th resource:
Example
curl-H "Content-Type: application/json" -H "Authorization: Bearer {{OAUTH_TOKEN}}" https://api.amio.io/v1/channels?max=10&offset=20Rate Limiting
Section titled “Rate Limiting”Amio API has different rate limits for each pricing plan. We limit number of requests you can do within a hour. And number of simultaneous connections you can have opened to Amio servers.
| Pricing Plan | Number of Requests | Simultaneous Connections |
|---|---|---|
| Free | 1000 | 3 |
| Developer | 2000 | 10 |
| Enterprise | custom | custom |
You can check the returned HTTP headers of any API request to see your current rate limit status for maximum number of requests:
curl -i https://api.amio.io/v1/channels/{{channel_id}}
HTTP/1.1 200 OKDate: Mon, 01 Jul 2013 17:27:06 GMTStatus: 200 OKX-RateLimit-Limit: 1000X-RateLimit-Remaining: 999X-RateLimit-Reset: 1491820066| HTTP Response Header | Description |
|---|---|
| X-RateLimit-Limit | The maximum number of requests that you are permitted to make per hour. |
| X-RateLimit-Remaining | Remaining number of requests. |
| X-RateLimit-Reset | Remaining time before the rate limit resets, in UTC epoch seconds. |
Once you go over the rate limit you will receive an error response:
{ "timestamp": "2016-12-21T11:17:56.397Z", "status": { "code": "429", "message": "Too Many Requests" }, "errors": [ { "message": "You have exceeded maximum number of requests and have been temporarily blocked. See documentation for more details: /messaging-api/pagination-and-rate-limits/#rate-limiting" } ]}