Fetch both the application environment variables and device environment variables in the same api call


Looking at the documentation, we could not find any api calls that has both the app level and device level environment variables in the same response. Looking further in the requests, we found an api call, that fetches both
curl "https://api.resin.io/environment?appId=<appId>&deviceId=<deviceId>" -H "Content-Type: application/json" -H "Authorization: Bearer <api-key>"

Again, this isn’t also present in the node resin-sdk documentation. We are building a node app and it’d really help if we have a same api call to fetch both variables like the above curl request. Please let us know on the node api for the same or if there are any alternatives, we could also use that.


Good point! It would be really nice and handy to have a flag (I named it applicationVariables) in resin.models.environmentVariables.device.getAll(deviceUuid, applicationVariables) which tells the API to include or not the application’s variables :slight_smile:


Thanks for the feedback! :tada: We’ve taken a note and think it over what’s the best approach to cover this.


Thanks for the feedback! This is a great idea, I’ve filed an issue on the SDK to take a look at it: https://github.com/resin-io/resin-sdk/issues/322. You can subscribe to the issue directly there if you’d like updates.


Thanks very much for being responsive! Keeping an eye on the issue