Updating an existing task with barcodes

Updating an existing task with barcodes

The following request will update an existing task that does not contain barcode requirements into a task that requires one barcode to be completed. Note that updating a task’s barcodes property will entirely overwrite any previously existing values.

curl -X PUT "https://onfleet.com/api/v2/tasks/0VuO6yDq5YrGeZ7NVwUqK8hu" \
       -u "cd3b3de84cc1ee040bf06512d233719c:" \
       -d '{"barcodes":[{"data":"bXkgc25lYWt5IHVwZGF0ZQ=="}]}'
{
  "id": "0VuO6yDq5YrGeZ7NVwUqK8hu",
  //...,
  "barcodes": {
    "required": [ 
      { "data": "bXkgc25lYWt5IHVwZGF0ZQ==", "blockCompletion": false }
    ],
    "captured": [ ]
  },
  //... 
}

❗️

Removing barcodes

When removing barcode requirements, remember to send in an empty array for the barcodes field instead of nil/NULL values.

curl -X PUT "https://onfleet.com/api/v2/tasks/0VuO6yDq5YrGeZ7NVwUqK8hu" \
       -u "cd3b3de84cc1ee040bf06512d233719c:" \
       -d '{"barcodes":[]}'