API responses always contain a root key named after the requested resource(s):
{
"route": {
"id": 123,
"name": "Forest Park loop",
// ...
}
}
Some requests (like the routes index request at /api/v1/routes.json) support pagination with ?page={page}&page_size={page_size} query parameters. Page sizes must be between 20 and 200. If you do not send a page size, you get the default for that request. Pagination metadata is included in the response:
{
"routes": [
// ...
],
"meta": {
"pagination": {
"record_count": 207,
"page_count": 11,
"page_size": 20,
"next_page_url": "https://ridewithgps.com/api/v1/routes.json?page=2&page_size=20"
}
}
}
null value of next_page_url indicates that you have reached the last page of results.A successful request returns a 200 - OK, 201 - Created or 204 - No Content status code.
When reporting an error, the API responds with one of the following status codes:
400 - Bad Request - malformed request401 - Unauthorized - authentication is required and has failed403 - Forbidden - authenticated user lacks required permissions404 - Not Found - the requested resource cannot be found422 - Unprocessable Entity - request is unable to be processed500 - Internal Server Error - an unexpected condition was encounteredIn case of errors, the response body includes an array of error messages:
{
"errors": ["Authentication is required and has failed"]
}
{
"errors": ["name is required", "start_date is required"]
}