Token Entity (v3)
This object is used to register the device with a BSN.cloud network and contains the following required properties:
token
string required: A device-registration token returned by the server. This token allows devices to provision themselves for a BSN.cloud network. Note that this is not a user token.
validFrom
dates required: The start of the validity date for the token. The date/time is formatted as yyyy-mm-ddThh:mm:ss.sssZ
.
validTo
dates required: The end of the validity date for the token. The date/time is formatted as yyyy-mm-ddThh:mm:ss.sssZ
.
This optional property can also be used:
scope
string optional: The scope of the device registration token. The default is "cert".
Sample Request
To get the device registration token:
curl --location
--request POST 'https://api.bsn.cloud/2020/10/REST/provisioning/setups/tokens/' \
--header 'Accept: application/json' \
--header 'Accept-Encoding: gzip,deflate' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer 5BfFL3npQscN4RQUeO3V1EI8QKQzToBoVFkLAGg3qmcvsDSgFIt1OIc2P' \
--data-urlencode 'grant_type=user_access_token' \
--data-urlencode 'user_access_token=<redacted>' \
--data-urlencode 'client_id=<redacted>' \
--data-urlencode 'client_secret=<redacted>'
See this page for information about how to get a user access token.