Linking to resin dashboard device page


#1

We’d like to link devices in our internal dashboard to their corresponding resin.io device summary pages and vice-versa.

On a device, we’re provided with two environment variables (RESIN_DEVICE_UUID and RESIN_APP_ID), but no device id for constructing the url: https://dashboard.resin.io/apps/:APP_ID/devices/:DEVICE_ID/summary.

Is there a way to link to the page using the device’s UUID? Or otherwise, is there a way to obtain the device id within device application code?


#2

Bump


#3

Hey @arwid - sorry we missed this one for so long.

I’ve passed a feature request to our UI team to have a url that redirects to the device page that is built with the uuid only - we’ll see what they say.

There’s also this https://github.com/resin-io/resin-supervisor/issues/276 which I still haven’t had time to implement but want to do soon.

In the meantime, the best thing I can think of is using the API to get the device using the uuid, using resin-sdk or just curl:

root@5d7b19b:/app# curl -s -H "Content-Type: application/json" "https://api.resinstaging.io/v2/device?\$filter=uuid%20eq%20'$RESIN_DEVICE_UUID'&apikey=$RESIN_API_KEY" | jq .d[0].id
75851

Not ideal as it requires connectivity and an extra request, but might get you sorted until we implement the feature I mentioned?


#4

Hey @arwid, we have a fix for the issue, which just got deployed.

The device page url has changed to the following schema /devices/<deviceUuid>.
The old schema urls (/apps/<appId>/devices/<deviceId>/...) will continue to work and redirect to the respective new schema device page url.

Thank you for your report!