Contents:
This API call provides a polling URL to determine availability of the data, following creation of the job using the batchroutes.createjob API call and following starting of the job using the batchroutes.controljob API call.
It returns a status code for whether the data is yet available, and URLs of the downloadable files upon completion.
A suitable polling interval is every 60 seconds, or 30 seconds if the job is very small.
Example which requests the download status of a job.
POST https://api.cyclestreets.net/v2/batchroutes.jobdata?key=... ( [id] => 69158 [username] => myusername [password] => mypassword )
Result (before availability):
{ "id": 69158, "status": "open" "percentageComplete": 20.1, "ready": false "files": {} }
Result (upon availability) - generally the dataGz file will be the main one wanted:
{ "id": 69158, "status": "complete" "percentageComplete": 100, "errors": { "Too short: journeys must be longer than 4 metres. (Your requested journey was 0 metres).": 1 }, "ready": true, "files": { "dataCsv": "https://api.cyclestreets.net/v2/batchroutes.download?...", "dataGz": "https://api.cyclestreets.net/v2/batchroutes.download?...", "gridCsv": "https://api.cyclestreets.net/v2/batchroutes.download?...", "gridGz": "https://api.cyclestreets.net/v2/batchroutes.download?..." } }
None.
JSON response as above, containing a result status and, when available, the URLs to download the data.
It is recommended to use the 'ready' key, which returns a boolean.
JSON object containing an error key and a text string.
Example error (text string will vary):
{
"error": "An error occurred while controlling the job."
}