Skip To Content
ArcGIS Developer
Dashboard

Submit a job

Description

The submitJob operation is performed on an asynchronous task resource. The result of this operation is a Jobs resource. You can provide arguments to the submitJob operation as query parameters defined in the parameters table below.

To run a synchronous geoprocessing service task, see Execute a task .

Request parameters

ParameterDescription
<gpParameter1>, <gpParameter2>, ...

The various input parameters accepted by the corresponding geoprocessing task. These parameters are listed in the parameters property of the JSON representation associated with the geoprocessing task resource.

The valid values for the input parameters are dependent on the data type of the parameter. These values are discussed in more detail in Geoprocessing services data types.

env:outSR
Legacy:

This parameter was deprecated at 10.6.1.

See the contextparameter below.

env:processSR
Legacy:

This parameter was deprecated at 10.6.1.

See the contextparameter below.

context

Added at 10.6.1. The context of the service can be specified. Currently, contextsupports outSR, processSR, and extent. The outSR property is the spatial reference of the output geometries. The processSR property is the spatial reference that the model will use to perform geometry operations.

The spatial reference can be specified as either a well-known ID or a spatial reference JSON object. If the outSR value is not specified, the output geometries are in the spatial reference of the input geometries. If processSR is specified and outSR is not specified, the output geometries are in the spatial reference of the process spatial reference. For more information, see Using spatial references.

extent will only process features that overlap the specified extent. The output features will have an extent that is the same or larger than the extent value.

returnTrueCurves

Added at 10.5. If true, true curves will be returned in the results if the features have curves. The default is false.

Note:

The geojson output format does not support curves. Do not use f as geojson and returnTrueCurves as true in combination.

Values: true | false

Default: false

f

The response format. The default response format is html. Support for amf was added at 10.0 and removed at 10.7. Support for geojson was added at 10.5.

Values: html | json | kmz | geojson | amf (deprecated at 10.7)

Default: html

Input parameters

Learn more about the syntax and examples of supported input data types. For the output_feature_service_name parameter, see the last section.

GET request example usage

With the submitJob operation, the majority of the parameters that you include in a request are dependent on the input parameter types of the geoprocessing task you are submitting. You must encode the URL if the client you are using does not encode a request automatically.

Example 1: Submit a job

Submit a job to the ERGByChemical task.

Submit a request with values for the Incident_Point parameter and HTML return type. There is no need to provide other parameters if you want to use the default value.

https://machine.domain.com/webadaptor/rest/services/PublicSafety/EMModels/GPServer/ERGByChemical/submitJob?Incident_Point={"features":[{"geometry":{"x":-104.44,"y":34.83},"attributes":{"Id":43,"Name":"Incident"}}]}&f=html

Example 2: Request a different output spatial reference

Submit a job to the task similar to Example 1 but request that the output spatial reference be Web Mercator (102100) on 10.6 or earlier:

Adding env:outSR to the request with value 102100.

https://machine.domain.com/webadaptor/rest/services/PublicSafety/EMModels/GPServer/ERGByChemical/submitJob?Incident_Point={"features":[{"geometry":{"x":-104.44,"y":34.83},"attributes":{"Id":43,"Name":"Incident"}}]}&env:outSR=102100&f=html

Example 3: Request a processing extent

Submit a job to a geoprocessing task but request that the extent have xmin 7,602,115, ymin 660,605, xmax 7,619,050, and ymax 676,100 with the extent in spatial reference in NAD 1983 State Plane Oregon North (WKID 102726, feet).

The value of the input parameter is points, and the context has a value as above.

https://machine.domain.com/webadaptor/rest/services/ServiceName/GPServer/TaskName/submitJob?input=points&context={extent:{"xmin":7602115,"ymin":660605,"xmax":7619050,"ymax":676100,spatialReference:{"wkid":102726}}}

Example 4: Request an output feature service with input as a hosted feature service layer

The input is a feature layer of a sample server feature service with a buffer distance, among other input parameters.

https://machine.domain.com/webadaptor/rest/services/ServiceName/GPServer/TaskName/submitJob?in_features={"url":"https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/CitizenRequests/FeatureServer/0"}&buffer_distance_or_field={"distance":10,"units":"esriMiles"}&line_side=FULL&line_end_type=ROUND&method=PLANAR&esri_out_feature_service_name=output_requests_hosted_featureservice&f=json

JSON response

The response of the submitJob operation is the Jobs resource.

Output feature service name

Starting with ArcGIS Enterprise 11, you can overwrite an output feature service when you submit a job.

To overwrite an existing hosted feature service, the user running the web tool must be the owner of that hosted feature service or the ArcGIS Enterprise administrator. This requirement is in addition to all other prerequisites when using the output feature service. To learn more about the prerequisites, see Use web tools with an output feature service. Use the name, serviceURL, or itemID property of the hosted feature service to specify the hosted feature service to overwrite. If the existing hosted feature service contains critical information, back up the data, as the overwrite process will delete all existing layers of the hosted feature layer. When possible, use serviceURL or itemID, because they provide the most accurate identification of a hosted feature service. Using a name to identify a hosted feature service may not provide an exact match in some circumstances.

To learn more about how to publish a geoprocessing service with this parameter, see Use web tools with an output feature service.

JSON schema for the esri_out_feature_service_name parameter. Some properties will not have any effect in an earlier version of ArcGIS Enterprise.

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "JSON Schema for esri_out_feature_service_name",
    "description": "The JSON schema for the output feature service name parameter. Before ArcGIS Enterprise 11, only a string, which is the name of the desired output feature service name, is valid. Starting at ArcGIS Enterprise 11, new properties allow the overwrite of an output feature service.",
    "type": [
        "string",
        "object"
    ],
    "properties": {
        "serviceProperties": {
            "description": "Use a service URL or the name of a service to specify an existing hosted feature service.",
            "type": "object",
            "properties": {
                "serviceUrl": {
                    "description": "The URL of a hosted feature service.",
                    "type": "string",
                    "format": "uri"
                },
                "name": {
                    "description": "The name of a hosted feature service, this is not recommended",
                    "type": "string"
                }
            }
        },
        "itemProperties": {
            "type": "object",
            "properties": {
                "overwrite": {
                    "description": "Whether to allow overwrite.",
                    "type": "boolean"
                },
                "itemId": {
                    "description": "The itemId of the hosted feature service to be overwritten. This is the best way to specify a hosted feature service.",
                    "type": "string"
                },
                "tags": {
                    "description": "New tags to be added after the overwrite.",
                    "type": "string"
                },
                "description": {
                    "description": "New description of the overwritten hosted feature service.",
                    "type": "string"
                },
                "snippet": {
                    "description": "New snippet of the overwritten hosted feature service",
                    "type": "string"
                },
                "newFeatureServiceOnOverwriteFail":{
                    "description": "Whether to try reproject the result to overwrite.",
                    "type": "boolean"
                }
            }
        }
    }
}

Sample JSON to use an itemID to overwrite an output feature service.


{    
  "itemProperties":  {        
    "itemId": "52d34e7598e7484188228xxxxxx",
    "overwrite": true
  }
}

Sample JSON to use a serviceURL to overwrite an output feature service.


{
  "serviceProperties": {
    "serviceUrl": "https://machine.domain.com/webadaptor/rest/services/Hosted/FeatureServiceName/FeatureServer"
  },
  "itemProperties": {
    "overwrite": true
  }
}

Sample JSON to use a name to overwrite an output feature service.


{
  "serviceProperties": {
    "name": "currentfeatureservicename"
  },
  "itemProperties": {
    "overwrite": true
  }
}

In addition, you can specify the tags, description, and snippet of the new service. The new description and snippet will overwrite the existing descriptions and snippets of the hosted feature service, and the new tags will merge with existing tags.

Sample JSON to overwrite an output feature service with tags, description, and snippet.


{
  "itemProperties": {
    "itemId": "52d34e7598e7484188228xxxxxx",
    "overwrite": true,
    "tags": "a, b, c",
    "description": "custom description",
    "snippet": "custom snippet"
  }
}

You can also set an additional property when submitting a job with the output feature service parameter. For example, the geoprocessing result's spatial reference may differ from the hosted feature service you want to overwrite, or there may be temporary issues with the data store. In these cases, the overwrite will fail, resulting in a failed geoprocessing service run. However, you can use the newFeatureServiceOnOverwriteFail property to keep the geoprocessing result, especially after a long run. If the overwrite fails, an incrementing number will be appended to the current hosted feature service name, for example, currentname_1. These new hosted feature services will have the new spatial reference from the latest geoprocessing result.

Sample JSON using the newFeatureServiceOnOverwriteFail property to overwrite an output feature service with an extra attempt.


{
  "itemProperties": {
    "itemId": "52d34e7598e7484188228xxxxxx",
    "overwrite": true,
    "newFeatureServiceOnOverwriteFail": true
  }
}