Apiguide

Cloud Trigger

Triggering an enVision Device Remotely

Triggers the specified enVision device to perform a measure operation by routing the request through enVision Cloud. The enVision device must be registered to enVision Cloud and compatible with remote triggering capability in order for this method to be supported.

This document describes the specifications of the API endpoint.

For testing Cloud Trigger integrations without having access to a physical device, refer to the Testing Cloud Trigger Guide

Cloud Trigger Specifications

Instructs the specified device to perform a measure operation and return the result.

/api/remotetrigger/measure
Request
curl "https://api.ece.phdsolutions.ca/api/remotetrigger/measure?deviceReference=ABCD2345&transactionReference=ORD1234" \
-X GET \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
You must include a valid Bearer token in the Authorization header of any request to enVision Cloud APIs. Tokens can be managed in the enVision Cloud Portal
Example Response
{
  "transactionReference": "ORD1234",
  "transactionId": "905865",
  "elapsedMs": 164,
  "dateTimeLocal": "2024-07-26T16:12:59.697Z",
  "dateTimeUtc": "2024-07-26T16:12:59.697Z",
  "errorCode": 0,
  "errorMessage": "",
  "objectCount": 1,
  "dimsUnitOfMeasure": "in",
  "weightUnitOfMeasure": "lb",
  "measurementFidelity": "0.2",
  "legalForTrade": false,
  "weight": 12.4,
  "objectId": "123456ABCD",
  "measuredObjects": [
    {
      "trackId": 1,
      "errorCode": 0,
      "errorMessage": "",
      "rotationAngle": 15.4,
      "length": 14,
      "width": 9,
      "height": 18.2
    }
  ]
}

Request Parameters

ParameterRequiredDescription
deviceReferenceYesthe 8-digit Device Registration Code of the target device. Example: ABCD2345
transactionReferenceYesa 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.

Optional Request Parameters

ParameterDescription
cRef1optional Custom Reference 1. Whatever is passed here will be attached to the transaction as the CustomReference1 field value
cRef2optional Custom Reference 2. Whatever is passed here will be attached to the transaction as the CustomReference2 field value
cRef3optional Custom Reference 3. Whatever is passed here will be attached to the transaction as the CustomReference3 field value

HTTP Response Status Codes

Status CodeDescription
200 - OKThe request was successfully routed to the target device and a response was provided in the body of the HTTP response.
400 - Bad RequestThe device reference Id provided was not valid.
401 - UnauthorizedThe bearer token provided was not valid.
504 - TimeoutThe remote device did not respond in a timely manner.

Response Properties

A single MeasureResult object

MeasureResult Properties

PropertyData TypeDescription
transactionReferencestringexternally provided reference # for the transaction
transactionIdintenVision System-assigned unique identifier for the transaction
elapsedMsintCount of elapsed milliseconds taken to complete the measurement result on the device.
dateTimeLocaldatetimeDevice-local datetime of transaction
dateTimeUtcdatetimeUTC datetime of transaction
errorCodeintError code result. 0 indicates Success
errorMessagestringerror message associated with the Error Code.
objectCountintCount of objects measured. This will either be 1 or zero.
dimsUnitOfMeasurestringObject dimensions unit of measure (e.g. in, cm or mm)
weightUnitOfMeasurestringThe Weight Unit of Measure (e.g. lb or kg)
measurementFidelitystringThe fidelity of the dimensions measurements. This may be whole units, half units or 1/5 units. 1.0 = whole, 0.5 = half, 0.2 = 1/5 units
legalForTradebooleanTrue if the device was operating in Legal for Trade mode when the measurements were captured.
weightfloatTotal weight in WeightUnitOfMeasure units
objectIdstringan object Id (such as a barcode etc.)
measuredObjectsMeasureObjectResult[]an array of MeasureObjectResult objects. The count of elements in the array is equal to the objectCount value

MeasureObjectResult Properties

PropertyData TypeDescription
trackIdintSystem-assigned trackId for the object.
errorCodeintObject-level error code result. 0 indicates Success
errorMessagestringerror message associated with the Error Code.
rotationAnglefloatobject angle of rotation
lengthfloatobject length in unitOfMeasure units
widthfloatobject width in unitOfMeasure units
heightfloatobject height in unitOfMeasure units

Copyright © PHD Solutions 2024