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:

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