Software Integration Reference
Get Request
Input Request
Every API call that can be specified with POST can also be sent through GET. The GET call does the same thing as POST but converts it to a single request without any inputs. Some API calls will return errors if used in this way if they require inputs to do something.
Note: API actions (/file, /dimension, /settings, etc) should all be lowercase.
Example:
http://ip_address:7100/dimension |
Clients can retrieve specific files from the machine through GET calls. The Snapshot API, for instance, returns paths to various different data files for a particular piece of freight. You can use GET with a prepended “/file” to grab such files. Files can only be retrieved from within the “~/Cargo-Spectre” directory and no files outside of that will be accessible through this method.
Example:
http://ip_address:7100/file/Jun-13_09-24-36_2016/color-image0.png |
Output Format
Output for GET requests is the same as for POST requests. See Output format above.
JSON Exporting
- As cargo is scanned (from the remote control page)
- From the cargo details page
EXPORTED FROM | URL |
---|---|
Customer 1, Machine A | https://my-company-name.com/customer-1/machine-A |
Customer 1, Machine B | https://my-company-name.com/customer-1/machine-B |
Customer 2, Machine A | https://my-company-name.com/customer-2/machine-A |
The exported JSON will take the following format (excluding the comments):
{ "responses": { "dimension": { "code": 0, // Number - Anything besides 0 indicates an error has occurred "info": { "cargoID": 43286, // Number - Internal Cargo Spectre ID "name": "", // String - Optional cargo name "barcode": "FAKEBARCODE123", // String "comments": "Comments are optional and can be left blank. This is what we will use for Estes PRO", // String "scanDate": "2018-11-16T03:49:18", // String - UTC time in ISO format "machineName": "Laptop", // String - Human readable name of the Spectre machine that authored the data "scanGuid": "3a75b02a-9300-4ba4-a117-87869dc14e9a", // String - This may be used in future sharing scenarios "dimensions": { "length": 0.81, // Number "width": 0.54, // Number "height": 0.55, // Number "volume": 0.247132, // Number "weight": { "net": 75.5, // Number "gross": 76.5, // Number "tare": 1.5 // Number }, }, "units": { "length": "meters", // String - Applies to Length, Width, and Height "volume": "cubic meters", // String - Applies to Volume "weight": "lb" // String - Applies to Net, Gross, and Tare } } }, "snapshot": { "code": 0, // Number - Anything besides 0 indicates an error has occurred "directory": { // All path values are relative to: https://cargospectre.blob.core.windows.net/scans/ "clouds": { "path": [ // Array of strings - Point cloud 3D models of the scene "fake@shipper.com\\f2222139-ca9a-4c4a-8f44-e144455f0721\\combined-raw.pcd", "fake@shipper.com\\f2222139-ca9a-4c4a-8f44-e144455f0721\\box.pcd" ] }, "images":{ "path": [ // Array of strings - Images of the cargo "fake@shipper.com\\f2222139-ca9a-4c4a-8f44-e144455f0721\\color-image0.jpg" ] }, "thumbnails": { "path": [ // Array of strings - Same as the images above just smaller (for faster loading if needed) "fake@shipper.com\\f2222139-ca9a-4c4a-8f44-e144455f0721\\thumbnail\\color-image0.jpg" ] }, "misc": { "path": [ // Array of strings - Freight reports or other cargo documents "fake@shipper.com\\f2222139-ca9a-4c4a-8f44-e144455f0721\\Freight-Report.pdf" ] } } } } }
Additional notes
- After retrieving the JSON, you may make subsequent network calls the the images and files hosted in cloud storage and download them.
- If your customer has multiple cameras or Kinects plugged in, there will be additional images and thumbnails in their respective path arrays.