Welcome to the Ride with GPS API documentation.
Please email developers@ridewithgps.com with any feedback or questions.
An API client is required for all API requests. Manage the API clients associated with your account.
Once the API client is created, an API key (api_key) will be assigned to it.
The preferred method to authenticate is with OAuth, which you can configure from your API clients management page.
The API also supports Basic authentication, using your api_key and an authentication token. Authentication tokens can be created on the API clients management page.
Read more about authentication
Our current (and only) API version is v1 and is available at the http://ridewithgps.com/api/v1 namespace.
Only major, incompatible changes will trigger a version upgrade. We will add new endpoints and keys to existing responses without a version upgrade.
The API supports only JSON for requests and responses. To specify JSON, you can either add a content-type: application/json header to your requests, or add a .json extension to the endpoints you call. The documentation specifies URLs with a .json extension.
You can configure your API client to send webhooks to your servers whenever one of your users creates or updates an asset in their library.
API responses always contain a root key named after the requested resource(s):
// 200 - OK
{
"route": {
"id": 1,
"name": "Loop around the house",
// ...
}
}
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 include a page size, it will use the default for the route. Pagination meta data is included in the response:
// GET /api/v1/routes.json?page=1?page_size=20
// 200 - OK
{
"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.Successful requests are responded with either 200 - OK, 201 - Created, or 204 - No Content http status codes.
When reporting an error, the API responds with one of the following status codes:
404 - Not Found - the requested resource cannot be found400 - Bad Request - malformed request401 - Not Authorized - authentication is required and has failed403 - Forbidden - authenticated user lacks required permissions422 - 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:
// 401 - Not Authorized
{
"errors": ["Authentication is required and has failed"]
}
// 422 - Unprocessable Entity
{
"errors": ["name is required", "start_date is required"]
}