Skip to content
URL:
https://<root>/services/<folderName>/<ServiceName>.<ServiceType>/jobs/query
Methods:
GET
Version Introduced:
10.9.1

Access requirements

Required privileges

The Enterprise Administrator API requires privilege-based access. An administrator must be assigned a specific user privilege, or role, to access any given endpoint. Listed below are the user privileges or roles an administrator can be assigned that provides access to this endpoint. If multiple privileges are listed, only one needs to be assigned to gain access.


Tokens

This API requires token-based authentication. A token is automatically generated for administrators who sign in to the Enterprise Administrator API directory's HTML interface. Tokens generated in this way are stored for the entirety of the session.

Those accessing the API directory outside of the HTML interface will need to acquire a session token from the generateToken operation in the Enterprise Directory API. For security reasons, all POST requests made to the Enterprise Administrator API must include a token in the request body.


Learn how to generate a token

Description

The query operation allows you to query jobs pertaining to a geoprocessing service, using a combination of the following parameters:

Request parameters

ParameterDetails

startTime

(Optional)

The earliest time to query, formatted as either a timestamp (yyyy-mm-ddThh:mm:ss) or seconds from epoch.

Examples
Use dark colors for code blocksCopy
1
2
3
4
5
//Timestamp
startTime=2021-11-15T19:29:50

//Seconds
startTime=1637004590

endTime

(Optional)

The most recent time to query, formatted as either a timestamp (yyyy-mm-ddThh:mm:ss) or seconds from epoch. If unspecified, the current time will be used.

Examples
Use dark colors for code blocksCopy
1
2
3
4
5
//Timestamp
endTime=2021-11-15T19:29:54

//Seconds
endTime=1637004594

jobStatus

(Optional)

The current status of a job. The value set with this parameter will be used to filter the jobs by that set job status.

Values: esriJobNew | esriJobSubmitted | esriJobExecuting | esriJobSucceeded | esriJobFailed | esriJobCancelling | esriJobCancelled | esriJobWaiting

userName

(Optional)

The name of the user who submitted the job.

Example
Use dark colors for code blocksCopy
1
userName=serviceAdmin

number

(Optional)

The number of jobs to display in the response. The default value is 10.

Example
Use dark colors for code blocksCopy
1
number=10

f

The response format. The default format is html.

Values: html | json | pjson

Response properties

PropertyDetails

total

The total number of jobs found by the query.

query

The parameter specified by your query, including the serviceName of the service being queried.

num

The number of jobs returned on each result page.

start

The order number of the job with which the response begins.

nextStart

The order number of the job that will be the first response on the next results page if the query returns more responses than the value specified for the number parameter. This property is intended to be used as the start value in your next JSON request. When there are no additional jobs to display past the current response, this property will be -1.

results

The jobs found by the query matching your specifications. This returns the jobID and current status of the job.

Example usage

The following is a sample request URL for the query operation:

Use dark colors for code blocksCopy
1
https://organization.example.com/<context>/admin/services/System/PublishingTools.GPServer/jobs/query?startTime=&endTime=&jobStatus=esriJobSucceeded&userName=&number=10&f=pjson

JSON Response example

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
{
  "total": 41,
  "query": {
    "serviceName": "PublishingTools",
    "userName": "",
    "status": ["esriJobSucceeded"]
  },
  "num": 10,
  "start": 1,
  "nextStart": 11,
  "results": {
    "j0550714f334d4114af9f7a5d05cb145e": "Succeeded",
    "j6123787782ba45f7a65d215630fe931b": "Succeeded",
    "j9bbbb5e272e946fdaf844e86cc6d513a": "Succeeded",
    "j4f0095e5b9a145aeb3783050d2b04fe0": "Succeeded",
    "j73318a2d534c4241b53559068ababdba": "Succeeded",
    "j52db3d9281f84038aafed219ef8a94ca": "Succeeded",
    "j42e60c06389b4b7295ea21490e92bc74": "Succeeded",
    "j8c18f527a1d34b40b0e8fa7cb271e176": "Succeeded",
    "j8420a05a6faf4bce971b6f621f69881c": "Succeeded",
    "j5c501b3c20fb49f585dfe1b3a29ce641": "Succeeded"
  }
}

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