Skip to main content

Examples

This page will provide the most common use cases and examples of how to achieve them via API. New examples are constantly being added.

Example 1 - Most Common Operation of Cargo Spectre Devices

The most common way to trigger a Cargo Spectre Dimensioner is by requesting the Dimension and Snapshot commands one after the other. Below is an example of how to achieve this and what the resulting response looks like.

Request Dimension & Snapshot

Request a dimension from a machine with local IP address 10.1.1.2 set to port 7100.

Endpoint

GET http://10.1.1.2:7100/Dimension+Snapshot

Desired response format:

Accept: application/xml (DEFAULT)

Response from Dimension & Snapshot

<Responses>
<Dimension code="0"/>
<Info>
<Dimensions>
<Length>59.5</Length>
<Width>45.0</Width>
<Height>25.5</Height>
<Volume>39.5117</Volume>
<Density>39.5117</Density>
<Weight>
<Net>0</Net>
<Gross/>
<Tare>0</Tare>
</Weight>
<Barcode/>
</Dimensions>
<Units>
<Length>inches</Length>
<Volume>cubic feet</Volume>
<Weight>lb</Weight>
<Density>lb/cubic feet</Density>
</Units>
<Scanner>
<Mode>CARGO</Mode>
<Certified>16-040A1</Certified>
</Scanner>
</Info>
</Dimension>
<Snapshot code="0">
<Directory>
<Misc>
<Path>Jul-6_21-25-32_2018/Freight-Report.pdf</Path>
</Misc>
<Clouds>
<Path>Jul-6_21-25-32_2018/005337361647-raw.pcd</Path>
<Path>Jul-6_21-25-32_2018/combined-raw.pcd</Path>
<Path>Jul-6_21-25-32_2018/005302461647-raw.pcd</Path>
<Path>Jul-6_21-25-32_2018/box.pcd</Path>
</Clouds>
<Images>
<Path>Jul-6_21-25-32_2018/color-image1.png</Path>
<Path>Jul-6_21-25-32_2018/color-image1-marked.png</Path>
<Path>Jul-6_21-25-32_2018/color-image0.png</Path>
<Path>Jul-6_21-25-32_2018/color-image0-marked.png</Path>
<Path>Jul-6_21-25-32_2018/Image-from-webcam.png</Path>
</Images>
<Xmls>
<Path>Jul-6_21-25-32_2018/info.xml</Path>
</Xmls>
</Directory>
</Snapshot>
</Responses>

Request Dimension with Barcode & Snapshot

Request a dimension from a machine with local IP address 10.1.1.2 set to port 7100. Send it a known barcode number that is a unique identifier for the freight in question.

Endpoint

GET http://10.1.1.2:7100/Dimension?Barcode=12345+Snapshot

Header

Desired response format:

Accept: application/xml (DEFAULT)

Response from Dimension with Barcode & Snapshot

<Responses>
<Dimension code="0"/>
<Info>
<Dimensions>
<Length>59.5</Length>
<Width>45.0</Width>
<Height>25.5</Height>
<Volume>39.5117</Volume>
<Weight>
<Net>0</Net>
<Gross/>
<Tare>0</Tare>
</Weight>
<Barcode>12345</Barcode>
<Density>0</Density>
</Dimensions>
<Units>
<Length>inches</Length>
<Volume>cubic feet</Volume>
<Weight>lb</Weight>
<Density>lb/cubic feet</Density>
</Units>
<Scanner>
<Mode>CARGO</Mode>
<Certified>null</Certified>
</Scanner>
</Info>
</Dimension>
<Snapshot code="0">
<Directory>
<Misc>
<Path>Jul-6_21-25-32_2018/Freight-Report.pdf</Path>
</Misc>
<Clouds>
<Path>Jul-6_21-25-32_2018/005337361647-raw.pcd</Path>
<Path>Jul-6_21-25-32_2018/combined-raw.pcd</Path>
<Path>Jul-6_21-25-32_2018/005302461647-raw.pcd</Path>
<Path>Jul-6_21-25-32_2018/box.pcd</Path>
</Clouds>
<Images>
<Path>Jul-6_21-25-32_2018/color-image1.png</Path>
<Path>Jul-6_21-25-32_2018/color-image1-marked.png</Path>
<Path>Jul-6_21-25-32_2018/color-image0.png</Path>
<Path>Jul-6_21-25-32_2018/color-image0-marked.png</Path>
<Path>Jul-6_21-25-32_2018/Image-from-webcam.png</Path>
</Images>
<Xmls>
<Path>Jul-6_21-25-32_2018/info.xml</Path>
</Xmls>
</Directory>
</Snapshot>
</Responses>