Job Search V3

API provides the capability to search for Jobs using an Elasticsearch query, terms and match_phrase format. In the query string format, different attributes of task can be combined using AND/OR operators in the query. The search results can be restricted to specific account by providing the accountId in addition to the query.

Required permission: job-read


Searchable Properties: jobId, name, progressStatus, status, userId, username, tasks.taskIndex, tasks.name, tasks.progressStatus, tasks.status, tasks.taskType, tasks.metadata, createdOn, updatedOn

Sortable Properties: jobId, progressStatus, userId, username, tasks.taskIndex, tasks.progressStatus, tasks.taskType, createdOn, updatedOn

Sample input request body:

Search for a specific JobId using query_string with wildcard search

{
  "account": {
      "accountId": 11024,
      "includeSubaccounts": true
  },
  "query": {
    "query_string": {
      "query": "jobId: *392*"
    }
  },
  "sort": [
      {
          "propertyName": "jobId",
          "order": "ASC"
      }
  ],
  "additionalProperties": ["description", "account", "progress", "task.counts","task.progress"]
}

Request multiple jobs using query_string

{
  "account": {
      "accountId": 11024,
      "includeSubaccounts": true
  },
  "query": {
    "query_string": {
      "query": "jobId: (39265 OR 123123)"
    }
  },
  "sort": [
      {
          "propertyName": "jobId",
          "order": "ASC"
      }
  ],
  "additionalProperties": ["description", "account"]
}

Request multiple deviceIdentifiers using terms

{
    "account": {
        "accountId": 11024,
        "includeSubaccounts": true
    },
    "query": {
        "bool": {
            "must": [
                {
                    "terms": {
                        "deviceIdentifier": [
                            1110055555, 
                            11100555123
                        ]
                    }
                }
            ]
        }
    },
    "sort": [
      {
          "propertyName": "jobId",
          "order": "ASC"
      }
    ]
}

Request jobId using match_phrase

{
    "account": {
        "accountId": 11024,
        "includeSubaccounts": true
    },
    "query": {
        "bool": {
            "must": [
                {
                    "match_phrase": {
                        "jobId": "39265"
                    }
                }
            ]
        }
    },
    "sort": [
      {
          "propertyName": "jobId",
          "order": "ASC"
      }
    ]
}
Language
Credentials
Click Try It! to start a request and see the response here!
© 2023 CalAmp