Activate a Device

Device Activation is the process by which a Device is provisioned with a Feed ID and API Key upon initial wakeup.

The steps below outline how to configure your devices to Activate.

  1. Devices are individual instances of a particular Product. Before a Device activates, it must be pre-registered with Xively under its parent Product, so that the API knows to expect an activation call from that particular device when it wakes up for the first time. Pre-registering a Device is accomplished by uploading the Device’s Serial Number - either from the Management Console of its parent Product, or via the API.

  2. Once pre-registered, a Device can Activate by sending an Activation Code to the Xively API. This signals to Xively that the Device has woken up for the first time, and is requesting to be provisioned with a Feed ID and API Key that it can use. A Device’s Activation Code is generated using an HMAC-SHA1 hash that combines the Device’s Serial Number with its parent Product’s Product Secret to makes it effectively impossible for someone to extract the Product Secret from the activation code, or to fraudulently impersonate a Device in the provisioning process.

  3. Upon successful activation, Xively automatically creates a Feed for the activated Device that is based on the Feed template of its parent Product family. The Feed ID of that new Feed, and an API key which allows full access permission to that Feed, are returned in the API call response. Once this process takes place, the Feed ID and API Key can also be retrieved independently with the use of a Master API Key and the Device’s Serial Number (see keys).

Notes

  • Device activation is most often called directly by the activating device, but as outlined in the provisioning overview, it can also be called by applications or services on behalf of an object.

  • After the first Activation of a device, all future Activation calls must send the API Key originally issued with the Feed ID, or a Master API Key in order to prove identity. This prevents fraudulent duplicate activations.

  • To learn more about pre-registering Devices, and Device Serial Numbers, see Create a Device

Request

Parameters
Method GET
Base URL https://api.xively.com
API Endpoint /v2/devices/ACTIVATION_CODE/activate
Headers
X-ApiKey API_KEY_HERE
Body
JSON
XML
CSV
  • GET/v2/devices/ACTIVATION_CODE/activate

    This request does not require body data.
    
    If the device has already been activated once, making this call again 
    will return "This device has already been activated" unless the 
    API Key for the Feed is included with the request.
    
  • XML format not available for this call
    
  • GET/v2/devices/ACTIVATION_CODE/activate

    This request does not require body data.
    
    If the device has already been activated once, making this call again 
    will return "This device has already been activated" unless the 
    API Key for the Feed is included with the request.
    

Response

Parameters
Status Code 200 OK
Headers
Location https://api.xively.com/v2/products/h5wT2IlOMrd09r_qd1jm/devices
Body
JSON
XML
CSV
  • {
        "apikey": "API_KEY_HERE",
        "feed_id": FEED_ID_HERE,
        "datastreams": [
            "temperature"
        ]
    }
    
  • XML format not available for this call
    
  • API_KEY_HERE,FEED_ID_HERE,NUMBER_OF_CHANNELS_HERE,CHANNEL_NAME_HERE