sinricpro / non-sdk-issues

Report non sdk related issues here (Alexa, Google Home, SmartThings, IFTTT, API)
2 stars 0 forks source link

Facing problem with http api #9

Closed jigneshk5 closed 3 years ago

jigneshk5 commented 3 years ago

I'm following this api doc: https://apidocs.sinric.pro/#api-Device-get_api_v1_devices__id

But I'm not able to make request correctly to get the device information.

I'm getting this error: { "success": false, "message": "Unauthorized" }

Although I'm making the request in following ways: Api: https://api.sinric.pro/api/v1/devices/5dc1564130xxxxxxxxxxxxxx with header: Authorization: Bearer {APP-KEY} Content-Type: application/x-www-form-urlencoded

Please help me out!

kakopappa commented 3 years ago

Bearer <== This token is returned from login response. This is not app-key

jigneshk5 commented 3 years ago

So, I need to make two http request for getting device info. Is there any way I can get the device state(switch) on startup using Sinric.pro library in Nodemcu.

sivar2311 commented 3 years ago

For this you can use SinricPro.restoreDeviceStates(true);

kakopappa commented 3 years ago

Closing due to inactivity