Directions API
GET Async Route Matrix - Poll Job Status enterprise only
Poll this endpoint to check if your async route matrix calculation is complete. The jobId is the id returned from the Submit Job endpoint.
Resource URL
https://www.mapquestapi.com/directions/v2/routematrix/jobs/{jobId}
Resource Information
| Response Formats | JSON |
| Authentication | Yes (Requires Key) |
| Rate Limited | Yes |
Request Parameters
| Request Parameter | Description | Required |
|---|---|---|
| key String | The API Key, which is needed to make requests to MapQuest services. | Yes |
Note: The jobId is specified in the URL path, not as a query parameter.
Response Object
| id | The unique job identifier. |
| status | The current job status. See Job Status Values below. |
| resultsUrl | URL to retrieve the job results once the status is completed. |
Job Status Values
| Status | Description |
|---|---|
accepted | Job has been received and is queued for processing. |
inProgress | Job is currently being processed. |
completed | Job has finished processing successfully. Results are ready for retrieval. |
Transaction / Billing
TIP
This endpoint is non-billable (0 transactions). You can poll as often as needed without incurring additional costs.
Example Request
bash
curl "https://www.mapquestapi.com/directions/v2/routematrix/jobs/YWJjMTIzLWRlZjQ1Ni1naGk3ODk6dXMtZWFzdC0xOm0?key=YOUR_API_KEY"Example Response (In Progress)
json
{
"id": "YWJjMTIzLWRlZjQ1Ni1naGk3ODk6dXMtZWFzdC0xOm0",
"status": "inProgress",
"resultsUrl": "https://www.mapquestapi.com/directions/v2/routematrix/jobs/YWJjMTIzLWRlZjQ1Ni1naGk3ODk6dXMtZWFzdC0xOm0/results"
}Example Response (Completed)
json
{
"id": "YWJjMTIzLWRlZjQ1Ni1naGk3ODk6dXMtZWFzdC0xOm0",
"status": "completed",
"resultsUrl": "https://www.mapquestapi.com/directions/v2/routematrix/jobs/YWJjMTIzLWRlZjQ1Ni1naGk3ODk6dXMtZWFzdC0xOm0/results"
}Important Notes
- Polling: Repeat this request until the status is
completed, then call the Retrieve Results endpoint. - Processing time: Large matrices may take minutes to hours to compute. Use a reasonable polling interval (e.g. every 5-30 seconds depending on matrix size).
- Job ID: The
jobIdused in the URL path is theidvalue returned by the Submit Job endpoint. Use it as-is.