Activate Devices Connected to Gateway
/iot/api/v2/activation/indirect/device
Request
- application/json
-
createDraft(optional): string
Entity description is undefined
object
-
activationTime:
integer
Time when the activation occurred
-
endpointId:
string
Endpoint identifier of the device that was activated
-
endpointState:
string
Lifecycle state of the endpoint after activation
Response
- application/json
- application/vnd.oracle.resource+json;type=singular
200 Response
object
-
activationTime:
integer
Time when the activation occurred
-
endpointId:
string
Endpoint identifier of the device that was activated
-
endpointState:
string
Lifecycle state of the endpoint after activation
400 Response
403 Response
406 Response
415 Response
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://
and the default port is myinstance-myidentitydomain.iot.us.oraclecloud.com
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"
}