kakopappa / sinric

Amazon Alexa Smart home skill / Google Home Action for ESP8266 / ESP32 / Arduino
https://sinric.com
285 stars 166 forks source link

API documentation #363

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi, I try to use the api documentation for update the device but I didn't do it, you could make an example of the url and the body that i must use for do it? thanks so mutch for your time, Andrea

kakopappa commented 4 years ago

`var request = require("request");

var options = { method: 'POST', url: 'https://sinric.com/api/v1/updateDeviceSettings', headers: { 'Postman-Token': 'a0fe8ac2-6c28-42ab-97d6-8e296d12f764', 'cache-control': 'no-cache', 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' }, formData: { action: 'setPowerState', value: 'OFF', deviceId: 'xxxxx', apikey: 'xxxxxx' } };

request(options, function (error, response, body) { if (error) throw new Error(error);

console.log(body); }); `