API v2
Overview
enVision Cloud provides a set of endpoints that enable authorized parties to download historical shipment data for the purpose of analysis or integration into upstream systems.
Response Format
All calls to Shipment APIs return an array of shipment records.
[
{
"id": "00000000-0000-0000-abcd-012345678901",
"deviceId": "00000000-0000-0000-0000-abcdef012345",
"siteId": 1,
"source": "Device",
"transactionDateTime": "2020-01-30T20:37:59.601",
"transactionReference": "ORD12345",
"customReference1": "",
"customReference2": "",
"customReference3": "",
"length": 14.0,
"width": 14.0,
"height": 16.5,
"weight": 4.1,
"measurementUnitOfMeasureCd": "in",
"weightUnitOfMeasureCd": "lb",
"volume": 3234.00,
"density": 2.19,
"freightClass": null,
"media": [
{
"contentId": "427a1c3a-b47e-4e8b-bef9-0a3ba47a7d9d",
"contentType": "image/jpeg",
"description": "AnnotatedColorImageJpeg"
},
{
"contentId": "54ceef17-dc71-4f99-80ea-8881904884a7",
"contentType": "video/mp4",
"description": "Video"
}
]
}
]
| Property | Data Type | Description |
|---|---|---|
| id | GUID | enVision System-assigned unique identifier for the shipment |
| deviceId | GUID | The id of the device that created the shipment. Null for shipments that were not created by a device |
| siteId | integer | The id of the site (terminal) the shipment belongs to |
| source | string | Where the shipment came from: Device or Portal |
| transactionDateTime | DateTime | UTC Date time of the shipment. |
| transactionReference | string | transaction reference supplied by the host system |
| customReference1 | string | a custom reference value supplied by the host system |
| customReference2 | string | a custom reference value supplied by the host system |
| customReference3 | string | a custom reference value supplied by the host system |
| length | decimal | object length in measurementUnitOfMeasureCd units. Can be null |
| width | decimal | object width in measurementUnitOfMeasureCd units. Can be null |
| height | decimal | object height in measurementUnitOfMeasureCd units. Can be null |
| weight | decimal | Total weight in weightUnitOfMeasureCd units. Can be null |
| measurementUnitOfMeasureCd | string | Object dimensions unit of measure (e.g. in, cm or mm) |
| weightUnitOfMeasureCd | string | The Weight Unit of Measure (e.g. lb or kg) |
| volume | decimal | Volume of the object, in cubic measurementUnitOfMeasureCd units. Can be null |
| density | decimal | Density of the object in pounds per cubic foot. Can be null |
| freightClass | decimal | Freight class of the object. Can be null |
| media | ShipmentMedia[] | the media (images and videos) attached to the shipment. Empty if there is none |
ShipmentMedia Properties
| Property | Data Type | Description |
|---|---|---|
| contentId | GUID | the identifier used to download the file from the Shipment Media endpoint |
| contentType | string | the mimetype of the file, for example image/jpeg or video/mp4. Can be null for older media |
| description | string | a short description of the media: the image type for images (for example AnnotatedColorImageJpeg), or Video for videos. Older media without a recorded type is described as Image |
Endpoints
Shipments by Date
Returns a list of shipments where the UTC time of the shipment occurred between the specified dates. Use offset and limit to page through the results.
/api/v2/shipments/bydate
curl "https://api.ece.phdsolutions.ca/api/v2/shipments/bydate?startDate=2020-02-01&endDate=2020-12-31&offset=0&limit=100" \
-X GET \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| startDate | Yes | The start date of the range requested. Must be specified in yyyy-MM-dd. If you wish to provide a time component, use yyyy-MM-dd HH:mm:ss |
| endDate | Yes | The end date of the range requested. Must be specified in yyyy-MM-dd format. If you wish to provide a time component, use yyyy-MM-dd HH:mm:ss |
| offset | No | The number of shipments to skip. Defaults to 0 |
| limit | No | The maximum number of shipments to return. Defaults to 100, maximum 1000 |
Shipments by Site
Returns a list of shipments for the specified site (terminal) where the UTC time of the shipment occurred between the specified dates. Use offset and limit to page through the results.
/api/v2/shipments/bysite
curl "https://api.ece.phdsolutions.ca/api/v2/shipments/bysite?siteId=4&startDate=2020-02-01&endDate=2020-12-31" \
-X GET \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| siteId | Yes | The id of the site (terminal) of the request. Sites can be fetched using the /Terminals API endpoints |
| startDate | Yes | The start date of the range requested. Must be specified in yyyy-MM-dd. If you wish to provide a time component, use yyyy-MM-dd HH:mm:ss |
| endDate | Yes | The end date of the range requested. Must be specified in yyyy-MM-dd format. If you wish to provide a time component, use yyyy-MM-dd HH:mm:ss |
| offset | No | The number of shipments to skip. Defaults to 0 |
| limit | No | The maximum number of shipments to return. Defaults to 100, maximum 1000 |
Shipments by Device
Returns a list of shipments for the specified device where the UTC time of the shipment occurred between the specified dates. Use offset and limit to page through the results.
/api/v2/shipments/bydevice
curl "https://api.ece.phdsolutions.ca/api/v2/shipments/bydevice?deviceClientId=219ADFB2-04CF-4F70-8F2E-71C92D5F76A0&startDate=2020-02-01&endDate=2020-12-31" \
-X GET \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| deviceClientId | Yes | The deviceClientId for the request. Device Client Ids can be fetched using the /DeviceClients API endpoints |
| startDate | Yes | The start date of the range requested. Must be specified in yyyy-MM-dd. If you wish to provide a time component, use yyyy-MM-dd HH:mm:ss |
| endDate | Yes | The end date of the range requested. Must be specified in yyyy-MM-dd format. If you wish to provide a time component, use yyyy-MM-dd HH:mm:ss |
| offset | No | The number of shipments to skip. Defaults to 0 |
| limit | No | The maximum number of shipments to return. Defaults to 100, maximum 1000 |
Shipments by Transaction Reference
Return a list of shipments that match the specified Transaction Reference value. Use offset and limit to page through the results.
/api/v2/shipments/bytransactionreference
curl "https://api.ece.phdsolutions.ca/api/v2/shipments/bytransactionreference?tRef=ORD12345" \
-X GET \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| tRef | Yes | The Transaction Reference to match against. |
| offset | No | The number of shipments to skip. Defaults to 0 |
| limit | No | The maximum number of shipments to return. Defaults to 100, maximum 1000 |
