The AppCloud APIs are used by mobile applications to communicate with the Cognitive Systems Infrastructure.
Cognitive Systems App Cloud API
Download OpenAPI description
Languages
Servers
Mock server
https://docs.cognitivesystems.com/_mock/assets/specs/api/app_cloud/
https://docs.cognitivesystems.com/api/v1/
- Mock server
https://docs.cognitivesystems.com/_mock/assets/specs/api/app_cloud/sleep_times/settings
https://docs.cognitivesystems.com/api/v1/sleep_times/settings
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.cognitivesystems.com/_mock/assets/specs/api/app_cloud/sleep_times/settings \
-H 'Authorization: YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"enabled": false,
"sleep_hour": 23,
"sleep_minute": 0,
"wake_hour": 9,
"wake_minute": 15
}'
Response
application/json
{ "enabled": false, "sleep_hour": 23, "sleep_minute": 0, "wake_hour": 9, "wake_minute": 15 }
- Mock server
https://docs.cognitivesystems.com/_mock/assets/specs/api/app_cloud/sleep_times/data/{queried_days}
https://docs.cognitivesystems.com/api/v1/sleep_times/data/{queried_days}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.cognitivesystems.com/_mock/assets/specs/api/app_cloud/sleep_times/data/{queried_days}?force_past=false' \
-H 'Authorization: YOUR_API_KEY_HERE'
Bodyapplication/json
the unarmed
/home
/0
or armed
/away
/ 1
history of the network
Example: {"data":[0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"from_ts":1618243200,"bucket":3600}
the array of days queried, length of array will match queried number of days
Example: [{"house_day":18729,"sleep_ts":1618266600,"sleep_weight":0.923879533,"wake_ts":1618286400,"wake_weight":0.965925826},{"house_day":18730,"sleep_ts":1618353900,"sleep_weight":0.896872742,"wake_ts":1618372800,"wake_weight":0.965925826},{"house_day":18731,"sleep_ts":1618440300,"sleep_weight":0.896872742,"wake_ts":1618476300,"wake_weight":0.555570233},{"house_day":18732,"sleep_ts":1618517700,"sleep_weight":0.98078528,"wake_ts":1618545600,"wake_weight":0.965925826},{"house_day":18734,"sleep_ts":1618687800,"sleep_weight":0.923879533,"wake_ts":1618711200,"wake_weight":0.707106781},{"house_day":18735,"sleep_ts":1618766100,"sleep_weight":0.555570233,"wake_ts":1618807500,"wake_weight":0.997858923}]
Response
application/json
{ "avg_sleep_time_s": 82380, "avg_wake_time_s": 23280, "duration_avg_s": 27900, "queried_days": 6, "motion_state": { "data": [ … ], "from_ts": 1618243200, "bucket": 3600 }, "data": [ { … }, { … }, { … }, { … }, { … }, { … } ] }
- Mock server
https://docs.cognitivesystems.com/_mock/assets/specs/api/app_cloud/insights/v2/activity
https://docs.cognitivesystems.com/api/v1/insights/v2/activity
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.cognitivesystems.com/_mock/assets/specs/api/app_cloud/insights/v2/activity?start_time=0&end_time=0&flattened=false'
Response
application/json
{ "first_bucket": 1743521400, "interval": 900, "data": [ 0, 0.559, 0.36765, 0.44425, null ] }