Activate Devices Connected to Gateway

post

/iot/api/v2/activation/indirect/device

This API enables a Gateway to activate devices connected to it that cannot connect to the Oracle IoT Cloud Service instance directly themselves and need assistance from the Gateway.

Request

Supported Media Types
Query Parameters
Body ()
Root Schema : ActivationResponse_create
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

Successfully processed.
Body ()
Root Schema : ActivationResponse_receive
Type: object
Show Source

400 Response

Bad Request. The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

403 Response

Forbidden. The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated.

406 Response

Request Not Acceptable. The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.

415 Response

Unsupported Media Type. The request entity has a media type which the server or resource does not support.
Back to Top

Examples

The following example shows how to activate the device with Hardware ID 0d33b5dc-3737-4ff3-abfa-2013005a725b assigned to a Gateway with ID 0-2UFQ by submitting a POST request on the REST resource using cURL.

The authorization token is obtained from calling the Authentication API, where issuer is the Gateway with ID 0-2UFQ and scope is empty.

Note that in the request, http://iotserver will be replaced by the name and port of your assigned IoT Cloud Service instance. The format of the Cloud Service instance is https://myinstance-myidentitydomain.iot.us.oraclecloud.com and the default port is 443. For more information about cURL, see Use cURL.

curl -X POST -H 'Accept:application/json' -H 'Content-Type: application/json'-H 'Authorization: Bearer d0dc909058f7301cc56adfb9d53d5696' 
-H 'X-EndpointId: 0-2UFQ'
-d @activation.json https://iotserver/iot/api/v2/activation/indirect/device

The format of the activation.json file should be as follows:

{
   "deviceModels":[
      "urn:oracle:iot:dcd:capability:diagnostics",
      "urn:oracle:iot:dcd:capability:power_management"
   ],
   "productClass":"BluetoothSensor",
   "manufacturer":"Acme",
   "serialNumber":"AA-1455589040212",
   "hardwareId":"0d33b5dc-3737-4ff3-abfa-2013005a725b",
   "signature":"a6vYQUitoVtmE6dQlQ2BPafYAIBsP26Af+/Wrk5C2Ro/KZ/GXTkNbrgUccSGHK3fBvGbiDY8ePVNrdM2Wy2JhJ3NGKBxXWQOjrBVCGPL1vKnGZUAf2p5xMK1XEqMs9shJmK8wmp6hdW6UKWNdNZRiEcp8V/oHIBS0lKykM9ZTUTnR3r8HuDhriDQp+z6L2yuUdqdpfJRqvJqeuvCGJV0E4PD9BiyMin9pbfTecCfK8r4NN3fEScOBZRNiE9wNZ9DBdWJk4nOwRl0hEQLgHRd2MXw5dIG7M3SSGljyd2uB46u50ViyhZWsjTVax4DnKt+S/oSb35bqE8IxmuSx9XG6g=="
}

Example of Response Header

The following shows an example of the response header when the request is successful.

status: 200 OK 
Content-Type: application/json

Example of Response Body

The following example shows the contents of the response body containing the Endpoint Id (0-2UFQ) for the newly activated device endpoint in JSON format.

{
   "endpointId":"0-2UFQ",
   "activationTime":"2016-07-06T00:32:24Z",
   "endpointState":"ACTIVATED"
}
Back to Top