enVision Cloud / API Guide / Shipments

API v2

API endpoints for retrieving Shipments from enVision Cloud

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.

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

Response Format

All calls to Shipment APIs return an array of shipment records.

Example Response
[
  {
    "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"
      }
    ]
  }
]
PropertyData TypeDescription
idGUIDenVision System-assigned unique identifier for the shipment
deviceIdGUIDThe id of the device that created the shipment. Null for shipments that were not created by a device
siteIdintegerThe id of the site (terminal) the shipment belongs to
sourcestringWhere the shipment came from: Device or Portal
transactionDateTimeDateTimeUTC Date time of the shipment.
transactionReferencestringtransaction reference supplied by the host system
customReference1stringa custom reference value supplied by the host system
customReference2stringa custom reference value supplied by the host system
customReference3stringa custom reference value supplied by the host system
lengthdecimalobject length in measurementUnitOfMeasureCd units. Can be null
widthdecimalobject width in measurementUnitOfMeasureCd units. Can be null
heightdecimalobject height in measurementUnitOfMeasureCd units. Can be null
weightdecimalTotal weight in weightUnitOfMeasureCd units. Can be null
measurementUnitOfMeasureCdstringObject dimensions unit of measure (e.g. in, cm or mm)
weightUnitOfMeasureCdstringThe Weight Unit of Measure (e.g. lb or kg)
volumedecimalVolume of the object, in cubic measurementUnitOfMeasureCd units. Can be null
densitydecimalDensity of the object in pounds per cubic foot. Can be null
freightClassdecimalFreight class of the object. Can be null
mediaShipmentMedia[]the media (images and videos) attached to the shipment. Empty if there is none

ShipmentMedia Properties

PropertyData TypeDescription
contentIdGUIDthe identifier used to download the file from the Shipment Media endpoint
contentTypestringthe mimetype of the file, for example image/jpeg or video/mp4. Can be null for older media
descriptionstringa 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
Example Request
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

ParameterRequiredDescription
startDateYesThe 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
endDateYesThe 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
offsetNoThe number of shipments to skip. Defaults to 0
limitNoThe 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
Example Request
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

ParameterRequiredDescription
siteIdYesThe id of the site (terminal) of the request. Sites can be fetched using the /Terminals API endpoints
startDateYesThe 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
endDateYesThe 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
offsetNoThe number of shipments to skip. Defaults to 0
limitNoThe 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
Example Request
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

ParameterRequiredDescription
deviceClientIdYesThe deviceClientId for the request. Device Client Ids can be fetched using the /DeviceClients API endpoints
startDateYesThe 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
endDateYesThe 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
offsetNoThe number of shipments to skip. Defaults to 0
limitNoThe 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
Example Request
curl "https://api.ece.phdsolutions.ca/api/v2/shipments/bytransactionreference?tRef=ORD12345" \
-X GET \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"

Request Parameters

ParameterRequiredDescription
tRefYesThe Transaction Reference to match against.
offsetNoThe number of shipments to skip. Defaults to 0
limitNoThe maximum number of shipments to return. Defaults to 100, maximum 1000

Copyright © PHD Solutions 2024