We have checked 1-3… all fine. Changing device name and update device env vars work fine using the other API endpoints… from the error message it seems to be a CORS issue:
This is our javascript GET function (used for other API GET calls that are fine)
Hey Anton,
it may just be a typing mistake, but you mentioned that the device id is 2077257 and that the URL that you are calling is https://api.balena-cloud.com/v5/device_service_environment_variable?$filter=service_install/device%20eq%2077257 be aware of the URL encoding for the empty space. At the end of the URL it should be device%20eq%202077257 missing a 20.
This would be the correct URL, also using v6 as Steve recommended: https://api.balena-cloud.com/v6/device_service_environment_variable?$filter=service_install/device%20eq%202077257
If this still doesn’t work, make sure that the following API call works: https://api.balena-cloud.com/v6/device(2077257)
that should return the devices Info, if it is empty, then just call https://api.balena-cloud.com/v6/device to make sure that your device is there
We resovled this issue. It was a problem to create a device service variable (override of application service variable). If there are none for the device already, we had to use the Service install API to get the service_install_id. If there is at least one device service variable existing, we used to get the service_install_id via the Device Service Variable API. We changed to use Service install API irrespective.