Capturing

Capturing

Barcodes can be only be captured via the Onfleet iOS or Android driver app.

Note that capturing barcodes can be done for any task, regardless of barcode request status, provided the organization has the feature enabled. The barcode functionality may be suited for specific scenarios, and you can learn more about them here .

Once a task is completed with captured barcodes, you may access the details of these barcodes by Getting the Task via API, using any of the relevant methods from the Tasks section of the docs.

Each field of the barcodes.captured array for completed tasks will have the following properties:

NameTypeDescription
idstringThe ID of the captured barcode.
symbologystringThe symbology that was captured. You can read more about these here.
datastringThe base64 string of the data contained in the captured barcode.
locationnumber arrayThe [ lon, lat ] coordinates where the barcode capture took place.
timenumberThe time at which the barcode capture happened.
wasRequestedbooleanWhether the barcode was captured as a result of a barcode request.

Here is an example of the barcodes property for a completed task with no required barcodes:

{
  "id": "9I4cmNGtVTm5VRcq7B*lymEA",
  //...
  "barcodes": {
    "required": [],
    "captured": [
      {
        "symbology": "CODE39",
        "data": "QkMzMjE=",
        "wasRequested": false,
        "time": 1498500964205,
        "location": [
          -122.42855072021484,
          37.78808138412046
        ],
        "id": "ku0fpiCqJPC25h3W0cnfgqNn"
      },
      {
        "symbology": "UPCA",
        "data": "MDEyMzQ1Njc4OTA1",
        "wasRequested": false,
        "time": 1498500964205,
        "location": [
          -122.49481201171875,
          37.75307256315459
        ],
        "id": "leElaPdbWobzlwDoP5MuHA~h"
      }
    ]
  },
  //...
}