Searching:
0 results foundDevices/GenerateSASToken
POST /odata/Devices/deviceId/GenerateSASToken
Description
This request returns a Shared Access Signature (SAS) token that can be used by a Device to send events to the Axonize IoT hub.
A Device can use HTTPS to send an event to Axonize using a Shared Access Signature (SAS) token placed in the request header sent to the Axonize IoT hub.
The number of validity days (daysTTL) for the SAS token can be defined (the default is 45 days).
See the following for request and response details ‒
See Also
Request ‒ Devices/GenerateSASToken
Property | Type | Description | Mandatory |
key | String | The device ID. | |
parameters | JSON | daysTTL – The number days that the token is valid – maximum 365 days. The default is 45 days. |
Example JSON Devices/GenerateSASToken
curl -X POST \
https://api.stg.axonize.com/odata/devices/58564b324e41995b98212345/GenerateSASToken \
-H ‘Cache-Control: no-cache’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Token’ \
-H ‘appId: be517433-c4b8-4788-9258-1ba220123456’ \
-d ‘{
“daysTTL”: 45
}’
Response ‒ Devices/GenerateSASToken
Property | Type | Description |
value | String | The token to be used by a Device in order to communicate with the Axonize IoT hub. |
Example JSON Devices/GenerateSASToken
{“@odata.context”:”https://dev-axonizeapi-axonize.dev-ase-axonize.p.azurewebsites.net/odata/$metadata#Edm.String“,”value”:”SharedAccessSignature sr=dev-iot-axonize.azure-devices.net%2Fdevices%2F59b8d332ce800fc240a54e2d&sig=aMOiZm7P2JABteKGXc9DV5I4yufdd5rvj%2BgGsUgHFRU%3D&se=1537691429″}