I’ve did further investigation and found out the ROLE_DEVICE_BOOTSTRAP
permission is a special one - you cannot grant it to your Tenant User. Instead you should use a pre-existing device bootstrapping user for this call.
To create Device Credentials programatically below steps are needed:
- Create a device request with your personal/authenticated User. Make sure it has the permission
ROLE_DEVICE_CONTROL_ADMIN
(api link) - Try to request Device Credentials via this endpoint. Important: do not use your credentials, you have to use the bootstrap credentials provided by the platform (see here - but use the proper URL)
- Update the Device Request to “status: ACCEPTED” with your User. (api link)
- Repeat Step 2, this time the response will hold your Device Credentials.
See also the Device Integration using REST section in the docs for more info.