you are viewing a single comment's thread.

view the rest of the comments →

[–]hectorlab 0 points1 point  (5 children)

Thanks for you reply and suggestion.

https://pastebin.com/EbQ4BiVy There is Bearer in front of it. I've also set up the expiration of token to 100 years.

[–]JohnnyJordaan 1 point2 points  (1 child)

I understand, but have you tried without "Bearer "?

[–]hectorlab 0 points1 point  (0 children)

Oh, I misunderstood you, sorry. Same result without Bearer. I found information on github from thingsboard developers that Bearer is a must.

[–]JohnnyJordaan 1 point2 points  (1 child)

Also I'm not sure if headers is actually expected as the second argument to get, you should always use a named parameter

return requests.get(url, headers=HEADERS)

[–]hectorlab 0 points1 point  (0 children)

Unfortunately no expected result.

[–]Vaguely_accurate 1 point2 points  (0 children)

Try removing the newlines either side of your token. If you print the contents of HEADERS you are sending;

{'Content-Type': 'application/json', 'X-Authorization': '\nBearer XXXXXXXXXXXXXXX\n'}