sinricpro / non-sdk-issues

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

My API request not works #37

Closed Bitcraze26 closed 2 years ago

Bitcraze26 commented 2 years ago

Hello everyone! I made a simple API request for a contact sensor:

https://api.sinric.pro/api/v1/devices/61d7718a1d53xxxxxxxx/action?clientId=nodejs-app&type=request&createdAt=1641573257&action=setContactState&value={"state": "open"}

Request status "200 OK" Body response:

{ "success": true, "message": "OK. Il tuo messaggio è stato messo in coda per l'elaborazione." }

But In alexa i can't get update for this sensor. I had just one shoot for the first time about 1 hour ago and after no more updates of the states while the requests are sended succesfully.

What can be the problem? Thanks!

kakopappa commented 2 years ago

Try with this clientId=portal

https://api.sinric.pro/api/v1/devices/61d7718a1d53xxxxxxxx/action?clientId=**portal**&type=request&createdAt=1641573257&action=setContactState&value={"state": "open"}

Bitcraze26 commented 2 years ago

No, it doesn't work! On my dashboard in portal it works like a charm, but not with API

kakopappa commented 2 years ago

Hi,

Can you please check these two things?

  1. Set the clientId=portal in the login request.
  2. Set the clientId=portal in the /action API call.
Bitcraze26 commented 2 years ago

Hi,

Can you please check these two things?

  1. Set the clientId=portal in the login request.
  2. Set the clientId=portal in the /action API call.

I've created new login with clientId = portal, clientId=portal in /action API call but nothing changed. Same with PostMan

Same success = true for every request but no updates on alexa

Bitcraze26 commented 2 years ago

I've resolved. For contact sensor the type on request bust be 'event':

type=event

https://api.sinric.pro/api/v1/devices/61d771xxxxxxxx/action?clientId=portal&type=**event**&createdAt={{$timestamp}}&action=setContactState&value={"state": "open"}

Thanks!!