Get and Change Device Settings
Device settings can be retrieved and changed remotely, allowing you to replicate our settings on your own app and render using the Spectre GUI on the machine unnecessary. This can be especially helpful in cases where a keyboard and mouse are removed from the machine.
Settings have permissions on them that cannot be changed. Settings with "r" permissions are retrievable via API. Settings with "w" permission are additionally settable via API. This information can be retrieved with the GetSettingInfo
command.
<GetSetting>β
GetSetting
can be used to retrieve some or all settings. However, functionality is dependent on request type.Request - All Settingsβ
- GET
- POST
Endpointβ
Request all settings from a machine with local IP address 10.1.1.2
set to port 7100
.
Headerβ
- XML
- JSON
Desired response format:
Accept: application/xml
(DEFAULT)Desired response format:
Accept: application/json
Endpointβ
A Cargo Spectre POST request is sent to the machine without any API in the endpoint, as below:
Headerβ
- XML
- JSON
Desired response format:
Accept: application/xml
(DEFAULT)Desired response format:
Accept: application/json
Bodyβ
- XML
- JSON
<Requests>
<GetSetting/>
</Requests>
{
"Requests":{
"GetSetting":{}
}
}
Response - All Settingsβ
The Responses/GetSetting/
node contains both a code
(where code "0" indicates success) and a /Settings
node where the data is present. All settings data begins with /Settings
as internally settings are represented by an XML tree.
List is not regularly maintained
Example settings might be out of date. To check what settings are available to you, request GetSettings
from your machine.
Cargo Spectre reserves the right to append additional nodes to the paths. Cargo Spectre will not remove or rearrange paths (e.g. /Settings/Device/Name will not disappear, nor will it become /Settings/Info/Name) but some paths may be 'tacked on' (e.g. /Settings/Device/NewNode)
danger
Cargo Spectre highly recommends parsing the full XML or JSON tree instead of looking for a setting at a specific line number or by a specific keyword. Cargo Spectre promises that paths will be unique, but specific node names may not. E.g. 'Name' might be repeated, but /Settings/Device/Name will not.
Furthermore, if an additional node is added further up in the tree, searching for a desired setting on line number 40 will break. Always traverse the tree with an XML or JSON parser instead.
- XML
- JSON
This is a particularly large response
<Responses>
<GetSetting code="0">
<Settings>
<Device>
<Version>3.0.154</Version>
<Name>test-machine</Name>
<Scale>
<Format>Totalcomp Continuous Format</Format>
<Baud>9600</Baud>
<Parity>7 data bits, even parity bit, 1 stop bit</Parity>
<Ntep></Ntep>
</Scale>
</Device>
<Scanner>
<Mode>CARGO</Mode>
<Upload>Never</Upload>
<AutoBarcodeEnabled>false</AutoBarcodeEnabled>
<AutoBarcodeDelay>5</AutoBarcodeDelay>
<AutoSaveEnabled>true</AutoSaveEnabled>
<AutoExportEnabled>false</AutoExportEnabled>
</Scanner>
<Calibration>
<Path>~/.spectre/May-14_10-45-42_2021/</Path>
<Crash>false</Crash>
</Calibration>
<Units>
<Length>inches</Length>
<Volume>cubic feet</Volume>
<Weight>lb</Weight>
</Units>
<Licensing>
<Email>fake@shipper.com</Email>
</Licensing>
<Snapshot>
<Save></Save>
<Images>
<Format>JPG</Format>
</Images>
<Clouds>
<Format>PCD</Format>
</Clouds>
</Snapshot>
<Printing>
<Logo></Logo>
<LogoPlacement>Left</LogoPlacement>
<Pdf>true</Pdf>
<BoxIncluded>true</BoxIncluded>
<Label>true</Label>
<LabelPrinterName></LabelPrinterName>
<BarSymbology>Code 128</BarSymbology>
<ReportPrinterName></ReportPrinterName>
<DimBarcodes>false</DimBarcodes>
<SimplifiedLabel>false</SimplifiedLabel>
<ReportQuantity>1</ReportQuantity>
<LabelQuantity>1</LabelQuantity>
</Printing>
<Network>
<Proxy>false</Proxy>
</Network>
<RemoteApi>
<Port>7100</Port>
</RemoteApi>
<Support>
<Sample>
<Reporting>true</Reporting>
</Sample>
<LoginPrompt>true</LoginPrompt>
</Support>
</Settings>
</GetSetting>
</Responses>
This is a particularly large response
{
"Responses": {
"GetSetting": {
"code": "0",
"Settings": {
"Calibration": {
"Crash": {
"value": false
},
"Path": {
"value": "~/.spectre/May-14_10-45-42_2021/"
}
},
"Device": {
"Name": {
"value": "test-machine"
},
"Scale": {
"Baud": {
"value": "9600"
},
"Format": {
"value": "Totalcomp Continuous Format"
},
"Ntep": {
"value": "SomeNTEPNumber"
},
"Parity": {
"value": "7 data bits, even parity bit, 1 stop bit"
}
},
"Version": {
"value": "3.0.160"
}
},
"Licensing": {
"Email": {
"value": "shai.bernstein1@gmail.com"
}
},
"Network": {
"Proxy": {
"value": false
}
},
"Printing": {
"BarSymbology": {
"value": "Code 128"
},
"BoxIncluded": {
"value": true
},
"DimBarcodes": {
"value": false
},
"Label": {
"value": true
},
"LabelPrinterName": {
"value": "printer name"
},
"LabelQuantity": {
"value": 1
},
"Logo": {
"value": "path/to/logo"
},
"LogoPlacement": {
"value": "Left"
},
"Pdf": {
"value": true
},
"ReportPrinterName": {
"value": "printer name"
},
"ReportQuantity": {
"value": 1
},
"SimplifiedLabel": {
"value": false
}
},
"RemoteApi": {
"Port": {
"value": 7100
}
},
"Scanner": {
"AutoBarcodeDelay": {
"value": 3
},
"AutoBarcodeEnabled": {
"value": true
},
"AutoExportEnabled": {
"value": false
},
"AutoSaveEnabled": {
"value": true
},
"Mode": {
"value": "CARGO"
},
"Upload": {
"value": "Never"
}
},
"Snapshot": {
"Clouds": {
"Format": {
"value": "PCD"
}
},
"Images": {
"Format": {
"value": "JPG"
}
},
"Save": {
}
},
"Support": {
"Sample": {
"Reporting": {
"value": true
}
}
},
"Units": {
"Length": {
"value": "inches"
},
"Volume": {
"value": "cubic feet"
},
"Weight": {
"value": "lb"
}
}
}
}
}
}
Request - Particular Settingsβ
Getting particular settings is accomplished by specifying the parameter of Path
to the GetSetting
command.
- GET
- POST
Endpointβ
Request a specific setting from a machine with local IP address 10.1.1.2
set to port 7100
.
Or request multiple settings:
Headerβ
- XML
- JSON
Desired response format:
Accept: application/xml
(DEFAULT)Desired response format:
Accept: application/json
Endpointβ
A Cargo Spectre POST request is sent to the machine without any API in the endpoint, as below:
Headerβ
- XML
- JSON
Desired response format:
Accept: application/xml
(DEFAULT)Desired response format:
Accept: application/json
Bodyβ
- XML
- JSON
<Requests>
<GetSetting>
<Path>Settings/Printing/Label</Path>
</GetSetting>
</Requests>
Or request multiple settings:
<Requests>
<GetSetting>
<Path>Settings/Printing/Label</Path>
</GetSetting>
<GetSetting>
<Path>Settings/Printing/Pdf</Path>
</GetSetting>
</Requests>
{
"Requests":{
"GetSetting":{
"Path":"Settings/Printing/Label"
}
}
}
Or request multiple settings:
{
"Requests":{
"GetSetting":{
"Path":"Settings/Printing/Label"
},
"GetSetting":{
"Path":"Settings/Printing/Pdf"
}
}
}
Response - Particular Settingsβ
The Responses/GetSetting/
node contains both a code
(where code "0" indicates success) and a /Settings
node where the data is present. All settings data begins with /Settings
as internally settings are represented by an XML tree.
- XML
- JSON
<Responses>
<GetSetting code="0">true</GetSetting>
</Responses>
Or request multiple settings:
<Responses>
<GetSetting code="0">true</GetSetting>
<GetSetting code="0">true</GetSetting>
</Responses>
{
"Responses": {
"GetSetting": {
"code": "0"
"value": true
}
}
}
Or request multiple settings:
{
"Responses": {
"GetSetting": [
{
"code": "0",
"value": true
},
{
"code": "0",
"value": false
}
]
}
}
<SetSetting>β
SetSetting
can be used to set specific settings.Specifying a settings path
Settings paths must begin with a /Settings
but do not need to end with a /
, as in /Settings/Scanner/Mode
.
Requestβ
- GET
- POST
Endpointβ
Set the PDF Freight-Report setting to false on machine with local IP address 10.1.1.2
set to port 7100
.
Example: set multiple settings with one command.
Headerβ
- XML
- JSON
Desired response format:
Accept: application/xml
(DEFAULT)Desired response format:
Accept: application/json
Endpointβ
A Cargo Spectre POST request is sent to the machine without any API in the endpoint, as below:
Headerβ
- XML
- JSON
Desired response format:
Accept: application/xml
(DEFAULT)Desired response format:
Accept: application/json
Bodyβ
- XML
- JSON
<Requests>
<SetSetting>
<Path>/Settings/Printing/Pdf</Path>
<Value>false</Value>
</SetSetting>
</Requests>
Setting multiple settings:
<Requests>
<SetSetting>
<Path>/Settings/Printing/Pdf</Path>
<Value>false</Value>
</SetSetting>
<SetSetting>
<Path>/Settings/Licensing/Email</Path>
<Value>other.fake@shipper.com</Value>
</SetSetting>
</Requests>
{
"Requests":{
"SetSetting":{
"Path":"/Settings/Printing/Pdf",
"Value":false
}
}
}
Setting multiple settings:
{
"Requests":{
"SetSetting":{
"Path":"/Settings/Printing/Pdf",
"Value":false
},
"SetSetting":{
"Path":"/Settings/Licensing/Email",
"Value":"other.fake@shipper.com"
}
}
}
Responseβ
This returns a code="0" if the setting was successfully sent.
Settings permissions
As of Spectre version 3.0.154, each setting has permissions attached to it. Only settings with "r" (Read) permissions can be returned by the API, and only settings with "w" (Write) permissions can be edited via API.
- XML
- JSON
Example of response for one setting:
<Responses>
<SetSetting code="0"/>
</Responses>
Example of response for multiple settings:
<Responses>
<SetSetting code="0"/>
<SetSetting code="0"/>
</Responses>
{
"Responses": {
"SetSetting": {
"code": "0"
}
}
}
Example of response for multiple settings:
"Responses": {
"SetSetting": [
{"code": "0"},
{"code": "0"}
]
}
}
<GetSettingInfo>β
The GetSettingInfo
command retrieves many useful attributes about all settings, or one particular one. These attributes include:
- Permissions: The permissions of the setting. Include read, read-write, etc. (specified as r, rw, etc.). Some permissions are private and are not returned by API, such as the password hash.
- Category: A generalized type descriptor for the setting. Includes regex for text, select for multi-options, toggle for a more narrow select with only two options (e.g. true/false), etc.
- Options: Either a regex string or a list of options depending on the category type.
- Ui: A UI hint for the setting. This is how the Spectre GUI will render settings elements in future versions. Examples include toggle, text, integer, select, etc.
note
Only setting attributes are retrieved by the GetSettingInfo command. For the setting value, use GetSetting
.
Request - Info for All Settingsβ
- GET
- POST
Endpointβ
Request info for all settings from a machine with local IP address 10.1.1.2
set to port 7100
.
Headerβ
- XML
- JSON
Desired response format:
Accept: application/xml
(DEFAULT)Desired response format:
Accept: application/json
Endpointβ
A Cargo Spectre POST request is sent to the machine without any API in the endpoint, as below:
Headerβ
- XML
- JSON
Desired response format:
Accept: application/xml
(DEFAULT)Desired response format:
Accept: application/json
Bodyβ
- XML
- JSON
<Requests>
<GetSettingInfo/>
</Requests>
{
"Requests":{
"GetSettingInfo":{}
}
}
Response - Info for All Settingsβ
The Responses/GetSettingInfo/
node contains both a "code" (where code 0 indicates success) and a /Settings
node where the data is present. All settings data begins with /Settings
as internally settings are represented by an XML tree.
Settings permissions
As of Spectre version 3.0.154, each setting has permissions attached to it. Only settings with "r" (Read) permissions can be returned by the API, and only settings with "w" (Write) permissions can be edited via API.
- XML
- JSON
This is a particularly large response
<Responses>
<GetSettingInfo code="0">
<Settings>
<Device>
<Version>
<Permission>r</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>.*</Option>
</Version>
<Name>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>.*</Option>
</Name>
<Scale>
<Format>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>Totalcomp Continuous Format</Option>
<Option>FB1100 Continuous Format</Option>
<Option>Rice Lake Continuous Format</Option>
<Option>CI200 Continuous Format</Option>
<Option>Optima OP-900 Continuous Format</Option>
<Option>Mettler Toledo Continuous Format</Option>
<Option>Slimeline Polling Format</Option>
</Format>
<Baud>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>9600</Option>
<Option>14400</Option>
<Option>19200</Option>
<Option>28800</Option>
<Option>38400</Option>
<Option>56000</Option>
<Option>57600</Option>
<Option>115200</Option>
</Baud>
<Parity>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>7 data bits, even parity bit, 1 stop bit</Option>
<Option>7 data bits, even parity bit, 2 stop bits</Option>
<Option>7 data bits, odd parity bit, 1 stop bit</Option>
<Option>7 data bits, odd parity bit, 2 stop bits</Option>
<Option>8 data bits, no parity bit, 1 stop bit</Option>
</Parity>
<Ntep>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>.*</Option>
</Ntep>
</Scale>
</Device>
<Scanner>
<Mode>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>Cargo</Option>
<Option>Black Plastic</Option>
<Option>Parcel</Option>
</Mode>
<Upload>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>Never</Option>
<Option>When saving</Option>
</Upload>
<AutoBarcodeEnabled>
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</AutoBarcodeEnabled>
<AutoBarcodeDelay>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>[0-9]+</Option>
</AutoBarcodeDelay>
<AutoSaveEnabled>
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</AutoSaveEnabled>
<AutoExportEnabled>
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</AutoExportEnabled>
</Scanner>
<Calibration>
<Path>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>.*</Option>
</Path>
<Crash>
<Permission>r</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</Crash>
</Calibration>
<Units>
<Length>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>centimeters</Option>
<Option>feet</Option>
<Option>inches</Option>
<Option>meters</Option>
<Option>millimeters</Option>
</Length>
<Volume>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>cubic centimeters</Option>
<Option>cubic feet</Option>
<Option>cubic inches</Option>
<Option>cubic meters</Option>
<Option>cubic millimeters</Option>
</Volume>
<Weight>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>g</Option>
<Option>grains</Option>
<Option>grams</Option>
<Option>kg</Option>
<Option>kilograms</Option>
<Option>lb</Option>
<Option>ounces</Option>
<Option>pounds</Option>
<Option>tons</Option>
</Weight>
</Units>
<Licensing>
<Email>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>.*</Option>
</Email>
</Licensing>
<Snapshot>
<Save>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>.*</Option>
</Save>
<Images>
<Format>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>JPG</Option>
<Option>PNG</Option>
</Format>
</Images>
<Clouds>
<Format>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>PCD</Option>
<Option>PLY</Option>
<Option>NONE</Option>
</Format>
</Clouds>
</Snapshot>
<Printing>
<Logo>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>.*</Option>
</Logo>
<LogoPlacement>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>Left</Option>
<Option>Center</Option>
<Option>Right</Option>
</LogoPlacement>
<Pdf>
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</Pdf>
<BoxIncluded>
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</BoxIncluded>
<Label>
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</Label>
<LabelPrinterName>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>.*</Option>
</LabelPrinterName>
<BarSymbology>
<Permission>rw</Permission>
<Ui>select</Ui>
<Category>select</Category>
<Option>Code 128</Option>
<Option>Code 93</Option>
<Option>UPC-A</Option>
<Option>Do not print barcode</Option>
</BarSymbology>
<ReportPrinterName>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>.*</Option>
</ReportPrinterName>
<DimBarcodes>
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</DimBarcodes>
<SimplifiedLabel>
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</SimplifiedLabel>
<ReportQuantity>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>[0-9]+</Option>
</ReportQuantity>
<LabelQuantity>
<Permission>rw</Permission>
<Ui>ticker</Ui>
<Category>regex</Category>
<Option>[0-9]+</Option>
</LabelQuantity>
</Printing>
<Network>
<Proxy>
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</Proxy>
</Network>
<RemoteApi>
<Port>
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>[0-9]+</Option>
</Port>
</RemoteApi>
<Support>
<Sample>
<Reporting>
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</Reporting>
</Sample>
<LoginPrompt>
<Permission>r</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</LoginPrompt>
</Support>
</Settings>
</GetSettingInfo>
</Responses>
This is a particularly large response
{
"Responses": {
"GetSettingInfo": {
"code": "0",
"Settings": {
"Device": {
"Version": {
"Permission": "r",
"Ui": "text",
"Category": "regex",
"Option": ".*"
},
"Name": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": ".*"
},
"Scale": {
"Format": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"Totalcomp Continuous Format",
"FB1100 Continuous Format",
"Rice Lake Continuous Format",
"CI200 Continuous Format",
"Optima OP-900 Continuous Format",
"Mettler Toledo Continuous Format",
"Slimeline Polling Format"
]
},
"Baud": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
9600,
14400,
19200,
28800,
38400,
56000,
57600,
115200
]
},
"Parity": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"7 data bits, even parity bit, 1 stop bit",
"7 data bits, even parity bit, 2 stop bits",
"7 data bits, odd parity bit, 1 stop bit",
"7 data bits, odd parity bit, 2 stop bits",
"8 data bits, no parity bit, 1 stop bit"
]
},
"Ntep": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": ".*"
}
}
},
"Scanner": {
"Mode": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"Cargo",
"Black Plastic",
"Parcel"
]
},
"Upload": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"Never",
"When saving"
]
},
"AutoBarcodeEnabled": {
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
},
"AutoBarcodeDelay": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": "[0-9]+"
},
"AutoSaveEnabled": {
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
},
"AutoExportEnabled": {
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
}
},
"Calibration": {
"Path": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": ".*"
},
"Crash": {
"Permission": "r",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
}
},
"Units": {
"Length": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"centimeters",
"feet",
"inches",
"meters",
"millimeters"
]
},
"Volume": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"cubic centimeters",
"cubic feet",
"cubic inches",
"cubic meters",
"cubic millimeters"
]
},
"Weight": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"g",
"grains",
"grams",
"kg",
"kilograms",
"lb",
"ounces",
"pounds",
"tons"
]
}
},
"Licensing": {
"Email": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": ".*"
}
},
"Snapshot": {
"Save": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": ".*"
},
"Images": {
"Format": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"JPG",
"PNG"
]
}
},
"Clouds": {
"Format": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"PCD",
"PLY",
"NONE"
]
}
}
},
"Printing": {
"Logo": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": ".*"
},
"LogoPlacement": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"Left",
"Center",
"Right"
]
},
"Pdf": {
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
},
"BoxIncluded": {
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
},
"Label": {
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
},
"LabelPrinterName": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": ".*"
},
"BarSymbology": {
"Permission": "rw",
"Ui": "select",
"Category": "select",
"Option": [
"Code 128",
"Code 93",
"UPC-A",
"Do not print barcode"
]
},
"ReportPrinterName": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": ".*"
},
"DimBarcodes": {
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
},
"SimplifiedLabel": {
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
},
"ReportQuantity": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": "[0-9]+"
},
"LabelQuantity": {
"Permission": "rw",
"Ui": "ticker",
"Category": "regex",
"Option": "[0-9]+"
}
},
"Network": {
"Proxy": {
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
}
},
"RemoteApi": {
"Port": {
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": "[0-9]+"
}
},
"Support": {
"Sample": {
"Reporting": {
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
}
},
"LoginPrompt": {
"Permission": "r",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
}
}
}
}
}
}
Request - Info for Specific Settingβ
The GetSettingInfo
command retrieves many useful attributes about all settings, or one particular one. These attributes include:
- Permissions: The permissions of the setting. Include read, read-write, write-encrypted, etc. (specified as r, rw, we, etc.). Some permissions are private and are not returned by API, such as the password hash.
- Category: A generalized type descriptor for the setting. Includes regex for text, select for multi-options, toggle for a more narrow select with only two options (e.g. true/false), etc.
- Options: Either a regex string or a list of options depending on the category type.
- Ui: A UI hint for the setting. This is how the Spectre GUI will render settings elements in future versions. Examples include toggle, text, integer, select, etc.
To get the attributes for a particular setting, you must specify a Path
optional parameter.
info
As mentioned above, performing a read operation on a setting not set for read permissions is not possible. Such settings are for internal use by the application and are not accessible via API. In such cases, the API will return:
- XML
- JSON
<Responses>
<GetSettingInfo code="0"/>
</Responses>
{
"Responses": {
"GetSettingInfo": {
"code": "0"
}
}
}
- GET
- POST
Endpointβ
Get the attributes for the PDF Freight-Report setting on machine with local IP address 10.1.1.2
set to port 7100
.
Example: get multiple setting attributes with one command.
Headerβ
- XML
- JSON
Desired response format:
Accept: application/xml
(DEFAULT)Desired response format:
Accept: application/json
Endpointβ
A Cargo Spectre POST request is sent to the machine without any API in the endpoint, as below:
Headerβ
- XML
- JSON
Desired response format:
Accept: application/xml
(DEFAULT)Desired response format:
Accept: application/json
Bodyβ
- XML
- JSON
<Requests>
<GetSettingInfo>
<Path>/Settings/Printing/Pdf</Path>
</GetSettingInfo>
</Requests>
Getting multiple setting attributes:
<Requests>
<GetSettingInfo>
<Path>/Settings/Printing/Pdf</Path>
</GetSettingInfo>
<GetSettingInfo>
<Path>/Settings/Licensing/Email</Path>
</GetSettingInfo>
</Requests>
{
"Requests":{
"GetSettingInfo":{
"Path":"/Settings/Printing/Pdf"
}
}
}
Getting multiple setting attributes:
{
"Requests":{
"GetSettingInfo":{
"Path":"/Settings/Printing/Pdf"
},
"GetSettingInfo":{
"Path":"/Settings/Licensing/Email"
}
}
}
Response - Info for Specific Settingβ
The Responses/GetSettingInfo/
node contains both a "code" (where code 0 indicates success) and a /Settings
node where the data is present. All settings data begins with /Settings
as internally settings are represented by an XML tree.
Settings permissions
As of Spectre version 3.0.154, each setting has permissions attached to it. Only settings with "r" (Read) permissions can be returned by the API, and only settings with "w" (Write) permissions can be edited via API.
- XML
- JSON
Example of response for one setting:
<Responses>
<GetSettingInfo code="0">
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</GetSettingInfo>
</Responses>
Example of response for multiple settings:
<Responses>
<GetSettingInfo code="0">
<Permission>rw</Permission>
<Ui>toggle</Ui>
<Category>toggle</Category>
<Option>false</Option>
<Option>true</Option>
</GetSettingInfo>
<GetSettingInfo code="0">
<Permission>rw</Permission>
<Ui>text</Ui>
<Category>regex</Category>
<Option>.*</Option>
</GetSettingInfo>
</Responses>
{
"Responses": {
"GetSettingInfo": {
"code": "0",
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
}
}
}
Example of response for multiple settings:
{
"Responses": {
"GetSettingInfo": [
{
"code": "0",
"Permission": "rw",
"Ui": "toggle",
"Category": "toggle",
"Option": [
false,
true
]
},
{
"code": "0",
"Permission": "rw",
"Ui": "text",
"Category": "regex",
"Option": ".*"
}
]
}
}
List of All Settingsβ
List is not regularly maintained
This list is not regularly maintained and may change depending on your version of the Cargo Spectre GUI. To check what settings are available to you, request GetSettings
from your machine.
Cargo Spectre reserves the right to append additional nodes to the paths. Cargo Spectre will not remove or rearrange paths (e.g. /Settings/Device/Name will not disappear, nor will it become /Settings/Info/Name) but some paths may be 'tacked on' (e.g. /Settings/Device/NewNode)
danger
Cargo Spectre highly recommends parsing the full XML or JSON tree instead of looking for a setting at a specific line number or by a specific keyword. Cargo Spectre promises that paths will be unique, but specific node names may not. E.g. 'Name' might be repeated, but /Settings/Device/Name will not.
Furthermore, if an additional node is added further up in the tree, searching for a desired setting on line number 40 will break. Always traverse the tree with an XML or JSON parser instead.
PATHS (CASE SENSITIVE) | ACCEPTED VALUES | (CASE SENSITIVE) |
---|---|---|
/Settings/Device/Name | any string | Human-readable name for a particular machine |
/Settings/Device/Scale/Format | Totalcomp Continuous Format; FB1100 Continuous Format ; Rice Lake Continuous Format ; CI200 Continuous Format ; Optima OP-900 Continuous Format ; Mettler Toledo Continous Format ; Slimline Polling Format | Scale data format |
/Settings/Device/Scale/Baud | 9600 ; 14400 ; 19200 ; 28800 ; 38400 ; 56000 ; 57600 ; 115200 | Baud rate for an attached scale |
/Settings/Device/Scale/Parity | 8 data bits, no parity bit, 1 stop bit ; 7 data bits, even parity bit, 1 stop bit ; 7 data bits, odd parity bit, 1 stop bit ; 7 data bits, even parity bit, 2 stop bits ; 7 data bits, odd parity bit, 2 stop bits | Communication information for an attached scale |
/Settings/Device/Scale/Ntep | any string | The NTEP certification number for the attached scale |
/Settings/Printing/Pdf | true ; false | Generates a freight report PDF when enabled |
/Settings/Printing/Label | true ; false | Generates a freight label PDF when enabled |
/Settings/Printing/Logo | a string that is a valid file path to an image | A file path for a company logo to be displayed on freight reports |
/Settings/RemoteApi/Port | any integer in range 1024-49151 | Port number |
/Settings/Scanner/Mode | Cargo ; Parcel | Scanning mode. Select βcargoβ for two camera operation, and βparcelβ for one camera. |
/Settings/Scanner/Upload | Never ; When saving | Uploads scans to cloud storage |
/Settings/Snapshot/Images/Format | jpg ; png | The file format to save images in |
/Settings/Units/Length | millimeters ; centimeters ; meters ; inches ; feet | Length measurement unit for dimensions |
/Settings/Units/Volume | cubic millimeters ; cubic centimeters ; cubic meters ; cubic inches ; cubic feet | Volume measurement unit |
/Settings/Units/Weight | g ; grams ; grains ; kg ; kilograms ; lb ; pounds ; ounces ; tons | Weight measurement unit |