Skip to main content
Skip to Content
Dispatch API
This is the documentation for Dispatch API v0.2b, which is no longer actively maintained. For up-to-date documentation, see the latest version (v1.0).

On resource IDs

Every resource in the Spoke Public API has a unique ID. This ID is generated by Spoke and is unique for every resource per collection.

Every resource representation returned by the API will show the ID in the following format:

{
  "id": "collectionName/resourceId"
}

And if the resource is on a sub-collection, it will be in the following format:

{
  "id": "collectionName/resourceId/subcollectionName/subResourceId"
}

For example, a stop with ID stop1 under a plan with ID plan1 will have the following representation on its serialized ID field:

{
  "id": "plans/plan1/stops/stop1"
}

This means that if you wish to directly retrieve this stop by using a GET endpoint you can simply use this ID as follows:

curl "https://api.spoke.com/public/v0.2b/`serializedId`" -u yourApiKey:

For the example above this would be:

curl "https://api.spoke.com/public/v0.2b/plans/plan1/stops/stop1" -u yourApiKey: