0
votes

Please be kind and tell me how to execute the following CURL command with REST API Call node from Thingsboard 2.5.2:

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"username":"[email protected]", "password":"mypassword"}' 'http://127.0.0.1:8080/api/auth/login'

How can I send the -d '{"username":"[email protected]", "password":"mypassword"}' to the REST API CALL node ?

Thank You !

1
What do you mean? Install curl, open a terminal, paste the command and press return? - lupz

1 Answers

0
votes

As described on the documentation page, the first step is indeed to POST on /api/auth/login providing a username and password in order to retrieve a JWT token. This is the first step you described in your curl call.

Then, for further calls to other API endpoints, you must send a X-Authorization HTTP header with the Bearer: $TOKEN as a value.

Note that if you want to interact with the Thingsboard administration API with Java or Python, clients are available to abstract this.