Hey,
to access the Cloud API you - currently - have to manually create an access token:
https://api.cloud.instar.de/api/v1/token?username=xxxx@email.com&password=xxxxxx
The user name and password are the email address and pass you use to login to your Cloud account.
NOTE: You need to make your email address and password URL-safe before using them in a URL query!
The token - currently - defaults to a 2h expiration time. And the response to the above request looks like this:
{
"status": 0,
"message": "ok",
"data": {
"token": "baa0187e7f92b7216ac5f75e10890fdf1dd74d48",
"token_expiration_time": 1623754949
}
}
Parameter name |
Type |
Description |
status |
Int |
Error code, 0 means no errors happened |
message |
String |
Error message |
token |
String |
API token |
token_expiration_time |
Int |
Token exipiration time, defaults to 2 hours |
After getting the token you can use it to access the list of alarms for your account:
https://api.cloud.instar.de/api/v1/alarm/list?page_no=1&page_size=1&token=xxxxxx
The example above uses two queries page_no
and page_size
to limit the response size - in this case you only get the latest alarm event recorded. You can use the following queries to customize the API request:
Parameter |
Required |
Type |
Description |
token |
Yes |
String |
You can get token by calling api User token |
is_falsealarm |
No |
Int |
Get falsealarm video or not, its value must be one of them: 0/1. 0 means get alarm video, 1 means get falsealarm video. Note: only is_falsealarm equals 0, then the filter person, vehicle, animal and unknown can be set as filter, otherwise the result will be empty |
is_viewed |
No |
Int |
Get viewed video or not, its value must be one of them: 0/1. 0 means unviewed video, 1 means get viewed video |
is_locked |
No |
Int |
Get locked or not, its value must be one of them: 0/1. 0 means unlocked video, 1 means get locked video |
is_starred |
No |
Int |
Get starred video or not, its value must be one of them: 0/1. 0 means unstarred video, 1 means get starred video |
attr_link |
No |
Int |
Combine locked and starred or not, its value must be one of them: 0/1. 0 means the result including locked or starred, 1 means the result including locked and starred |
person |
No |
Int |
Get video with person or not. its value must be 1. this means get video with person. Note: only is_falsealarm equals 0, then you can set this filter, otherwise, the result will be empty |
vehicle |
No |
Int |
Get video with vehicle or not. its value must be 1. this means get video with vehicle. Note: only is_falsealarm equals 0, then you can set this filter, otherwise, the result will be empty |
animal |
No |
Int |
Get video with animal or not. its value must be 1. this means get video with animal. Note: only is_falsealarm equals 0, then you can set this filter, otherwise, the result will be empty |
unknown |
No |
Int |
Get video with unknown or not. its value must be 1. this means get video with unknown. Note: only is_falsealarm equals 0, then you can set this filter, otherwise, the result will be empty |
object_link |
No |
Int |
Combine person, vehicle and animal or not, its value must be one of them: 0/1. 0 means the result including person or vehicle or animal (once they are set as above), 1 means the result including person and vehicle and animal (once they are set as above) |
license |
No |
String |
License number |
date |
No |
String |
The specific date, it will get all alarm of this day, eg: 2020-10-01. Note: if date is used, other date filter like start_date, end_date, start_time and end_time will be ignored |
start_date |
No |
String |
Start date, eg: 2020-10-18 |
end_date |
No |
String |
End date, eg: 2020-11-20 |
start_time |
No |
String |
Start time: 08:00 |
end_time |
No |
String |
End time: 18:00 |
time_interval |
No |
Int |
Use time as a daily period of time, its value must be 0/1. 0 means ger all videos from start time of start date to end time of end date. 1 means only get this alarm videos between start time and end time of every day |
cam_id |
No |
Int |
Camera id |
camset_id |
No |
Int |
Camera set id. Note: if camera set id used, camera id will be ignored. |
page_no |
No |
Int |
Page number |
page_size |
No |
Int |
Page size |
And a typical API response will look like:
{
"status": 0,
"message": "ok",
"data": {
"totalCount": 299,
"totalPages": 299,
"alarmList": [
{
"alarm_id": 1333410,
"start": "2020-11-18 16:36:04",
"cam_id": 482,
"name": "New one",
"object_detection": 0,
"is_viewed": 0,
"is_locked": 0,
"is_starred": 0,
"is_falsealarm": 1,
"object": 3,
"video": "https://api.cloud.instar.de/api/v1/video/alarm
/1333410.mp4",
"video_poster": "https://api.cloud.instar.de/api/v1/poster/
alarm/1333410.jpg"
}
]
}
}
Parameter |
Type |
Description |
status |
Int |
Error code, 0 means no errors happened |
message |
String |
Error message |
totalCount |
Int |
Total count of alarms |
totalPages |
Int |
Total pages of alarms |
alarmList |
String |
It is array, it includes all alarms list info, if there is no any alarms data, it will empty array |
alarm_id |
Int |
Alarm id |
start |
String |
The create time of alarm |
cam_id |
Int |
Camera id |
name |
String |
Camera name |
object_detection |
Int |
If camera activated object detection or not, its value must be one of them: 0/1. 0 means deactivated, 1 means activated |
is_viewed |
Int |
If alarm viewed or not, its value must be one of them: 0/1. 0 means unviewed, 1 means viewed |
is_locked |
Int |
If alarm locked or not, its value must be one of them: 0/1. 0 means unlocked, 1 means locked |
is_starred |
Int |
If alarm starred or not, its value must be one of them: 0/1. 0 means unstarred, 1 means starred |
is_falsealarm |
Int |
If alarm is false alarm or not, its value must be one of them: 0/1. 0 means not false alarm, 1 means false alarm |
object |
Int |
Which object detect in alarm video. its value must be one of them: -2/0/1/2/3/4/5/6/7, -2 means no object detection for alarm video, 0 means unknown, 1 means person, 2 means vehicle, 3 means person & vehicle, 4 means animal, 5 means person & animal, 6 means vehicle & animal, 7 means person, vehicle & animal. Note: only is_falsealarm equals 0, then object is valid. |
video |
String |
Video link, need to added token after video link to access video. Like: https://api.cloud.instar.de/api/v1/video/alarm/1333410.mp4?token=xxxxx |
video_poster |
String |
Video poster link, need to added token after video poster link to access the poster. Like: https://api.cloud.instar.de/api/v1/poster/alarm/1333410.jpg?token=xxxxxx |
To download either the alarm snapshot or the entire alarm video you need to attach the generated token to your request:
https://api.cloud.instar.de/api/v1/video/alarm/1333410.mp4?token=xxxxxx
https://api.cloud.instar.de/api/v1/poster/alarm/1333410.jpg?token=xxxxxx