Home/Support / Knowledge Base / HOW TO: Device Cloud: Query Settings From a Device Using /ws/sci

HOW TO: Device Cloud: Query Settings From a Device Using /ws/sci

HOW TO:  Query Settings From a Device Using /ws/sci


First: the way to interact with the device’s settings and state information is through RCI (Remote Command Interface). That is a device-level interface that is accessible via the Device Cloud SCI (Server Command Interface)–/ws/sci. To interact with devices via SCI, most actions will be a HTTP POST web service request. All of these examples are available in the Device Cloud API Explorer found under the Documentation section of the UI:

User-added image
 

Query All Settings

  1. Go to API Explorer and select SCI > RCI > Query device settings (as shown above)

  2. That creates an HTTP POST request example to the /ws/sci interface with the following XML as the content of the POST:

/ws/sci POST for RCI Query Setting Request
<sci_request version="1.0">
  <send_message cache="false">
    <targets>
      <device id="00000000-00000000-00000000-00000000"/>
    </targets>
    <rci_request version="1.1">
      <query_setting/>
    </rci_request>
  </send_message>
</sci_request>
Replace the device ID with the actual device you’re interested in querying. You can also replace that single device reference with a tag name or group name. There’s more information in the programming guide on how to change the targets of an SCI request.  Also note the cache="false" attribute. This tells SCI that you want to force the request to go all the way to the device and not pull data from the cached settings in Device Cloud. 
  1. Click the “Send” button
  2. Look for the web service response to show a result code of 200:
User-added image
  1. Click on that line and you’ll see everything returned from that request.  The following example is from a ConnectPort X2e device:
User-added image
 

Query a Specific Settings Group

To limit the request to a specific settings group, simply specify that group in the <query_setting/> tag. The following example will illustrate limiting the settings to just the <system> group.

  1. You will perform an HTTP POST to SCI as above; but this time, change the request content to include the system tag:

    <sci_request version="1.0">
      <send_message cache="false">
        <targets>
          <device id="00000000-00000000-00409DFF-FF000000"/>
        </targets>
        <rci_request version="1.1">
          <query_setting>
            <system/>
          </query_setting>
        </rci_request>
      </send_message>
    </sci_request>

    (Note the addition of a <system> tag between the opening and closing <query_setting> tags)
     

  2. The response now contains only the <system> settings group
User-added image

 
Last updated: Aug 23, 2017

Filed Under

Digi Remote Manager

Recently Viewed Articles

No recently viewed articles
Contact a Digi expert and get started today! Contact Us