I'm getting started with the online ArcGIS analysis services API. I've hit a dead-end with the connectOriginsToDestinations analysis task; even with a minimal request, I get a job failure with the response "Operation failed. Invalid URL (code = 400)".
Unfortunately, that's not much to go on, as I can't figure out from the error exactly which field in the job request the api is complaining about. The response from the job submission is "esriJobSubmitted", with a jobId to lookup, but when polling for job status, the first poll always gives me the failure message.
{
"type": "esriJobMessageTypeError",
"description": "Operation failed. Invalid URL (code = 400)."
}
Request parameters:
Job submission URL: >>https://analysis2.arcgis.com/arcgis/rest/services/tasks/GPServer/connectOriginsToDestinations/submitJob?
Job status poll URL : >>https://analysis2.arcgis.com/arcgis/rest/services/tasks/GPServer/connectOriginsToDestinations/jobs/jc004ad8813c14d75b4bf157c43b2149d?f=json&token=MYTOKEN
Submitted Task contents (a form-encoded POST body with the following fields):
f: json
token: <my token>
originsLayer: <json blob below>
destinationsLayer: <json blob below>
measurementType: "StraightLine"
Detail: originsLayer:
{
"layerDefinition": {
"geometryType": "esriGeometryPoint",
"fields": [
{
"name": "Id",
"type": "esriFieldTypeString",
"alias": "Id"
}
]
},
"featureSet": {
"geometryType": "esriGeometryPoint",
"spatialReference": {
"wkid": 4326
},
"features": [
{
"geometry": {
"x": -77.694145,
"y": 45.478969
},
"attributes": {
"Id": "id1"
}
}
]
}
}
Detail: destinationsLayer:
{
"layerDefinition": {
"geometryType": "esriGeometryPoint",
"fields": [
{
"name": "Id",
"type": "esriFieldTypeString",
"alias": "Id"
}
]
},
"featureSet": {
"geometryType": "esriGeometryPoint",
"spatialReference": {
"wkid": 4326
},
"features": [
{
"geometry": {
"x": -77.694145,
"y": 45.478969
},
"attributes": {
"Id": "id1"
}
},
{
"geometry": {
"x": -77.476424,
"y": 46.090899
},
"attributes": {
"Id": "id2"
}
}
]
}
}