I'm using postman to prepare a request.
Below is an example of a successful routing between Orlando. FL to Tallahassee FL.
GET https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve?token={{token}}&f=json&stops=-81.3753552,28.5387011; -84.3078194,30.4382702
Now I want to add additional parameters shown here: Direct request—ArcGIS REST APIs | ArcGIS Developers.
1) restrictionAttributeNames
2) attributeParameterValues
These should be something like:
"restrictionAttributeNames":"Height Restriction, Width Restriction, Weight Restriction, Weight per Axle Restriction, Length Restriction, Kingpin to Rear Axle Length Restriction, Axle Count Restriction, Use Preferred Truck Routes",
"attributeParameterValues": [
{
"attributeName": "Height Restriction",
"parameterName": "Vehicle Height (meters)",
"value": 3.6576
},
{
"attributeName": "Width Restriction",
"parameterName": "Vehicle Width (meters)",
"value": 3.6576
},
{
"attributeName": "Weight Restriction",
"parameterName": "Vehicle Weight (kilograms)",
"value": 10000
},
{
"attributeName": "Weight per Axle Restriction",
"parameterName": "Vehicle Weight per Axle (kilograms)",
"value": 1500
},
{
"attributeName": "Length Restriction",
"parameterName": "Vehicle Length (meters)",
"value": 15.24
},
{
"attributeName": "Kingpin to Rear Axle Length Restriction",
"parameterName": "Vehicle Kingpin to Rear Axle Length (meters)",
"value": 15.24
},
{
"attributeName": "Axle Count Restriction",
"parameterName": "Number of Axles",
"value": 7
},
{
"attributeName": "Use Preferred Truck Routes",
"parameterName": "Restriction Usage",
"value": "Prefer_High"
}
]
But I can't seem to format these properly into the request.
1) Am I doing this right?
2) Am I forgetting some other parameter?
3) What should the request look like?
Please help! Thanks!
Solved! Go to Solution.
Solved my own questions with more research. The GET request was too much. Needed to use a POST.
Different endpoint and documentation though. 😞
These docs better explain the body requirements.
Docs: Job request—ArcGIS REST APIs | ArcGIS Developers
POST https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/submitJob
Response: {"jobId": "j751....","jobStatus": "esriJobSubmitted"}
GET: https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/jobs/{{jobId}}?returnMessages=true&f=json&token={{token}}
Solved my own questions with more research. The GET request was too much. Needed to use a POST.
Different endpoint and documentation though. 😞
These docs better explain the body requirements.
Docs: Job request—ArcGIS REST APIs | ArcGIS Developers
POST https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/submitJob
Response: {"jobId": "j751....","jobStatus": "esriJobSubmitted"}
GET: https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/jobs/{{jobId}}?returnMessages=true&f=json&token={{token}}