-
Notifications
You must be signed in to change notification settings - Fork 166
API Documentation
- Login
Request :
curl --request POST \ --url https://sinric.com/api/v1/login \ --header 'cache-control: no-cache' \ --header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \ --form email=<email> \ --form password=<password>
Parameters : < email > = sinric login email < password > = sinric password
Response :
{ "success": true, "message": "OK", "token": "xxxxxxxxx", "refreshToken": "xxxxxxxxx", "account": { "firstname": "Aruna", "lastname": "Tennakoon", "apikey": "xxxxxxxx", "email": "xxxxx@gmail.com", "admin": false } }
- Get all devices
curl --request GET \
--url https://sinric.com/api/v1/devices \
--header 'authorization: Bearer <token>' \
--header 'cache-control: no-cache' \
--header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
Parameters: < token > from login response
Response:
{
"success": true,
"message": "OK",
"devices": [
{ ...}
]
}
- Set device settings
curl --request POST \
--url https://sinric.com/api/v1/updateDeviceSettings \
--header 'cache-control: no-cache' \
--header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
--form action=setPowerState \
--form value=OFF \
--form deviceId=xxx \
--form apikey=xxx
curl --request POST \
--url https://sinric.com/api/v1/updateDeviceSettings \
--header 'cache-control: no-cache' \
--header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
--form action=setBrightness \
--form value=42 \
--form deviceId=xxx \
--form apikey=xxx
curl --request POST \
--url https://sinric.com/api/v1/updateDeviceSettings \
--header 'cache-control: no-cache' \
--header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
--form action=setTemperature \
--form value=24.0 \
--form deviceId=xxx \
--form apikey=xxx \
--form scale=CELSIUS