Introduction
Welcome to the TetherX API! You can use our API to access TetherX API endpoints, which can get information about events, zones, recordings and other data from our database.
You can view code examples in the dark area to the right
oAuth2 Integration
Before you'll start work with API you need to generate your oAuth2 token.
Register your client app
Give the user permission to create an oAuth2 application by going to: Admin -> Users -> User -> Permissions and ticking the Allow Creating oAuth2 Applications checkbox:
Create a new oauth application by going to Admin -> Users -> User -> API Details and clicking the Create oAuth Application button. Enter a valid application name and redirect uri, after saving you will see your all registered applications:
Request authorisation
To request the authorisation token, you can use a compatible oauth2 library, for example: oauth2 for ruby, or by visiting the URL manually and clicking "Authorise".
https://my.timeline.is/oauth/authorize?client_id=YOUR_API_KEY&redirect_uri=https%3A%2F%2Fmy.site.com%2Fcallback%2Furl&response_type=code
Redirect URI
After authorisation, the system will automatically redirect you to your REDIRECT_URI, which you configured above. For example:
https://my.site.com/callback/url?code=380762fb28c7c17d096a06fce974535c8129ab8a13fab5608a4e1c1075bbf01a
Requesting the Access Token
To request the access token, you need to send a post request with the returned code above. To do this, you can use any HTTP client.
In this example, we use
rest-client
for ruby:
parameters = 'client_id=YOUR_API_KEY&client_secret=YOUR_API_SECRET&code=RETURNED_CODE&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fmy.site.com%2Fcallback%2Furl'
RestClient.post 'http://my.timeline.is/oauth/token', parameters
The response look something like this:
{
"access_token": "de6780bc506a0446309bd9362820ba8aed28aa506c71eedbe1c5c4f9dd350e54",
"token_type": "Bearer",
"expires_in": 2629746,
"refresh_token": "8257e65c97202ed1726cf9571600918f3bffb2544b26e00a61df9897668c33a1",
"created_at": 1569313222
}
Events
Get events in period of time
curl "https://my.timeline.is/api/v3p/events?from=2018-07-09%2019:00:00&to=2018-07-09%2020:30:00&zone_id=5d1f0bed41092775efbddc36" \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data": [
{
"id": "5f06c1a541092788f683f3c8",
"type": "events",
"attributes": {
"items_count": 0,
"duration": 2520,
"motion": 0.0,
"filesize": 0,
"severity": "normal",
"starts_at": "2020-06-12T16:03:09.019+01:00",
"ends_at": "2020-06-12T16:45:09.019+01:00",
"has_pir": false,
"has_anpr": false,
"has_motion": false,
"has_video_loss": false,
"has_video_blind": false,
"has_video_defocus": false,
"has_abnormal_audio": false,
"has_loitering": false,
"has_people_gathering": false,
"has_fast_moving": false,
"has_storage_failure": false,
"has_storage_low_space": false,
"has_temperature": false,
"has_storage_not_exist": false,
"has_alarm": false,
"has_face": false,
"has_tripwire": false,
"has_intrusion": false,
"has_parking": false,
"has_car": false,
"has_object_removal": false,
"has_abandoned_object": false,
"has_missing_object": false,
"has_scene_change": false,
"has_tma": false,
"complete": true,
"flagged": true,
"has_auto_register": false,
"has_ip_conflict": false,
"has_network_change": false,
"shared": false,
"cloud": false,
"starts_at_seconds_since_midnight": 57789,
"ends_at_seconds_since_midnight": 60309,
"updated_at": "2020-07-09T08:05:09.036+01:00",
"created_at": "2020-07-09T08:05:09.036+01:00",
"timeline_id": "5f06c1a441092788f683f3ba",
"zone_id": "5f06c1a541092788f683f3c7",
"location_id": "5f06c1a441092788f683f3c6",
"best_id": "8fd1123a441092788f683f3c6"
}
}
], "jsonapi": {"version": "1.0"}
}
This endpoint retrieves events in period of time between from
and to
dates.
HTTP Request
GET https://my.timeline.is/api/v3p/events
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
zone_id | query | Zone ID to find event in | yes | String |
from | query | Timestamp of period when event was started | No | Datetime |
to | query | Timestamp of period when event was ended | No | Datetime |
Response fields
Name | Located in | Description | Type |
---|---|---|---|
items_count | JSON | the number of records found | Number |
duration | JSON | the total duration of entries in seconds | Number |
motion | JSON | the percentage of motion detected | Float |
filesize | JSON | the file size | Number |
starts_at | JSON | the date of the very first entry | Datetime |
ends_at | JSON | the date of the last entry | Datetime |
has_pir | JSON | PIR alarm detected | Boolean |
has_anpr | JSON | a license plate detected | Boolean |
has_motion | JSON | a motion detected | Boolean |
has_video_loss | JSON | Video Loss detected | Boolean |
has_video_blind | JSON | Video Blind detected | Boolean |
has_video_defocus | JSON | Video Defocus detected | Boolean |
has_abnormal_audio | JSON | Abnormal Audio detected | Boolean |
has_loitering | JSON | Wander Detected | Boolean |
has_people_gathering | JSON | Rioter Detected | Boolean |
has_fast_moving | JSON | fast motion detected | Boolean |
has_storage_failure | JSON | a storage failure detected | Boolean |
has_storage_low_space | JSON | low drive space detected | Boolean |
has_temperature | JSON | Heat Imaging Tamper detected | Boolean |
has_storage_not_exist | JSON | Storage Does Not Exist detected | Boolean |
has_alarm | JSON | alarm detected | Boolean |
has_face | JSON | face detected | Boolean |
has_tripwire | JSON | line (tripwire) movement detected | Boolean |
has_intrusion | JSON | intrusion detected | Boolean |
has_parking | JSON | parking detected | Boolean |
has_car | JSON | a car detected | Boolean |
has_object_removal | JSON | TakenAwayDetection | Boolean |
has_abandoned_object | JSON | Abandoned Object | Boolean |
has_scene_change | JSON | Scene Change detected | Boolean |
has_tma | JSON | Temperature Measurement detected | Boolean |
complete | JSON | completed action detected | Boolean |
flagged | JSON | video was flagged | Boolean |
has_auto_register | JSON | AutoRegister detected | Boolean |
has_ip_conflict | JSON | IP address conflict detected | Boolean |
has_network_change | JSON | network or IP change detected | Boolean |
shared | JSON | video sharing detected | Boolean |
cloud | JSON | videos saved to the cloud | Boolean |
updated_at | JSON | time of last modification | Datetime |
created_at | JSON | creation time | Datetime |
timeline_id | JSON | timeline identifier | String |
zone_id | JSON | zone identifier | String |
location_id | JSON | location identifier | type |
Get event in a point of time
curl "https://my.timeline.is/api/v3p/events?at=2018-07-09%2019:00:00&zone_id=5d1f0bed41092775efbddc36" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data": [
{
"id": "5f06c1a541092788f683f3c8",
"type": "events",
"attributes": {
"items_count": 0,
"duration": 2520,
"motion": 0.0,
"filesize": 0,
"severity": "normal",
"starts_at": "2020-06-12T16:03:09.019+01:00",
"ends_at": "2020-06-12T16:45:09.019+01:00",
"has_pir": false,
"has_anpr": false,
"has_motion": false,
"has_video_loss": false,
"has_video_blind": false,
"has_video_defocus": false,
"has_abnormal_audio": false,
"has_loitering": false,
"has_people_gathering": false,
"has_fast_moving": false,
"has_storage_failure": false,
"has_storage_low_space": false,
"has_temperature": false,
"has_storage_not_exist": false,
"has_alarm": false,
"has_face": false,
"has_tripwire": false,
"has_intrusion": false,
"has_parking": false,
"has_car": false,
"has_object_removal": false,
"has_abandoned_object": false,
"has_missing_object": false,
"has_scene_change": false,
"has_tma": false,
"complete": true,
"flagged": true,
"has_auto_register": false,
"has_ip_conflict": false,
"has_network_change": false,
"shared": false,
"cloud": false,
"starts_at_seconds_since_midnight": 57789,
"ends_at_seconds_since_midnight": 60309,
"updated_at": "2020-07-09T08:05:09.036+01:00",
"created_at": "2020-07-09T08:05:09.036+01:00",
"timeline_id": "5f06c1a441092788f683f3ba",
"zone_id": "5f06c1a541092788f683f3c7",
"location_id": "5f06c1a441092788f683f3c6",
"best_id": "8fd1123a441092788f683f3c6"
}
}
], "jsonapi": {"version": "1.0"}
}
This endpoint retrieves single event in a point of time.
HTTP Request
GET https://my.timeline.is/api/v3p/events
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
zone_id | query | Zone ID to find event in | yes | String |
at | query | Timestamp of event to search | yes | Datetime |
Filter events on Web site
You can generate correct url to our site with filters and return_url
. We display banner at the top of site with link to your redirect_url
.
It's very useful if you want to display events on our site and have possibility to return to yours
If you want to display events in time period use events[from_time]
and events[to_time]
parameters. In this case timeline_id
is required parameter. If you don't pass correct timeline_id
, our site will display events for selected timeline on the site.
If you want to get event at a certain point in time - use at
parameter. In this case zone
is required parameter.
HTTP Request
https://my.timeline.is/events
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
at | query | Timestamp of event to search | No | |
zone | query | Zone ID to find event in. Is required if you pass at parameter |
Yes | String |
events[from_time] | query | Parameter for filter. Uses to filter by time start. Ex: 20:30 |
No | String |
events[to_time] | query | Parameter for filter. Uses to filter by time start as end value. Ex: 21:00 |
No | String |
events[date] | query | Parameter for filter. Uses to filter by date. Ex: 2020-06-21 |
No | String |
timeline_id | query | ID of timeline. Is required if you what to filter events. Ex: 5cac594b8ef0f82370f18d98 |
Yes | String |
return_url | query | URL for ability to return from results page | No | String |
"https://my.timeline.is/events?events%5Bdate%5D=2020-07-21&events%5Bfrom_time%5D=20%3A30&events%5Bto_time%5D=21%3A00&return_url=http%3A%2F%2Fhost.some%2Freturn%2Furl&timeline_id=5f06cfe74109278f7ef8dab2&zone=5f06cfeb4109278f7ef8dac7"
Locations
Get all locations
This endpoint retrieves locations according to user.
HTTP Request
GET https://my.timeline.is/api/v3p/locations
curl "https://my.timeline.is/api/v3p/locations" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data": [
{
"id": "5f072437410927adfe5be1e6",
"type": "locations",
"attributes": {
"active": true,
"address": "5 Dudley Gardens, RM3 8LJ",
"city": null,
"coordinates": [40.7143528, -74.0059731],
"country": null,
"latitude": -74.0059731,
"longitude": 40.7143528,
"name": "et1",
"postcode": null,
"region": null,
"sname": "et1",
"state": null,
"timeline_id": "5f072437410927adfe5be1e5"
}
}
],
"jsonapi": { "version": "1.0" }
}
Response fields
Name | Located in | Description | Type |
---|---|---|---|
id | data | desc | String |
type | data | Response for locations endpoint | String |
attributes | data | Contains a set of location attributes | Object |
active | attributes | Location is active? | Boolean |
address | attributes | Location address | String |
city | attributes | Location city | String |
coordinates | attributes | Location coordinates | Array |
country | attributes | Location country | String |
latitude | attributes | Location latitude | Float |
longitude | attributes | Location longitude | Float |
name | attributes | Location name | String |
postcode | attributes | City postcode | Number |
region | attributes | City region | String |
sname | attributes | Location SubName | String |
state | attributes | Location state | String |
timeline_id | attributes | Timeline identifier to which this location belongs | String |
Arm location
This endpoint arms location with passed delay.
HTTP Request
POST https://my.timeline.is/api/v3p/locations/:id/arm
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
id | query | Location identifier | yes | String |
delay | query/body | Delay in seconds after system will trigger location | no | Integer |
curl "https://my.timeline.is/api/v3p/locations/:id/arm" \
--data '{"delay":"5"}' \
--request POST \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns JSON structured like this:
{
"data": {
"armed": true,
"when": "2021-11-17T14:54:31.487+02:00"
},
"jsonapi": { "version": "1.0" }
}
Response fields
Name | Located in | Description | Type |
---|---|---|---|
armed | data | Displays arm action | Boolean |
when | data | Date/time when arm will happen | Datetime |
Disarm location
This endpoint disarms location with passed delay.
HTTP Request
POST https://my.timeline.is/api/v3p/locations/:id/disarm
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
id | query | Location identifier | yes | String |
delay | query/body | Delay in seconds after system will trigger location | no | Integer |
curl "https://my.timeline.is/api/v3p/locations/:id/disarm" \
--data '{"delay":"5"}' \
--request POST \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns JSON structured like this:
{
"data": {
"armed": false,
"when": "2021-11-17T14:54:31.487+02:00"
},
"jsonapi": { "version": "1.0" }
}
Response fields
Name | Located in | Description | Type |
---|---|---|---|
armed | data | Displays disarm action | Boolean |
when | data | Date/time when disarm will happen | Datetime |
LPR
Get license plates
This endpoint retrieves license plates between start
and end
dates.
HTTP Request
GET https://my.timeline.is/api/v3p/lpr
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
token | query | TetherX Token | yes | String |
starts_at | query | Start timestamp of LPR search | No | Datetime |
ends_at | query | End timestamp of LPR search | No | Datetime |
zone_id | query | Zone ID to find LPR in | yes | String |
curl "https://my.timeline.is/api/v3p/lpr?token=052om1JmDLxIOnwRLc6ppw&zone_id=5f06d0ca4109279015140bed&starts_at=2020-03-05+08%3A51%3A46.895+UTC&ends_at=2020-05-18+08%3A37%3A46.897+UTC" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data":[
{
"id":"5f06d0ca4109279015140bf4",
"type":"lprs",
"attributes": {
"flagged":false,
"has_picture":false,
"starts_at":"2020-03-05T08:51:46.895+00:00",
"plate_number":"SV05OSL4",
"country":"TUR",
"starts_at_seconds_since_midnight":31906,
"updated_at":"2020-07-09T09:09:46.896+01:00",
"created_at":"2020-07-09T09:09:46.896+01:00",
"timeline_id":"5f06d0ca4109279015140be7",
"event_id":"5f06d0ca4109279015140bef",
"camera_id":"5f06d0ca4109279015140bec",
"tetherbox_id":"5f06d0ca4109279015140be8",
"zone_id":"5f06d0ca4109279015140bed",
"location_id":"5f06d0ca4109279015140be9",
"image_url":"http://my.timeline.is/api/v3p/anpr/5f06d0ca4109279015140bf4/plate_image"
}
},
{
"id":"5f06d0ca4109279015140bf2",
"type":"lprs",
"attributes": {
"flagged":false,
"has_picture":false,
"starts_at":"2020-04-28T01:04:46.889+01:00",
"plate_number":"OW16DYA2",
"country":"GBR",
"starts_at_seconds_since_midnight":3886,
"updated_at":"2020-07-09T09:09:46.890+01:00",
"created_at":"2020-07-09T09:09:46.890+01:00",
"timeline_id":"5f06d0ca4109279015140be7",
"event_id":"5f06d0ca4109279015140bef",
"camera_id":"5f06d0ca4109279015140bec",
"tetherbox_id":"5f06d0ca4109279015140be8",
"zone_id":"5f06d0ca4109279015140bed",
"location_id":"5f06d0ca4109279015140be9",
"image_url":"http://my.timeline.is/api/v3p/anpr/5f06d0ca4109279015140bf2/plate_image"
}
}
],
"jsonapi": { "version": "1.0" }
}
Response fields
Name | Located in | Description | Type |
---|---|---|---|
id | data | LPR identifier | String |
type | data | Response for lpr endpoint | String |
attributes | data | Contains an object of event attributes | Object |
flagged | attributes | Event was flagged | Boolean |
has_picture | attributes | Event has picture | Boolean |
starts_at | attributes | Event starts at | Datatime |
plate_number | attributes | Licence plate number | String |
country | attributes | Country | String |
updated_at | attributes | Event was updated | Datatime |
created_at | attributes | Event was created | Datatime |
timeline_id | attributes | Timeline identifier | String |
event_id | attributes | Event identifier | String |
camera_id | attributes | Camera identifier | String |
tetherbox_id | attributes | TetherBox identifier | String |
zone_id | attributes | Zone identifier | String |
location_id | attributes | Location identifier | String |
image_url | attributes | Licence plate image url | String |
Get license plate image
This endpoint downloads license plate image from tetherbox.
HTTP Request
GET https://my.timeline.is/api/v3p/anpr/:lpr_id/plate_image
curl "https://my.timeline.is/api/v3p/anpr/:lpr_id/plate_image" -H "Authorization: Bearer YOUR_OAUTH_TOKEN" -o "image.jpg"
Response It returns binary file in case of success response
LPR Plates
Get license plates whitelist and blacklist
This endpoint retrieves all lpr plates.
HTTP Request
GET https://my.timeline.is/api/v3p/lpr_plates
Response fields
Name | Located in | Description | Type |
---|---|---|---|
id | data | License plate identifier | String |
type | data | Response for lpr_plates endpoint | String |
attributes | data | Contains an object of lpr_plates attributes | Object |
plate_number | attributes | License plate number | String |
group | attributes | The group to which the number belongs (whitelist/blacklist) | String |
expiry_date | attributes | Date of expiration | Datetime |
updated_at | attributes | Licence plate updated at | Datetime |
created_at | attributes | Licence plate created at | Datetime |
camera_id | attributes | Camera identifier | String |
curl "https://my.timeline.is/api/v3p/lpr_plates" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data": [{
"id": "60807953638d9d57daa71707",
"type": "lprplates",
"attributes": {
"plate_number": "SV05OSL2",
"group": "whitelist",
"expiry_date": "2021-04-21T20:13:23.440+01:00",
"updated_at": "2021-04-21T20:13:23.441+01:00",
"created_at": "2021-04-21T20:13:23.441+01:00",
"camera_id": "6080794a638d9d57daa71704"
}
}],
"jsonapi": { "version": "1.0" }
}
Create license plate
This endpoint creates whitelist blacklist license plate.
HTTP Request
POST https://my.timeline.is/api/v3p/lpr_plates
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
plate_number | query | License plate number | Yes | String |
group | query | whitelist or blacklist | No | String |
expiry_date | query | Expiry date | No | Datetime |
camera_id | query | Camera Id | Yes | String |
curl "https://my.timeline.is/api/v3p/lpr_plates" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data": {
"id": "60807953638d9d57daa71707",
"type": "lprplates",
"attributes": {
"plate_number": "SV05OSL2",
"group": "whitelist",
"expiry_date": "2021-04-21T20:13:23.440+01:00",
"updated_at": null,
"created_at": "2021-04-21T20:13:23.441+01:00",
"camera_id": "6080794a638d9d57daa71704"
}
},
"jsonapi": { "version": "1.0" }
}
Delete license plate
This endpoint deletes whitelist blacklist license plate.
HTTP Request
DELETE https://my.timeline.is/api/v3p/lpr_plates/:id
curl "https://my.timeline.is/api/v3p/lpr_plates/:id" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
Responses
Code | Description |
---|---|
200 | No Content |
Live
Get MJPEG live stream from a camera
This endpoint returns MJPEG live stream from a camera.
HTTP Request
GET https://my.timeline.is/live/:zone_id/stream?token=timeline_api_token
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
token | query | Timeline API_token | Yes | String |
curl "https://my.timeline.is/live/:zone_id/stream?token=timeline_api_token"
HLS playlist
This endpoint returns HLS playlist
HTTP Request
GET https://my.timeline.is/live/:zone_id/playlist
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
token | query | Timeline API_token | Yes | String |
curl "https://my.timeline.is/live/:zone_id/playlist?token=timeline_api_token"
The above command returns m3u file
Perspectives
Get all presets
This endpoint retrieves all presets related to user.
HTTP Request
GET https://my.timeline.is/api/v3p/perspectives
Response fields
Name | Located in | Description | Type |
---|---|---|---|
id | data | Preset identifier | String |
type | data | Response for perspectives endpoint | String |
attributes | data | Contains an object of presets attributes | Object |
layout | attributes | Layout name | String |
zone_ids | attributes | Zone identifiers included in the preset | Array |
name | attributes | Preset name | String |
timeline_id | attributes | Timeline identifier | String |
user_id | attributes | User identifier | String |
curl "https://my.timeline.is/api/v3p/perspectives" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data": [
{
"id": "5f06d2c541092790de7656e0",
"type": "perspectives",
"attributes": {
"layout": "layout_01",
"zone_ids": [],
"name": "quae",
"timeline_id": "5f06d2c441092790de7656d4",
"user_id": "5f06d2c541092790de7656df"
}
}
],
"jsonapi": { "version": "1.0" }
}
Live switch preset
When you open our Web site and go to liveview, you can change preset by this endpoint. You need to pass :id
of needed preset to the url.
HTTP Request
POST https://my.timeline.is/api/v3p/perspectives/:id/live_switch_preset
Responses
Code | Description |
---|---|
200 | No Content |
Display zones by location
If you want to select camera by location you can pass location_id
in the url. In case if you have only 4 cameras for this location it will select smallest layout available (i.e. 4 camera layout) and show cameras for this location. In case if there are more than 36 cameras, you can pass additional group
parameter, ie: group=1
, group=2
etc, to see the next "page" for this location.
HTTP Request
GET https://my.timeline.is/perspectives?location_id=5f06d4064109279130d5d6f3&group=2&return_url=http://your.some.site
Zones
Get all zones
This endpoint retrieves all zones related to user.
HTTP Request
GET https://my.timeline.is/api/v3p/zones
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
location_id | query | Filters By Location Id | No | String |
Response fields
Name | Located in | Description | Type |
---|---|---|---|
id | data | Zone identifier | String |
type | data | Response for zones endpoint | String |
attributes | data | Contains an object of zones attributes | Object |
name | attributes | Zone name | String |
active | attributes | Zone active? | Boolean |
device_id | attributes | Device identifier | String |
curl "https://my.timeline.is/api/v3p/zones" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data": [
{
"id": "5f06d4064109279130d5d6f3",
"type": "zones",
"attributes": {
"name": "Camera 2",
"active": true,
"device_id": "54c91a6d7365725aeb2e0f08"
}
}
],
"jsonapi": { "version": "1.0" }
}
Arm zones
This endpoint arms cameras for passed zones with passed delay.
HTTP Request
POST https://my.timeline.is/api/v3p/zones/arm
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
zone_ids | query/body | Zone ids splitted by comma | Yes | String |
delay | query/body | Delay in seconds after system will trigger zone | no | Integer |
curl "https://my.timeline.is/api/v3p/zones/arm" \
--data '{"zone_ids":"5d1f0bf741092775efbddd71,5d1f0bf441092775efbddd23","delay":"5"}' \
--request POST \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns JSON structured like this:
{
"data": {
"armed": true,
"when": "2021-11-17T14:54:31.487+02:00"
},
"jsonapi": { "version": "1.0" }
}
Response fields
Name | Located in | Description | Type |
---|---|---|---|
armed | data | Displays arm action | Boolean |
when | data | Date/time when arm will happen | Datetime |
Disarm zones
This endpoint disarms cameras for passed zones with passed delay.
HTTP Request
POST https://my.timeline.is/api/v3p/zones/disarm
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
zone_ids | query/body | Zone ids splitted by comma | Yes | String |
delay | query/body | Delay in seconds after system will trigger zone | no | Integer |
curl "https://my.timeline.is/api/v3p/zones/disarm" \
--data '{"zone_ids":"5d1f0bf741092775efbddd71,5d1f0bf441092775efbddd23","delay":"5"}' \
--request POST \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns JSON structured like this:
{
"data": {
"armed": false,
"when": "2021-11-17T14:54:31.487+02:00"
},
"jsonapi": { "version": "1.0" }
}
Response fields
Name | Located in | Description | Type |
---|---|---|---|
armed | data | Displays arm action | Boolean |
when | data | Date/time when disarm will happen | Datetime |
Trigger vmd event
This endpoint adds possibility to trigger vmd event. It creates event with proper icon. You should pass event description to the request. Here is available vmd descriptions:
'PIR alarm', 'FaceDetection', 'facedetection alarm', 'Motion alarm', 'VideoMotion', 'VideoMotionInfo', 'linedetection alarm', 'CrossLineDetection', 'VideoLoss', 'VideoBlind', 'AlarmLocal', 'CrossRegionDetection', 'LeftDetection', 'TakenAwayDetection', 'VideoAbnormalDetection', 'AudioMutation', 'AudioAnomaly', 'VideoUnFocus', 'WanderDetection', 'RioterDetection', 'ParkingDetection', 'vehicledetection alarm', 'MoveDetection', 'StorageNotExist', 'StorageFailure', 'StorageLowSpace', 'AlarmOutput', 'MDResult', 'HeatImagingTemper', 'SerialData', 'SceneChange', 'scenechangedetection alarm', 'Temperature Measurement Alarm', 'fielddetection alarm', 'TrafficVehiclePosition', 'TrafficJunction', 'shelteralarm alarm', 'NetworkChange', 'NetAbort', 'ipConflict alarm', 'AutoRegister'
HTTP Request
POST https://my.timeline.is/api/v3p/zones/:id/trigger_event
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
event_description | query/body | Event vmd description from documentation | yes | String |
curl "https://my.timeline.is/api/v3p/zones/5d1f0bf741092775efbddd71/trigger_event" \
--data '{"event_description":"CrossLineDetection"}' \
--request POST \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns JSON structured like this:
{
"success": "ok",
"error": null
}
In case if request is failed it returns "success": "error"
The error could be:
Failed to connect to tetherbox!
- in case when expired connection timeout to TB
Wrong event description!
- in case if bad description parameter in request
PTZ
This endpoint allows you to pass PTZ commands to zone.
HTTP Request
POST https://my.timeline.is/api/v3p/:zone_id/ptz
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
direction | query/body | Actions(move_auto, move_right, move_left, move_up, move_down, move_left_down, move_right_down, move_left_up, move_right_up, zoom_in, zoom_out, fetch_presets, wiper, light, goto_preset) | Yes | String |
params | query/body | Additional parameters e.g (seeed: 5) | Yes | Hash |
curl "https://my.timeline.is/api/v3p/zones/5d1f0bf741092775efbddd71/ptz" \
--data '{"direction":"move_right","params":{ "speed": "5"} }' \
--request POST \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns 200 status without body
Relay Outputs
This endpoint returns a list of relay outputs for zone.
HTTP Request
GET https://my.timeline.is/api/v3p/:zone_id/relay_outputs
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
zone_id | query | Zone identifier | yes | String |
Response fields
Name | Located in | Description | Type |
---|---|---|---|
relay_outputs | JSON | Contains an array of properties objects | Array |
properties | relay_outputs | Object contains properties | Object |
mode | properties | desc | String |
delay_time | properties | desc | String |
idle_state | properties | desc | String |
@token | relay_outputs | Relay identifier | String |
curl "https://my.timeline.is/api/v3p/zones/5d1f0bf741092775efbddd71/relay_outputs" \
--request GET \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns
{
"relay_outputs": [{
"properties": {
"mode": "Bistable",
"delay_time": "PT3S",
"idle_state": "closed"
},
"@token": "2"
},
{
"properties": {
"mode": "Monostable",
"delay_time": "PT5S",
"idle_state": "open"
},
"@token": "3"
}
]
}
Relay
This endpoint allows you to change the zone relay status by its token.
HTTP Request
POST https://my.timeline.is/api/v3p/:zone_id/relay
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
relay | query/body | Relay token/number | Yes | Integer |
state | query/body | Sate ON/OFF (default true) | No | Boolean |
curl "https://my.timeline.is/api/v3p/zones/5d1f0bf741092775efbddd71/relay" \
--data '{"relay": 3,"state": true}' \
--request POST \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns 200 status without body
Audio challenge
This endpoint allows you play audio announcement on TetherBox.
HTTP Request
POST https://my.timeline.is/api/v3p/:zone_id/audio_challenge
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
audio_base64 | query/body | Audio file in Base64 Ogg.Opus format | Yes | String |
curl "https://my.timeline.is/api/v3p/zones/5d1f0bf741092775efbddd71/audio_challenge" \
--data '{"audio_base64":"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"}' \
--request POST \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns 200 status without body
Devices
Get list of devices
This endpoint retrieves all devices related to user.
HTTP Request
GET https://my.timeline.is/api/v3p/devices
Response fields
Name | Located in | Description | Type |
---|---|---|---|
id | JSON | Device identifier | String |
type | JSON | Response for devices endpoint | String |
attributes | JSON | Contains an object of device attributes | Object |
active | attributes | Device active? | Boolean |
activated | attributes | Device activated | Boolean |
last_seen | attributes | Last time the device was online | Datatime |
device_name | attributes | Device name | String |
percentage_packet_loss | attributes | Packet loss rate for device (based on ping) | Number |
ip | attributes | Device IP address | String |
mac | attributes | Device MAC address | String |
vendor | attributes | Device vendor | String |
tetherbox_id | attributes | TetherBox identifier | String |
timeline_id | attributes | Timeline identifier | String |
location_id | attributes | Location identifier | String |
tunnels | attributes | Open tunnels to the device | Array |
port | tunnels | External port | Number |
to | tunnels | Internal port | Number |
active_till | tunnels | the tunnel is available until this time | Datatime |
curl "https://my.timeline.is/api/v3p/devices" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"id": "5e8b135ca34dbe4eee61c56b",
"type": "devices",
"attributes": {
"active": false,
"activated": false,
"last_seen": "2021-07-13T21:33:02.662+01:00",
"device_name": null,
"percentage_packet_loss": 0,
"ip": "10.11.160.252",
"mac": "54:C4:15:88:4B:90",
"vendor": "Hangzhou Hikvision Digital",
"tetherbox_id": "5d404864a34dbe15c8a4f3ca",
"timeline_id": "5c50604ca34dbe182afa1249",
"location_id": "5c5d7ae8a34dbe565274f2fc",
"tunnels": [{
"port": 37310,
"to": 554,
"active_till": "2021-07-14T09:35:12.461Z"
}]
}
}
Open tunnel
This endpoint allows you to open a tunnel to the device if it's online. The tunnel is active for 1 hour since opening time.
HTTP Request
POST https://my.timeline.is/api/v3p/devices/:device_id/open_tunnel
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
port | query/body | TCP Port number (default 80) | No | Integer |
curl "https://my.timeline.is/api/v3p/devices/5d1f0bf741092775efbddd71/open_tunnel" \
--data '{ "port": 554 }' \
--request POST \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns JSON structured like this:
{
"tunnels": [{
"port": 37310,
"to": 554,
"active_till": "2021-07-14T09:35:12.461Z"
}]
}
Once you get a response you can use port in VLC player. The rtsp URL will look like: rtsp://admin:password@timeline.is:37310/Streaming/Channels/102
Close tunnel
This endpoint allows you to close tunnel to the device.
HTTP Request
POST https://my.timeline.is/api/v3p/devices/:device_id/close_tunnel
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
port | query/body | TCP Port number | Yes | Integer |
curl "https://my.timeline.is/api/v3p/devices/5d1f0bf741092775efbddd71/close_tunnel" \
--data '{ "port": 8080 }' \
--request POST \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
The above command returns JSON structured like this:
{
"data": {}
}
TetherBoxes
Get Status
This endpoint status tethebox status info.
HTTP Request
GET https://my.timeline.is/api/v3p/tetherboxes/:serial/status
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
serial | query | TetherBox serial | yes | String |
Response fields
Name | Located in | Description | Type |
---|---|---|---|
id | data | TetherBox identifier | String |
type | data | Response for tetherboxes/status endpoint | String |
attributes | data | Contains an object of tetherbox attributes | Object |
speedtest | attributes | Contains information about the performed internet speed test | Object |
download | speedtest | Download speed | String |
upload | speedtest | Upload speed | String |
last_run | speedtest | Last test date | Datetime |
external_ip | attributes | External TetherBox IP | String |
interfaces_api | attributes | Contains an object with the TetherBox interfaces | Object |
online | attributes | TetherBox online? | Boolean |
timeline_id | attributes | Timeline identifier | String |
location_id | attributes | Location identifier | String |
uptime | attributes | TetherBox online time | String |
recent_reboots | attributes | Recent TetherBox Reboots | Array |
connection_history | attributes | history of disconnections and connections of TetherBox to the network | Array |
curl "https://my.timeline.is/api/v3p/tetherboxes/:serial/status" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data": {
"id": "5d5d05ca7fe76e098d8eb7a9",
"type": "tetherboxes",
"attributes": {
"speedtest": {
"download": "94.32 Mbit/s",
"upload": "94.92 Mbit/s",
"last_run": "2021-07-25T04:31:36.514+01:00"
},
"external_ip": "78.137.9.196",
"interfaces_api": {
"enp2s0": {
"mtu": "1500",
"speed": "100",
"address": "e0:d5:5e:ee:dd:a6",
"rx_bytes": 32995563694,
"tx_bytes": 1932618710,
"ips": [
"10.11.160.11/24"
]
},
"wlp1s0": {
"wireless": true,
"mtu": "1500",
"address": "04:d3:b0:87:0c:e4",
"rx_bytes": "0",
"tx_bytes": "0",
"ips": []
}
},
"online": true,
"timeline_id": "5c505e797fe76e7b48b06151",
"location_id": "5c5d7a727fe76e0967b6bc5b",
"uptime": "10 days",
"recent_reboots": [
"reboot system boot 4.15.0-137-gener 2021-07-16T16:43:08+0100 still running",
"reboot system boot 4.15.0-137-gener 2021-07-15T09:26:20+0100 - 2021-07-15T09:30:50+0100 (00:04)",
"reboot system boot 4.15.0-137-gener 2021-07-07T09:47:07+0100 - 2021-07-15T09:30:50+0100 (7+23:43)",
"reboot system boot 4.15.0-137-gener 2021-07-05T08:21:43+0100 - 2021-07-06T16:27:34+0100 (1+08:05)",
"reboot system boot 4.15.0-137-gener 2021-06-25T08:03:00+0100 - 2021-07-06T16:27:34+0100 (11+08:24)",
"reboot system boot 4.15.0-137-gener 2021-06-04T14:34:08+0100 - 2021-07-06T16:27:34+0100 (32+01:53)",
"reboot system boot 4.15.0-137-gener 2021-05-04T12:50:22+0100 - 2021-07-06T16:27:34+0100 (63+03:37)",
"reboot system boot 4.15.0-137-gener 2021-05-04T09:19:37+0100 - 2021-05-04T12:49:41+0100 (03:30)",
"reboot system boot 4.15.0-137-gener 2021-04-05T11:23:14+0100 - 2021-05-04T12:49:41+0100 (29+01:26)",
"reboot system boot 4.15.0-137-gener 2021-04-05T11:01:23+0100 - 2021-04-05T11:22:47+0100 (00:21)",
"reboot system boot 4.15.0-137-gener 2021-04-04T21:18:31+0100 - 2021-04-05T11:00:59+0100 (13:42)"
],
"connection_history": [{
"date": "2021-07-26 12:25:59 +0100",
"type": "Connected",
"untrusted_ip": "78.137.9.196"
},
{
"date": "2021-07-26 12:25:57 +0100",
"type": "Disconnected",
"untrusted_ip": "78.137.9.196",
"bytes_received": "53.4 KB",
"bytes_sent": "35.1 KB",
"time_duration": "24 minutes"
},
{
"date": "2021-07-26 12:01:34 +0100",
"type": "Connected",
"untrusted_ip": "78.137.9.196"
},
{
"date": "2021-07-26 12:01:32 +0100",
"type": "Disconnected",
"untrusted_ip": "78.137.9.196",
"bytes_received": "19.5 KB",
"bytes_sent": "12 KB",
"time_duration": "8 minutes"
},
{
"date": "2021-07-26 11:53:51 +0100",
"type": "Connected",
"untrusted_ip": "78.137.9.196"
},
{
"date": "2021-07-26 11:53:49 +0100",
"type": "Disconnected",
"untrusted_ip": "78.137.9.196",
"bytes_received": "10 KB",
"bytes_sent": "6.06 KB",
"time_duration": "3 minutes"
},
{
"date": "2021-07-26 11:50:45 +0100",
"type": "Disconnected",
"untrusted_ip": "78.137.9.196",
"bytes_received": "93.9 KB",
"bytes_sent": "58.4 KB",
"time_duration": "39 minutes"
},
{
"date": "2021-07-26 11:50:39 +0100",
"type": "Connected",
"untrusted_ip": "78.137.9.196"
},
{
"date": "2021-07-26 11:12:06 +0100",
"type": "Disconnected",
"untrusted_ip": "78.137.9.196",
"bytes_received": "8 KB",
"bytes_sent": "4.79 KB",
"time_duration": "3 minutes"
},
{
"date": "2021-07-26 11:12:04 +0100",
"type": "Connected",
"untrusted_ip": "78.137.9.196"
}
]
}
},
"jsonapi": {
"version": "1.0"
}
}
Get devices
This endpoint retrieves devices related to tetherbox.
HTTP Request
GET https://my.timeline.is/api/v3p/tetherboxes/:serial/devices
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
serial | query | TetherBox serial | yes | String |
Response fields
Name | Located in | Description | Type |
---|---|---|---|
devices | JSON | The array contains all devices tied to TetherBox | Array |
device_id | devices | Device identifier | String |
name | devices | Device name | String |
last_seen | devices | Last seen device date | Datatime |
ip | devices | Device IP address | String |
mac | devices | Device MAC address | String |
online | devices | Device online? | Boolean |
curl "https://my.timeline.is/api/v3p/tetherboxes/:serial/devices" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"devices": [{
"device_id": "5d5d40857fe76e09a78eb7be",
"name": "device in Ukraine",
"last_seen": "2021-07-16T16:48:06.270+01:00",
"ip": "192.168.2.1",
"mac": "CC:2D:E0:75:90:AF",
"online": true
},
{
"device_id": "5d5d40887fe76e098d8eb7c2",
"name": "device in Ukraine",
"last_seen": "2021-07-16T16:48:02.265+01:00",
"ip": "10.11.160.4",
"mac": "E0:D5:5E:CC:1B:9D",
"online": true
}
]
}
Get cameras
This endpoint retrieves cameras related to tetherbox.
HTTP Request
GET https://my.timeline.is/api/v3p/tetherboxes/:serial/cameras
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
serial | query | TetherBox serial | yes | String |
Response fields
Name | Located in | Description | Type |
---|---|---|---|
cameras | JSON | The array contains all cameras tied to TetherBox | Array |
camera_id | cameras | Camera identifier | String |
name | cameras | Camera name | String |
vendor | cameras | Camera vendor | String |
ip | cameras | Camera IP address | String |
zone | cameras | Zone identifier | String |
online | cameras | Camera online? | Boolean |
curl "https://my.timeline.is/api/v3p/tetherbox/:serial/cameras" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"cameras": [{
"camera_id": "5e8fa9077fe76e7b824124f6",
"name": "Camera 3",
"vendor": "Hangzhou Hikvision Digital",
"ip": "10.11.160.252",
"zone": "5e8fa9077fe76e7b824124f5",
"online": true
}]
}
Recordings
Get list of recordings
This endpoint retrieves all recordings related to user.
HTTP Request
GET https://my.timeline.is/api/v3p/recordings
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
at | query | Timestamp of recording to search | Yes | Datetime |
zone_id | query | Zone ID to find recording in | Yes | String |
Response fields
Name | Located in | Description | Type |
---|---|---|---|
id | data | List of records identifier | String |
type | data | Response for recordings endpoint | String |
attributes | data | Contains an object of events attributes | Object |
tetherbox_image | attributes | Image stored in TetherBox? | Boolean |
tetherbox_video | attributes | Video stored in TetherBox? | Boolean |
checksum | attributes | Check sum for checking the authenticity of the record | Boolean |
cloud_path | attributes | URL to this image in Cloud storage | String |
cloud_snapshot | attributes | Snapshot in the Cloud storage? | Boolean |
cloud_thumbnail | attributes | Thumbnail in the Cloud storage? | Boolean |
cloud_timelapse | attributes | Timelapse in the Cloud storage? | Boolean |
cloud_timelapse_error | attributes | Timelapse error in the Cloud storage? | String |
cloud_timelapse_interval | attributes | Timelapse Internal in the Cloud storage? | String |
cloud_video | attributes | Video in the Cloud storage? | Boolean |
created_at | attributes | Datetime when the record was created | Datatime |
ends_at | attributes | Datetime when the record was finished | Datatime |
filesize | attributes | Size of record | Number |
flagged | attributes | Record flagged? | Boolean |
motion | attributes | Percentage of movement on the record | Float |
path | attributes | Save path on the TetherBox | String |
skip_notify | attributes | Notifications turned off? | Boolean |
starts_at | attributes | Datetime when the system started recording | Datatime |
updated_at | attributes | Datetime when the record was updated | Datatime |
epoch_time | attributes | Epoch time | Datatime |
tetherbox_id | attributes | TetherBox identifier | String |
camera_id | attributes | Camera identifier | String |
device_id | attributes | Device identifier | String |
event_id | attributes | Event identifier | String |
flagged_by_id | attributes | Event flagged by user identifier | String |
location_id | attributes | Location identifier | String |
timeline_id | attributes | Timeline identifier | String |
unflagged_by_id | attributes | Event unflagged by user identifier | String |
zone_id | attributes | Zone identifier | String |
urls | attributes | URLs for event | Object |
prev_recording_id | attributes | Previously recording identifier | String |
next_recording_id | attributes | Next recording identifier | String |
timelapses | attributes | Stores information about thumbnail timelapse paths and their random identifiers (random per recording object) | Array |
curl "https://my.timeline.is/api/v3p/recordings?zone_id=5f06e4e741092794a7010c29&at=2020-04-25T08:03:36.094+01:00" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data": [{
"id": "5d1f0c0a41092775efbddfe7",
"type": "recordings",
"attributes": {
"tetherbox_image": true,
"tetherbox_video": true,
"checksum": null,
"cloud_path": null,
"cloud_snapshot": true,
"cloud_thumbnail": true,
"cloud_timelapse": true,
"cloud_timelapse_error": null,
"cloud_timelapse_interval": null,
"cloud_video": true,
"cloud_waveform": false,
"created_at": "2019-07-05T09:36:26.584+01:00",
"ends_at": "2019-03-02T16:02:26.577+00:00",
"ends_at_seconds_since_midnight": 57746,
"filesize": 0,
"flagged": false,
"motion": 0,
"object_count": 0,
"path": "/recordings/et406",
"skip_notify": false,
"starts_at": "2019-03-02T16:01:26.577+00:00",
"starts_at_seconds_since_midnight": 57686,
"updated_at": "2019-07-05T09:36:26.584+01:00",
"seek_to_event": 0,
"epoch_time": "02032019-0401PM-0402PM",
"tetherbox_id": "5d1f0be841092775efbddb7e",
"camera_id": "5d1f0bf541092775efbddd33",
"device_id": null,
"event_id": "5d1f0c0a41092775efbddfe2",
"flagged_by_id": null,
"location_id": "5d1f0be741092775efbddb71",
"timeline_id": "5d1f0be641092775efbddb62",
"unflagged_by_id": null,
"zone_id": "5d1f0bf541092775efbddd32",
"urls": {
"proxy": "https://s3.eu-west-2.amazonaws.com/timeline.is/customer-timeline/porro13/recordings/et406",
"proxy_download": "https://s3.eu-west-2.amazonaws.com/timeline.is/customer-timeline/porro13/recordings/et406",
"proxy_snapshot": "https://s3.eu-west-2.amazonaws.com/timeline.is/customer-timeline/porro13/recordings/et406.jpg",
"local": "127.0.0.1:2999/api/v3/recordings/download.mp4?recording%5Bpath%5D=%2Frecordings%2Fet406&token=tc49Xv1q84dWYPmuhpBLFw",
"local_snapshot": "127.0.0.1:2999/api/v3/recordings/snapshot?recording%5Bpath%5D=%2Frecordings%2Fet406.jpg&token=tc49Xv1q84dWYPmuhpBLFw",
"external": "external-porro13.timeline.is/api/v3/recordings/download.mp4?recording%5Bpath%5D=%2Frecordings%2Fet406&token=tc49Xv1q84dWYPmuhpBLFw",
"external_snapshot": "external-porro13.timeline.is/api/v3/recordings/snapshot?recording%5Bpath%5D=%2Frecordings%2Fet406.jpg&token=tc49Xv1q84dWYPmuhpBLFw"
},
"prev_recording_id": "5d1f0c0a41092775efbddfee",
"next_recording_id": "5d1f0c0a41092775efbddfe6",
"timelapses": [
"0": {
"id": 2021760,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:10%20+0000/thumbnail"
},
"1": {
"id": 2021780,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:15%20+0000/thumbnail"
},
"2": {
"id": 2021800,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:20%20+0000/thumbnail"
},
"3": {
"id": 2021820,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:25%20+0000/thumbnail"
},
"4": {
"id": 2021840,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:30%20+0000/thumbnail"
},
"5": {
"id": 2021860,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:35%20+0000/thumbnail"
},
"6": {
"id": 2021880,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:40%20+0000/thumbnail"
},
"7": {
"id": 2021900,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:45%20+0000/thumbnail"
},
"8": {
"id": 2021920,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:50%20+0000/thumbnail"
},
"9": {
"id": 2021940,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:55%20+0000/thumbnail"
},
"10": {
"id": 2021960,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:00%20+0000/thumbnail"
},
"11": {
"id": 2021980,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:05%20+0000/thumbnail"
},
"12": {
"id": 2022000,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:10%20+0000/thumbnail"
},
"13": {
"id": 2022020,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:15%20+0000/thumbnail"
},
"14": {
"id": 2022040,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:20%20+0000/thumbnail"
},
"15": {
"id": 2022060,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:25%20+0000/thumbnail"
},
"16": {
"id": 2022080,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:30%20+0000/thumbnail"
},
"17": {
"id": 2022100,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:35%20+0000/thumbnail"
},
"18": {
"id": 2022120,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:40%20+0000/thumbnail"
}
]
}
}]
}
Get recording
This endpoint retrives single recording object by passed id
HTTP Request
GET https://my.timeline.is/api/v3p/recordings/:id
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
id | query | Recording identificator | yes | String |
curl "https://my.timeline.is/api/v3p/recordings/5f06e5f241092794fc255ded" -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
The above command returns JSON structured like this:
{
"data": {
"id": "5d1f0c0a41092775efbddfe7",
"type": "recordings",
"attributes": {
"tetherbox_image": true,
"tetherbox_video": true,
"checksum": null,
"cloud_path": null,
"cloud_snapshot": true,
"cloud_thumbnail": true,
"cloud_timelapse": true,
"cloud_timelapse_error": null,
"cloud_timelapse_interval": null,
"cloud_video": true,
"cloud_waveform": false,
"created_at": "2019-07-05T09:36:26.584+01:00",
"ends_at": "2019-03-02T16:02:26.577+00:00",
"ends_at_seconds_since_midnight": 57746,
"filesize": 0,
"flagged": false,
"motion": 0,
"object_count": 0,
"path": "/recordings/et406",
"skip_notify": false,
"starts_at": "2019-03-02T16:01:26.577+00:00",
"starts_at_seconds_since_midnight": 57686,
"updated_at": "2019-07-05T09:36:26.584+01:00",
"seek_to_event": 0,
"epoch_time": "02032019-0401PM-0402PM",
"tetherbox_id": "5d1f0be841092775efbddb7e",
"camera_id": "5d1f0bf541092775efbddd33",
"device_id": null,
"event_id": "5d1f0c0a41092775efbddfe2",
"flagged_by_id": null,
"location_id": "5d1f0be741092775efbddb71",
"timeline_id": "5d1f0be641092775efbddb62",
"unflagged_by_id": null,
"zone_id": "5d1f0bf541092775efbddd32",
"urls": {
"proxy": "https://s3.eu-west-2.amazonaws.com/timeline.is/customer-timeline/porro13/recordings/et406",
"proxy_download": "https://s3.eu-west-2.amazonaws.com/timeline.is/customer-timeline/porro13/recordings/et406",
"proxy_snapshot": "https://s3.eu-west-2.amazonaws.com/timeline.is/customer-timeline/porro13/recordings/et406.jpg",
"local": "127.0.0.1:2999/api/v3/recordings/download.mp4?recording%5Bpath%5D=%2Frecordings%2Fet406&token=tc49Xv1q84dWYPmuhpBLFw",
"local_snapshot": "127.0.0.1:2999/api/v3/recordings/snapshot?recording%5Bpath%5D=%2Frecordings%2Fet406.jpg&token=tc49Xv1q84dWYPmuhpBLFw",
"external": "external-porro13.timeline.is/api/v3/recordings/download.mp4?recording%5Bpath%5D=%2Frecordings%2Fet406&token=tc49Xv1q84dWYPmuhpBLFw",
"external_snapshot": "external-porro13.timeline.is/api/v3/recordings/snapshot?recording%5Bpath%5D=%2Frecordings%2Fet406.jpg&token=tc49Xv1q84dWYPmuhpBLFw"
},
"prev_recording_id": "5d1f0c0a41092775efbddfee",
"next_recording_id": "5d1f0c0a41092775efbddfe6",
"timelapses": [
"0": {
"id": 2021760,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:10%20+0000/thumbnail"
},
"1": {
"id": 2021780,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:15%20+0000/thumbnail"
},
"2": {
"id": 2021800,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:20%20+0000/thumbnail"
},
"3": {
"id": 2021820,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:25%20+0000/thumbnail"
},
"4": {
"id": 2021840,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:30%20+0000/thumbnail"
},
"5": {
"id": 2021860,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:35%20+0000/thumbnail"
},
"6": {
"id": 2021880,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:40%20+0000/thumbnail"
},
"7": {
"id": 2021900,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:45%20+0000/thumbnail"
},
"8": {
"id": 2021920,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:50%20+0000/thumbnail"
},
"9": {
"id": 2021940,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:01:55%20+0000/thumbnail"
},
"10": {
"id": 2021960,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:00%20+0000/thumbnail"
},
"11": {
"id": 2021980,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:05%20+0000/thumbnail"
},
"12": {
"id": 2022000,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:10%20+0000/thumbnail"
},
"13": {
"id": 2022020,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:15%20+0000/thumbnail"
},
"14": {
"id": 2022040,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:20%20+0000/thumbnail"
},
"15": {
"id": 2022060,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:25%20+0000/thumbnail"
},
"16": {
"id": 2022080,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:30%20+0000/thumbnail"
},
"17": {
"id": 2022100,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:35%20+0000/thumbnail"
},
"18": {
"id": 2022120,
"src": "/api/v3p/timelapse/5d1f0bf541092775efbddd32/2019-03-02%2016:02:40%20+0000/thumbnail"
}
]
}
}
}
Recording on Web site
You can generate correct url to our site to display recording at a certain point in time and pass return_url
. We display banner at the top of site with link to your redirect_url
.
It's very useful if you want to display recording on our site and have possibility to return to yours.
"https://my.timeline.is/recordings?at=2018-07-09%2019:00:00&zone=5f06cfeb4109278f7ef8dac7&return_url=http%3A%2F%2Fhost.some%2Freturn%2Furl"
HTTP Request
https://my.timeline.is/recordings
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
at | query | Timestamp of recording to search | Yes | String |
zone | query | Zone ID to find recording in | Yes | String |
return_url | query | URL for ability to return from results page | No | String |
Alarm
Receiving SIA string
This endpoint receiving SIA requests.
HTTP Request
POST https://my.timeline.is/api/v3/alarms/sia_event
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
sia_event | query/body | string in SIA format | Yes | String |
curl "https://my.timeline.is/api/v3/alarms/sia_event" \
--data '{"alarm":{"sia_event":"[#900001|Nti22:02/ri01/BA1001|ABurglary Alarm]"},"token":YOUR_TIMELINE_API_TOKEN}' \
--request POST \
-H "Content-Type: application/json"
The above command returns 200 status without body
Errors
We are supporting next errors:
401 Unauthorized
Returns 401
status code. Happens when incorrect user token passed.
{ "data": { "errors": ["Not Authorised!"] } }
404 Not Found
Returns 404
status code. Happens when record not found in DB.
{ "data": { "errors": ["Not Found"] } }
403 Forbidden
Returns 403
status code. Happens when user does not have access to the record.
{ "data": { "errors": ["Not Found"] } }
500 Unexpected error
Returns 500
status code. Happens when some unexpected error happened on the server.
{ "data": { "errors": ["Something went wrong"] } }