Skip to content

Backfill Task Locations

Request
Description Creates missing TaskLocation entries for existing tasks in a configuration. Useful when checkForTaskLocation was enabled after tasks already existed.
Context https://<instance>.optimizemyday.com/omdservices/rs/v1
URL /taskLocations/backfill
Method POST
Request Type None
Response Code 200 when successful, another HTTP status code otherwise
Success Response A JSON object with processing counters and paging information.
Response Type JSON
Query Parameter Datatype Description
configId String The external identifier of the configuration.
offset Integer Zero-based start index of the task page to process. Default: 0.
limit Integer Maximum number of tasks to scan in one call. Default: 1000.
dryRun Boolean If true, no task locations are persisted. Default: false.

Preconditions

  • The caller must have read-write permission on the configuration.
  • The preferences checkForAccountNumber and checkForTaskLocation must both be true.
  • If checkForTaskLocationXPath is configured, its value is used as task location identifier when non-empty.
  • If no identifier can be derived via XPath, the hashed address key is used.

Sample Call

https://sandbox.optimizemyday.com/omdservices/rs/v1/taskLocations/backfill?configId=16167225&offset=0&limit=1000&dryRun=false

Sample Success Response

{
  "success": true,
  "configurationId": 16167225,
  "dryRun": false,
  "offset": 0,
  "limit": 1000,
  "scanned": 1000,
  "processed": 984,
  "skippedWithoutAccount": 16,
  "errors": 0,
  "totalTasks": 45230,
  "hasMore": true,
  "nextOffset": 1000
}

Sample Validation Error Response

{
  "success": false,
  "message": "Preferences checkForAccountNumber and checkForTaskLocation must both be true.",
  "checkForAccountNumber": true,
  "checkForTaskLocation": false
}