Updating an existing task with requested barcodes

Updating an existing task with requested barcodes

The following request will update an existing task containing no barcode requirements such that it requires one non-blocking barcode to be scanned by the driver. 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=="}]}'

❗️

Removing barcodes

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

{
  "id": "0VuO6yDq5YrGeZ7NVwUqK8hu",
  //...,
  "barcodes": {
    "required": [ 
      { "data": "bXkgc25lYWt5IHVwZGF0ZQ==", "blockCompletion": false }
    ],
    "captured": [ ]
  },
  //... 
}