Apiguide

Measure

Describes the Measure endpoint

Overview

The /measure endpoint instructs the device to perform a measure operation and return the result.

The IP address of the device is required to call this endpoint. Check the Integration Guide for details on determining the device IP address.
Request
curl -i "http://<YOUR_DEVICE_ADDRESS>/api/v1/measure" \
-X GET
Example Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Mon, 24 Feb 2025 20:43:50 GMT
Server: Kestrel
Transfer-Encoding: chunked
api-supported-versions: 1.0

{
    "transactionReference": null,
    "customReference1": null,
    "customReference2": null,
    "customReference3": null,
    "imageIdentifier": "00000000-0000-0000-0000-000000000000",
    "elapsedMs": 1234,
    "dateTimeLocal": "2025-02-24T15:41:24.3898755-05:00",
    "dateTimeUtc": "2025-02-24T20:41:24.3898755Z",
    "errorCode": 0,
    "errorMessage": "-",
    "objectCount": 1,
    "dimsUnitOfMeasure": "cm",
    "weightUnitOfMeasure": "lb",
    "measurementFidelity": "0.5",
    "legalForTrade": false,
    "weight": 24.00,
    "objectId": "",
    "measuredObjects": [
        {
            "trackId": 0,
            "errorCode": 0,
            "errorMessage": "-",
            "rotationAngle": 12.3,
            "length": 10.3,
            "width": 12.1,
            "height": 14.5
        }
    ]
}

Request Parameters

The measure request has multiple optional query strings to help pass custom values and reference transactions. All parameters are optional.

Queries

PropertyData TypeDescription
TransactionReferencestringa host-supplied transaction reference for tracking purposes. This can be any value you wish to supply as something that will be tracked with the measure operation in enVision Cloud and returned in the response. Possible values are an Order ID, Tracking Number or Barcoded identifier.
CustomReference1stringa custom host-supplied reference. This value will be tagged to the transaction stored in enVision Cloud.
CustomReference2stringa custom host-supplied reference. This value will be tagged to the transaction stored in enVision Cloud.
CustomReference3stringa custom host-supplied reference. This value will be tagged to the transaction stored in enVision Cloud.

Example Query Request

An example request to measure with the query parameters

Request
curl -i "http://<YOUR_DEVICE_ADDRESS>/api/v1/measure?transactionReference=ABCD123&customReference1=XYZ123&customReference2=XYZ123&customReference3=XYZ123" \
-X GET

Response Properties

A single MeasureResult object

MeasureResult Properties

PropertyData TypeDescription
TransactionReferencestring?Externally provided reference number for the transaction.
CustomReference1string?Externally provided custom reference value for the transaction.
CustomReference2string?Externally provided custom reference value for the transaction.
CustomReference3string?Externally provided custom reference value for the transaction.
ImageIdentifierGuid?the image identifier. Use this value as input to a subsequent API call to /images to fetch images for this transaction.
ElapsedMslongCount of elapsed milliseconds taken to complete the measurement.
DateTimeLocalDateTimeDevice-local date-time of the transaction.
DateTimeUtcDateTimeUTC date-time of the transaction.
ErrorCodeintError code result. 0 indicates success.
ErrorMessagestring?Error message associated with the error code.
ObjectCountintCount of objects measured (either 0 or 1).
DimsUnitOfMeasurestring?Object dimensions unit of measure (e.g., in, cm, mm).
WeightUnitOfMeasurestring?Weight unit of measure (e.g., lb, kg).
MeasurementFidelitystring?Precision of measurement (1.0 = whole, 0.5 = half, 0.2 = 1/5).
LegalForTradeboolTrue if the device was operating in Legal for Trade mode.
Weightdecimal?Total weight in WeightUnitOfMeasure units.
ObjectIdstring?An object identifier. In this case will be populated with barcode value if a scanner is connected.
MeasuredObjectsMeasureObjectResult[]An array of MeasuredObjectResult objects. The number of items within the array is equal to ObjectCount

MeasureObjectResult Properties

PropertyData TypeDescription
TrackIdlongTrack identifier for the specific object (used in in-motion scenarios).
ErrorCodeintObject-level error code result. 0 indicates success.
ErrorMessagestringError message associated with the error code.
RotationAngledecimalAngle of rotation of the measured object.
Lengthdecimal?Length of the object in DimsUnitOfMeasure units.
Widthdecimal?Width of the object in DimsUnitOfMeasure units.
Heightdecimal?Height of the object in DimsUnitOfMeasure units.

Copyright © PHD Solutions 2024