Job request data types

feature

Inputs with feature data type can be specified using a JSON structure that represents the features.

You can either specify the complete input using json, or you can publish the input as a feature service or map service and specify the URL of the feature service or map service layer as the input.

  • The example shows a last mile delivery service's order input feature. Refer to each feature input's documentation for the supported attributes for each feature.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "spatialReference": {
    "wkid": "<wkid>",
    "latestWkid": "<wkid>"
  },
  "features": [
    {
      "geometry": {
        "x": "<x1>",
        "y": "<y1>"
      },
      "attributes": {
        "<field1>": "<value11>",
        "<field2>": "<value12>"
      }
    },
    {
      "geometry": {
        "x": "<x2>",
        "y": "<y2>"
Expand

table

Inputs with table data type can be specified using a JSON structure that represents the records.

You can either specify the complete input using json, or you can publish the input as a feature service or map service and specify the URL of the table layer within the feature service or map service as the input.

  • The example shows a last mile delivery service's routes input feature. Refer to each feature input's documentation for the supported attributes for each feature.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "features": [
    {
      "attributes": {
        "<field1>": "<value11>",
        "<field2>": "<value12>"
      }
    },
    {
      "attributes": {
        "<field1>": "<value21>",
        "<field2>": "<value22>"
      }
    }
  ]
}

datetime

Datetime data type is specified as milliseconds since epoch for the date and time. For example, 1451606400000 represents 01/01/2016 00:00:00.

date

Date data type is specified as YYYY-MM-DD. For example: 2023-03-15.

time

Time data type is specified as hh:mm:ss, for example: 14:30:30.

travel_mode_object

Travel modes are managed in ArcGIS Enterprise and can be configured by the administrator of your organization to better reflect the organization's workflows.

You must specify the JSON object containing the settings for a travel mode supported by your organization. For a list of supported travel modes, run the GetTravelModes tool from the Utilities service.

The value for the travel_mode parameter should be a JSON object representing travel mode settings. When you use the GetTravelModes tool from the Utilities service, a string representing the travel mode JSON is returned. You need to convert this string to a valid JSON object using your API, and pass the JSON object as the value for the travel_mode parameter.

The response below is returned by the GetTravelModes tool.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
  "results": [
    {
      "paramName": "supportedTravelModes",
      "dataType": "GPRecordSet",
      "value": {
        "displayFieldName": "",
        "fields": [
          {
            "name": "ObjectID",
            "type": "esriFieldTypeOID",
            "alias": "ObjectID"
          },
          {
            "name": "Name",
            "type": "esriFieldTypeString",
            "alias": "Travel Mode Name",
            "length": 255
          },
          {
Expand

From the response above, the following is a string representing the Walking Time travel mode:

Use dark colors for code blocksCopy
1
"{\"attributeParameterValues\": [{\"attributeName\": \"Avoid Private Roads\", \"parameterName\": \"Restriction Usage\", \"value\": \"AVOID_MEDIUM\"}, {\"attributeName\": \"Walking\", \"parameterName\": \"Restriction Usage\", \"value\": \"PROHIBITED\"}, {\"attributeName\": \"Preferred for Pedestrians\", \"parameterName\": \"Restriction Usage\", \"value\": \"PREFER_LOW\"}, {\"attributeName\": \"WalkTime\", \"parameterName\": \"Walking Speed (km/h)\", \"value\": 5}, {\"attributeName\": \"Avoid Roads Unsuitable for Pedestrians\", \"parameterName\": \"Restriction Usage\", \"value\": \"AVOID_HIGH\"}], \"description\": \"Follows paths and roads that allow pedestrian traffic and finds solutions that optimize travel time. The walking speed is set to 5 kilometers per hour.\", \"distanceAttributeName\": \"Kilometers\", \"id\": \"caFAgoThrvUpkFBW\", \"impedanceAttributeName\": \"WalkTime\", \"name\": \"Walking Time\", \"restrictionAttributeNames\": [\"Avoid Private Roads\", \"Avoid Roads Unsuitable for Pedestrians\", \"Preferred for Pedestrians\", \"Walking\"], \"simplificationTolerance\": 2, \"simplificationToleranceUnits\": \"esriMeters\", \"timeAttributeName\": \"WalkTime\", \"type\": \"WALK\", \"useHierarchy\": false, \"uturnAtJunctions\": \"esriNFSBAllowBacktrack\"}"

The value above should be converted to a valid travel mode JSON object and passed as the value for the travel_mode parameter as shown below.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  "attributeParameterValues": [
    {
      "attributeName": "Avoid Private Roads",
      "parameterName": "Restriction Usage",
      "value": "AVOID_MEDIUM"
    },
    {
      "attributeName": "Walking",
      "parameterName": "Restriction Usage",
      "value": "PROHIBITED"
    },
    {
      "attributeName": "Preferred for Pedestrians",
      "parameterName": "Restriction Usage",
      "value": "PREFER_LOW"
    },
    {
      "attributeName": "WalkTime",
      "parameterName": "Walking Speed (km/h)",
Expand

locate_settings_object

This object is used to specify settings that affect how inputs are located, such as the maximum search distance to use when locating the inputs on the network or the network sources being used for locating.

To restrict locating on a portion of the source, you can specify a where clause for a source. Learn more about locating inputs

The locate settings object is specified as a JSON object. The JSON object allows you to specify a locator JSON for all input feature in the analysis, or you can specify an override for a particular input. The override allows you to have different settings for each analysis input. For example, you can disallow stops to locate on highway ramps and allow point barriers to locate on highway ramps.

The locator JSON object has the following properties:

  • tolerance and toleranceUnits—Control the maximum search distance when locating inputs. If no valid network location is found within this distance, the input features will be considered unlocated. A small search tolerance decreases the likelihood of locating on the wrong street but increases the likelihood of not finding a valid network location. The toleranceUnits parameter value can be specified as one of the following values:

    • esriCentimeters
    • esriDecimalDegrees
    • esriDecimeters
    • esriFeet
    • esriInches
    • esriIntFeet
    • esriIntInches
    • esriIntMiles
    • esriIntNauticalMiles
    • esriIntYards
    • esriKilometers
    • esriMeters
    • esriMiles
    • esriMillimeters
    • esriNauticalMiles
    • esriYards
  • sources—Control which network source can be used for locating. For example, you can configure the analysis to locate inputs on streets but not on sidewalks. The list of possible sources on which to locate is specific to the network dataset this service references. Only the sources that are in the sources array are used for locating. You can specify a where clause on each source you specified in the sources array to further restrict locating on that source matching certain characteristics using an SQL expression. For example, you can configure the analysis to locate inputs only on street features matching certain road classes such as avoiding highway ramps. sources is specified as an array of objects, each having the following properties:

    • name—The name of the network source feature class that can be used for locating inputs.
    • where—An SQL expression on the network source feature class.
  • allowAutoRelocate—Control whether inputs with existing network location fields can be automatically relocated when solving to ensure valid, routable location fields for the analysis. If the value is true, points located on restricted network elements and points affected by barriers will be relocated to the closest routable location. If the value is false, network location fields will be used as they are even if the points are unreachable, and this may cause the solve to fail. Even if the value is false, inputs with no location fields or incomplete location fields will be located during the solve operation.

The following is the syntax for locating settings using a JSON structure:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  "default": {
    "tolerance": "<value>",
    "toleranceUnits": "<unit>",
    "allowAutoRelocate": "true | false",
    "sources": [
      {
        "name": "<sourceName>",
        "where": "<whereClause>"
      }
    ]
  },
  "overrides": {
    "orders": {
      "tolerance": "<value>",
      "toleranceUnits": "<unit>",
      "allowAutoRelocate": "true | false",
      "sources": [
        {
          "name": "<sourceName>",
Expand

usage_cost_object

The usage_cost object is returned as a JSON with the following syntax:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "paramName": "Usage_Cost",
  "dataType": "GPString",
  "value": {
    "numObjects": "<number>",
    "credits": "<number>"
  }
}

Example for usage_cost

The following shows an example of the usage_cost parameter in which the analysis generated 9 billable objects (represented by numObjects) and 4.5 credits were used by the analysis.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "paramName": "Usage_Cost",
  "dataType": "GPString",
  "value": {
    "numObjects": 9,
    "credits": 4.5
  }
}

context_object

The Context object contains the following additional settings that affect task operation:

  • Extent (extent)—A bounding box that defines the analysis area. Only input features that intersect the bounding box will be analyzed.
  • Output spatial reference (outSR)—The output features will be projected into the output spatial reference.

file

Outputs with file data type are returned as a JSON structure with a url field. The value of the url field is a URL to the location of the output file.

By default, these files will no longer be available when directories get cleaned up periodically. To learn more about these directories, and configure the frequency of the cleanup, see Server directories

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{
  "paramName": "<paramName>",
  "dataType": "GPDataFile",
  "value": {
    "url": "<url>"
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.