question

Fideri avatar image
Fideri asked

How do I get my user ID from Node Red?

Hi Everyone

I can easily log into VRM and create users, bearer tokens and use Node Red without being on site. But how do I get my user ID from within Node Red?

I'm trying to get some data from the VRM API using the "http" node but it fails to authenticate probably because the user ID is wrong.

Fideri

Node-RED
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Fideri avatar image Fideri commented ·
I have since tried the URL https://vrmapi.victronenergy.com/v2/auth/login using the POST command of Postman with my VRM username and password get my user ID but I get the same "invalid credentials" error. The demo link works as expected.
0 Likes 0 ·
2 Answers
Dirk-Jan Faber (Victron Energy) avatar image
Dirk-Jan Faber (Victron Energy) answered ·

Using the https://flows.nodered.org/node/victron-vrm-api node, you can query basic user info for your site. It will return a payload containing user id, name, mail address and such (https://vrm-api-docs.victronenergy.com/#/operations/users/me)
1719611258566.png1719611180507.png


1719611180507.png (75.4 KiB)
1719611258566.png (26.9 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Fideri avatar image
Fideri answered ·

@Dirk-Jan Faber (Victron Energy)

Brilliant. That worked perfectly. I now have my user ID.

F.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.