Skip to main content

Command a Dim

The general usecase for commanding a dim involves sending a dimensioning command, usually with a barcode from a barcode reader or a WMS app as well. This can be done in multiple ways.

Note that the data in a barcode field does not need to be an actual barcode. It is simply treated as a unique identifier that can be used to associate dimension data (and pictures) to the freight in question. For instance, if using the Spectre Cloud, you can easily search by whatever data you sent in the barcode field.

These commands do not save data

Sending a Dimension command does NOT save the dim data to the computer's storage, nor does it save pictures, generate freight reports, etc. This command ONLY returns the dimensions and weight.

Pair a Dimension command with a Snapshot command after it to dimension, save data, and get the resulting filepaths. See here for an example.

Divided responsibilities

These commands were split up to allow for error checking on behalf of operators if desired. An operator could trigger a dim, ensure that the freight was properly positioned, and then send a command to save data once they are comfortable with the results. However, in Getting Started you can find how to combine multiple commands into one request. This will allow you to streamline the operation of your Spectre into one button-press by the operator.

<Dimension>

Request

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

Desired response format:

Accept: application/xml (DEFAULT)

Response

The response will return a code of 0 to mean that the request completed without errors. The major nodes of Request/Dimension/Info are:

  • Dimensions: The dimension data, with volume included, as well as net, gross, and tare weight (as well as optional barcode)
  • Units: Distance, volume, and weight units for each dimension
  • Scanner: Information on scanner configuration
<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>0</Gross>
<Tare>0</Tare>
</Weight>
<Barcode/>
</Dimensions>
<Units>
<Length>inches</Length>
<Volume>cubic feet</Volume>
<Weight>lb</Weight>
</Units>
<Scanner>
<Mode>CARGO</Mode>
</Scanner>
</Info>
</Dimension>
</Responses>

Request with Barcode Parameter

Endpoint

Request a dimension from a machine with local IP address 10.1.1.2 set to port 7100. A barcode of "12345" is sent along with the request.

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

Header

Desired response format:

Accept: application/xml (DEFAULT)

Response with Barcode Parameter

The response will return a code of 0 to mean that the request completed without errors. The major nodes of Request/Dimension/Info are:

  • Dimensions: The dimension data, with volume included, as well as net, gross, and tare weight (as well as optional barcode)
  • Units: Distance, volume, and weight units for each dimension
  • Scanner: Information on scanner configuration
<Responses>
<Dimension code="0">
<Info>
<Dimensions>
<Length>59.0</Length>
<Width>44.5</Width>
<Height>25.5</Height>
<Volume>38.7444</Volume>
<Weight>
<Net>0</Net>
<Gross>0</Gross>
<Tare>0</Tare>
</Weight>
<Barcode>12345</Barcode>
</Dimensions>
<Units>
<Length>inches</Length>
<Volume>cubic feet</Volume>
<Weight>lb</Weight>
</Units>
<Scanner>
<Mode>CARGO</Mode>
</Scanner>
</Info>
</Dimension>
</Responses>

<SetBarcode>

Occasionally, a user may desire to set the barcode independently of all other operations. For the sake of completeness then, we have provided a separate API command to set the barcode without automatically triggering a scan. This command can, of course, still be sent in the same request as a Dimension command to achieve the same effect.

Barcode is a string

Barcode should always be set to a string literal, e.g. "12345" and not 12345 to avoid unwanted behavior.

Optional parameter name
SetBarcode takes a parameter called Value, not Barcode. This is in contrast to Dimension which takes optional parameter Barcode

Request

Endpoint

Request to set the barcode for the next scan to a machine with local IP address 10.1.1.2 set to port 7100.

GET http://10.1.1.2:7100/SetBarcode?Value=12345

Header

Desired response format:

Accept: application/xml (DEFAULT)

Response

The response will return a code of 0 to mean that the request completed without errors. No other data is returned.

<Responses>
<SetBarcode code="0"/>
</Responses>