Hello,
I’m trying to set environment variable using your API and axios.
Unfortunately, the code above isn’t working, just returning an array of all the variables already set manually.
I am doing something wrong ?
Hi there, looking at your code I can see that the request you are making is an http request which should instead use https.
Also I can see that the first argument of your setEnvVar is of type string which is not correct, for this request you need to pass the device id which is of type number.
I just tried it using the browser console and like this it works fine:
BEARER_TOKEN = can get it by running await sdk.auth.getToken() from your browser console and copy the result.
DEVICE_ID = this is not the UUID, to get the id you can run await sdk.models.device.get(<DEVICE_UUID>)
DEVICE_UUID = from the dashboard, enter into a device summary and you can copy it from the summary card or from the url.
device summry page = login into you dashboard, click on the application, click on the device