Skip to content

Worker API V3

Workload

Starting from version 1.9.2.0, the Next function has been expanded with a detail option. The same information as from a Reserve workload is displayed. This way, requests that have been reserved but not yet picked up can still be processed by a Robot.

Condition:

  • Only workloads with a reserved (WRR) status are displayed.
Endpoint Type Call
Workload GET /v3/work/next/detail/{WorkstationId}

Example reserved workload: WRR

{
  "ProcessId": 1,
  "ProcessSubject": "Project_Weather",
  "ProcessStepId": 1,
  "ProcessStepSubject": "GetTemperature_Today",
  "Workloads": [
    {
      "WorkloadId": 179,
      "RequestId": 93
    }
  ]
}

In the Spider dashboard, this request is now marked as reserved and can be found in the Todo. However, it will not be reserved again. To allow the robot to process this request, you can now retrieve the same information so that it can still be processed.

Example of reading a reserved request with next/detail:

{
  "ProcessId": 1,
  "ProcessSubject": "Project_Weather",
  "ProcessStepId": 1,
  "ProcessStepSubject": "GetTemperature_Today",
  "Workloads": [
    {
      "WorkloadId": 179,
      "RequestId": 93
    }
  ]
}

MileStoneLog

Operation Type Call
MileStoneLog POST /v3/milestonelog

Process status

Changes starting from version 1.6.11

Check if a process is inMaintenance. Or update process and set it to active again (disable InMaintenance status)

Operation Type Call
Process GET /v3/process/{processId}/inmaintenance
Process PUT /v3/process/{processId}/inmaintenance
Process GET /v1/process/export/{processId}/{fromDate}/{toDate}

Workload Status - SuccessAndFinish

From version 1.7.0

Set a request to success immediately, without having to execute the underlying processSteps. All underlying processSteps get the status SuccessAndFinish.

Operation Type Call
Workload PUT /v3/work/{workloadId}/{statusName}

Request information

Version 1.9.1.1

Collect information of a request except the body. Information like status, ParentId, StartDt, InsertDt and more.

Operation Type Call
Request GET /v3/request/{id}

Input: RequestId

Response:

{
  "RequestId": 22,
  "ProcessId": 1,
  "Subject": "Project_Weather",
  "Type": "REQUEST",
  "ParentId": 0,
  "From": "SAIO",
  "Source": "SAIO",
  "Status": "RSS",
  "NumberOfTimesRestarted": 0,
  "StartDt": "2024-04-10T16:04:29",
  "InsertDt": "2024-04-10T16:04:28.413",
  "ActualStartDt": null,
  "FinishedDt": null
}

Search expansion v2

In addition to 1.9.1.1, more features have been added starting from version 1.12.0. You can now search by Status, Date Range, AllowNulls, or a combination of these.

Operation Type Call
Request GET /v3/request/search

Optional parameters can be used.

Optional parameters

Parameter Type Description
pageNumber Query Which pages to display
pageSize Query How many results per page to display.
orderBy Query Order the result set by specific fields (e.g., StartDt).
isAscending Query Sort in ascending or descending order based on the orderBy selection.

OrderBy

Parameter Optie
pageNumber Integer
pageSize Integer
orderBy RequestId
orderBy ProcessId
orderBy Subject
orderBy Type
orderBy ParentId
orderBy From
orderBy Source
orderBy Status
orderBy NumberOfTimesRestarted
orderBy StartDt
orderBy InsertDt
orderBy ActualStartDt
orderBy FinishedDt
isAscending Empty (default false)
isAscending True
isAscending False

Search Conditions

Processes

At least one processId OR one Process subject.

After this, you can search using a single search term or a combination of them. When combining, keep the following in mind.

Datefield

When using DateTimes and Source, you can only search on specific date fields. See below which fields are available for searching within the 'Source' type.

Datefield StartDt InsertDt ActualStartDt FinishedDt
Source: Staging v
Source: Request v v v v

AllowNull

The AllowNull option allows for specific searches. Note that not every field can have a NULL status.

Datefield StartDt InsertDt ActualStartDt FinishedDt
Source: Staging NOT NULL
Source: Request NULL NOT NULL NULL NULL

Source

This addition allows for specific searches in combination with the DateFields option. Below is an overview of what can be used in combination with the DateField option combined with the Source

DateTimes Option StartDt InsertDt ActualStartDt FinishedDt
Source Staging v
Source Request v v v v

Example 1

Search by ProcessId and Body.

{
  "ProcessIds": [
    1
  ],
  "Body": "Zaandam"
}

Example 2

Search within multiple processes (based on ProcessId) for occurrences of the body..

{
  "ProcessIds": [
    1,4,16
  ],
  "Body": "Zaandam"
}

Example 3

Search within two processes, in a date range, with a body, where the source is a request, and the ActualStartDt must not be empty.

{
  "ProcessIds": [
    1,2
  ],
  "Body": "Zundert",

  "DateTimes": [
    {
      "DateField": "ActualStartDt",
      "DateFrom": "2024-10-15",
      "DateTo": "2024-10-22",
      "AllowNull": false,
      "Source": "Request"
    }
  ]
}

Example 4

Searching by status is only possible if the status belongs to a Request or Staging. Check the Type at Spider statussen which include Request or Staging.

{
  "ProcessIds": [
    2
  ],
  "StatusSet": [
    "RFN"
  ]
}

Returns a response that the status is unknown (it's an Alarm status and doesn't belong to a Request/Staging status).

{
  "Message": "The request is invalid.",
  "ModelState": {
    "requestSearchFilter.StatusSet": [
      "Status with code 'ARN' is not supported"
    ]
  }
}

Example 5

Searching for a ParentId within a process returns all requests linked to this ParentId.

{
  "ProcessIds": [
    2
  ],
  "ParentIds": [
    55
  ]
}