DEVICE subscriptions work, but CAPABILITY doesn't

I can successfully create subscriptions for devices:

	"sourceType": "DEVICE",
	"device": {
		"deviceId": "********-****-****-****-************"

but when trying to create a subscription for a capability

	"sourceType": "CAPABILITY",
	"capability": {
		"locationId": "********-****-****-****-************",
		"capability": "switch"

I get an error 403. (without any content/error description) :slightly_frowning_face:
I double checked the locationId. It’s correct and the same for the app and the devices.

Hello @Bluebrain, I noticed that there are some missing elements in your payload. Did you send it in that way intentionally? Also, you can check this link for more information.

There are no mandatory elements missing.

But thanks anyway for pointing me in the right direction.

The SmartApp also needs to request the r:devices permission during the INITIALIZE phase of the CONFIGURE lifecycle

Permission for all deviceIds was not not enough. After uninstalling the app and reinstalling it with “r:devices:*” permission, it works!

Unfortunately, the API documentation is very incomplete in some places.

You should specify the permissions your app will need during the install process. See Authorization and Permissions for more information.

But the linked page is only about token authorization, not a single word about permissions and its syntax. :thinking:

It also took me several hours to find out how to refresh the installedApp authToken.
You can’t find this anywhere in the API documentation.
To make matters worse, some URLs and processes have changed in the last 1-2 years. A lot of the information you find online is therefore no longer accurate or usable.

Hello @Bluebrain, I’m glad to read that you were able to solve it. Regarding documentation, I will take a look and inform the team in case an update is required. Thank you.