Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

4. Get/set property value using REST API


  1. Check out the GadgetkeeperAPI GadgetKeeper API - Thing Properties page for details on how to perform basic method operations on GadgetKeeper API using cURL or a REST API tool
  2. Obtain required parameters:
    1. obtain the Thing Id, see instructions here.
    2. obtain the property Id, such as "temperature", see instructions here
    3. create an API Key, see instructions here
  3. Use API Explorer to perform REST calls using UI
  4. Use cURL to perform REST calls using command lines:

To get property value: 

 

Code Block
language bash
curl -i -X GET -H "X-ApiKey: <API_KEY>" "http://api.gadgetkeeper.com/v1/things/<THING_ID>/properties/<PROPERTY_ID>/value.json"

To set property value: 

Code Block
language bash
curl -i -X PUT -H "X-ApiKey: <API_KEY>" -H "Content-Type: text/json; charset=UTF-8" -d "<NEW_TEMPERATURE_VALUE>" "http://api.gadgetkeeper.com/v1/things/<THING_ID>/properties/<PROPERTY_ID>/value.json"