DDorch / Rthingsboard

R package for interacting with the API of ThingsBoard open-source IoT platform.
GNU Affero General Public License v3.0
3 stars 0 forks source link

entityId Client error: (404) Not Found #6

Closed smjacques closed 3 years ago

smjacques commented 3 years ago

I'm facing the same issue Request failed with status Client error: (404) Not Found with my server, using the Rthingsboard 0.2.4.

The tb_api is running ok, but at keys = tb_api$getKeys(entityId = entityId).

Always get 404. I set both entity and dashboard as public, also tested another servers, but still seeing this issue.

Is there some solution to this?

DDorch commented 3 years ago

Hi @smjacques,

Did you properly use the "Copy device Id" button and the "Copy customer ID" for getting these credentials?

The first is obtained from the "Devices" section:

image

And the second from the "Customers" section:

image

DDorch commented 3 years ago

If I try keys = tb_api$getKeys(entityId = entityId) with a wrong entity ID, I get an error 404. It could be your case also...

library(Rthingsboard)
url = "http://scada.g-eau.fr"
publicId = "299cedc0-f3e9-11e8-9dbf-cbc1e37c11e3"
entityId = "very_wrong_id"
logger::log_threshold(logger::DEBUG)
keys = tb_api$getKeys(entityId = entityId)

The answer is:

Error in tb_api$getKeys(entityId = entityId) : 
  Request failed with status Server error: (500) Internal Server Error
smjacques commented 3 years ago

Thank you so much @DDorch My mistake was to create an entity and then use its ID. Actually, I didn't realize that publicId is referring to User, and the entityId is the device ID.

Now it is running like a charm!