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. You only need to use the requesting functionality if you wish to inform the driver about barcodes to be scanned or enforce their collection.

Once a task is completed for which barcodes have been captured, you may access the details of these barcodes by fetching the task via API, using any of the relevant methods from the Tasks section of the docs.

Each object member of the barcodes.captured array property returned for completed tasks will have the following properties:

Name

Type

Description

id

string

The ID of the captured barcode.

symbology

string

The symbology that was captured. You can read more about these here.

data

string

The base64 string of the data contained in the captured barcode.

location

number array

The [ lon, lat ] coordinates where the barcode capture took place.

time

number

The time at which the barcode capture happened.

wasRequested

boolean

Whether 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"
      }
    ]
  },
  //...
}