Route and trip uploads, and experience publishing, run in the background. They return a task: poll its url until status is completed, then read its items and errors.
How to authenticate · OpenAPI spec for these endpoints
/api/v1/tasks/{id}.json
Returns the current state of an asynchronous task owned by the authenticated user.
Uploads are processed in the background. The upload endpoints return a task, and its
id is polled here until status becomes completed.
A completed task reports its outcome through two arrays:
items lists the assets that were created, each with an item_type, item_id and item_urlerrors lists anything that went wrong, each with a machine readable codeBoth arrays are always present. An upload that succeeded entirely has an empty errors
array, and one that created nothing has an empty items array. When an archive is
uploaded, entries are processed independently, so a task can report both created assets
and errors for the entries that failed.
x-rwgps-api-key
string
required
x-rwgps-auth-token
string
required
id
integer
path
required
task
object
id
integer
user_id
integer
url
string
type
string
gps_file_upload for uploads, experience_package for experience packagesstatus
string
pending until the task has run, then completedcreated_at
date-time
updated_at
date-time
items
array of objects
item_type
string
route or trip for uploads, experience_package for experience packagesitem_id
integer
item_url
string
or null
errors
array of objects
code
string
duplicate, time_data_missing, no_tracks, empty_file, parse_failed, failed_to_process, weigh_in_failed, build_failed, errormessage
string
item_type
string
or null
item_id
integer
or null
item_url
string
or null
curl \
-H "x-rwgps-api-key: $API_KEY" \
-H "x-rwgps-auth-token: $AUTH_TOKEN" \
https://ridewithgps.com/api/v1/tasks/123.json
{
"task": {
"id": 123,
"user_id": 123,
"url": "https://ridewithgps.com/api/v1/tasks/123.json",
"type": "gps_file_upload",
"status": "completed",
"created_at": "2000-01-01T12:00:00Z",
"updated_at": "2000-01-01T12:00:00Z",
"items": [
{
"item_type": "route",
"item_id": 123,
"item_url": "https://ridewithgps.com/api/v1/routes/123.json"
}
],
"errors": [
{
"code": "duplicate",
"message": "This route already exists",
"item_type": "route",
"item_id": 123,
"item_url": "https://ridewithgps.com/api/v1/routes/123.json"
}
]
}
}