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 "<your_api_key>:" \
-d '{"barcodes":[{"data":"bXkgc25lYWt5IHVwZGF0ZQ=="}]}'{
"id": "0VuO6yDq5YrGeZ7NVwUqK8hu",
//...,
"barcodes": {
"required": [
{ "data": "bXkgc25lYWt5IHVwZGF0ZQ==", "blockCompletion": false }
],
"captured": [ ]
},
//...
}
Removing barcodesWhen removing barcode requirements, remember to send in an empty array for the
barcodesfield instead ofnil/NULLvalues.
curl -X PUT "https://onfleet.com/api/v2/tasks/0VuO6yDq5YrGeZ7NVwUqK8hu" \
-u "<your_api_key>:" \
-d '{"barcodes":[]}'