Sessions
Used to retrieve session information from the camera's SD card. Session is represented by sequence of files generated by a camera in certain modes (continuous photo mode, burst image, longer video recording when video files are split on 4GB boundaries...). In case of modes where only one file per recording session is generated, that one file is considered to be a session as well.
GET /api/<versionNumber>/sessions/videos[?sort=<sort>][&order=<order>][&offset=<offset>][&count=<count>]
Format:
http://<baseURL>/api/<versionNumber>/sessions/videos[?sort=<sort>][&order=<order>][&offset=<offset>][&count=<count>]
Example:
http://192.168.1.101/api/2/sessions/videos
Parameters:
Parameter 'offset' is 0-based so offset=0 will address the first session from the resource.
'offset' and 'count' are used (based on sort criteria set by 'sort' parameter and 'order') to retrieve video information for 'count' sessions, first starting at specified 'offset' from beginning of a sorted list of sessions. If 'offset' is bigger than total count of sessions, error code will be returned. However, if 'offset' falls into range but 'count' specifies more items than available, this method will return as many sessions as possible and won't return error status code.
The table below describes all of the parameters that can be used in a request. Parameters and values are case-sensitive. Required parameters must be used or the call will fail. Optional parameters, which are highlighted with [square brackets], may be used. If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table.
NOTE: Offset and count works on a session boundaries, rather than file boundaries as it's the case with GET /videos.
Parameter | Description | Req'd? | Possible values |
baseURL | Fixed address, Bandit acts like an access point with this addres. TomTom Bandit's WiFi has to be turned on. | Yes | 192.168.1.101 |
versionNumber | Service version number. The current value is 2. | Yes | 2 |
[sort] | Results are sorted by filename (default, in case other parameters are added in the future). | No | filename (default) |
[order] | Results are returned in ascending (default, if parameter is omitted) or descending order if specified differently. | No | asc (default) desc |
[offset] | Defaults to 0 if omitted, otherwise represents 0-based offset targeting the first session from the result list that should be returned in response. | No | 0-based integer offset |
[count] | Defaults to 1 if omitted, otherwise represents maximum number of sessions that should be returned in response. If 'count' is bigger than the remaining number of result session, only remaining session items will be returned. If count is set to 0, response containing only total number of sessions, without any actual item will be returned. |
No | integer number of session items requested |
Description:
Returns array of JSON objects containing information about the first video found in every session. Each JSON object will contain following information:
Parameter | Description | Req'd? | Type |
path | Path to video in format: '/'+<DCIM_folder>+'/'+<filename>. | Yes | string, max. 255 characters |
id | Unique identified of the video file. | Yes | string, max. 49 characters |
created | ISO 8601 UTC format of file's creation time. | Yes | string |
size_bytes | Image file size in bytes. | Yes | integer |
length_secs | Length of a video in seconds (rounded to 2 decimal places) | Yes | decimal |
nr_highlights | Number of highlights stored in a video file | Yes | integer |
mode | Possible values: "normal", "slow_motion", "time_lapse", "highlight" | Yes | string |
resolution | Possible values: "4k", "2.7k", "1080p", "720p", "wvga" | Yes | string |
framerate_fps | Framerate of the recorded video | Yes | integer |
interval_secs | Time interval (in seconds) between taking two consecutive input frames. Valid for time lapse mode. | No | float |
aspect_ratio | Aspect ratio of the video in format "4/3" or "16/9" | Yes | string |
is_valid | Flags is recorded file is valid (true) or corrupt (false). If 'is_valid' flag is set to 'false', values of all other required attributes should not be taken into account since they might (and probably will) contain faulty data. |
Yes | boolean |
number_of_files | Numbers of files within a session. | Yes | integer |
NOTE: If 'is_valid' flag is set to 'false', values of all other required attributes should not be taken into account since they might (and probably will) contain faulty data.
Response codes:
Code | Description |
200 | OK |
400 | Bad Request (sort, order, offset and/or count parameters are out of range) |
500 | Server Error (request can't be processed) |
Example request 1:
GET http://192.168.1.101/api/2/sessions/videos
and example response:
{ "total":2, "items": [ { "path":"/100TTCAM/M0020002.MP4", "id":"7666a33a-6275-4549-836b-4f8d00281233-100-000-002-0001", "created":"2012-03-05T18:34:14Z", "size_bytes":2154637, "length_secs":21.90, "nr_highlights":6, "mode":"normal", "resolution":"1080p", "framerate_fps":60, "aspect_ratio":"16/9", "is_valid":true, "number_of_files":2 }, { "path":"/100TTCAM/M0020005.MP4", "id":"9376a883-6345-2349-966b-2a8d00281980-100-000-002-0002", "created":"2012-03-04T12:05:20Z", "size_bytes":3454637, "length_secs":24.20, "nr_highlights":4, "mode":"normal", "resolution":"720p",  "framerate_fps":60, "aspect_ratio":"16/9", "is_valid":true, "number_of_files":4 } ] }
GET /api/<versionNumber>/sessions/images[?sort=<sort>][&order=<order>][&offset=<offset>][&count=<count>]
Format:
http://<baseURL>/api/<versionNumber>/sessions/images[?sort=<sort>][&order=<order>][&offset=<offset>][&count=<count>]
Example:
http://192.168.1.101/api/2/sessions/images
Parameters:
Parameter 'offset' is 0-based so offset=0 will address the first session from the resource.
'offset' and 'count' are used (based on sort criteria set by 'sort' parameter and 'order') to retrieve image information for 'count' sessions, first starting at specified 'offset' from beginning of a sorted list of sessions. If 'offset' is bigger than total count of sessions, error code will be returned. However, if 'offset' falls into range but 'count' specifies more items than available, this method will return as many sessions as possible and won't return error status code.
The table below describes all of the parameters that can be used in a request. Parameters and values are case-sensitive. Required parameters must be used or the call will fail. Optional parameters, which are highlighted with [square brackets], may be used. If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table.
NOTE: Offset and count works on a session boundaries, rather than file boundaries as it's the case with GET /images.
Parameter | Description | Req'd? | Possible values |
baseURL | Fixed address, Bandit acts like an access point with this addres. TomTom Bandit's WiFi has to be turned on. | Yes | 192.168.1.101 |
versionNumber | Service version number. The current value is 2. | Yes | 2 |
[sort] | Results are sorted by filename (default, in case other parameters are added in the future). | No | filename (default) |
[order] | Results are returned in ascending (default, if parameter is omitted) or descending order if specified differently. | No | asc (default) desc |
[offset] | Defaults to 0 if omitted, otherwise represents 0-based offset targeting the first session from the result list that should be returned in response. | No | 0-based integer offset |
[count] | Defaults to 1 if omitted, otherwise represents maximum number of sessions that should be returned in response. If 'count' is bigger than the remaining number of result session, only remaining session items will be returned. If count is set to 0, response containing only total number of sessions, without any actual item will be returned. |
No | integer number of session items requested |
Description:
Returns array of JSON objects containing information about the first image found in every session. Each JSON object will contain following information:
Parameter | Description | Req'd? | Type |
path | Path to image in format: '/'+<DCIM_folder>+'/'+<filename>. | Yes | string, max. 255 characters |
id | Unique identified of the image file. | Yes | string, max. 49 characters |
created | ISO 8601 UTC format of file's creation time. | Yes | string |
size_bytes | Image file size in bytes. | Yes | integer |
mode | Mode used to record image (look at Capabilities section). | Yes | string |
resolution | Captured image resolution. | Yes | string |
aspect_ratio | Aspect ratio of captured image. | Yes | string |
[lat_deg] | Latitude part of coordinate where image was taken. If it doesn't exist (no GPS fix at the time of shot), this attribute will be omitted from the response. | No | float |
[lon_deg] | Longitude part of coordinate where image was taken. If it doesn't exist (no GPS fix at the time of shot), this attribute will be omitted from the response. | No | float |
is_valid | Flags is recorded file is valid (true) or corrupt (false). If 'is_valid' flag is set to 'false', values of all other required attributes should not be taken into account since they might (and probably will) contain faulty data. |
Yes | boolean |
number_of_files | Numbers of files within a session. | Yes | integer |
NOTE: If 'is_valid' flag is set to 'false', values of all other required attributes should not be taken into account since they might (and probably will) contain faulty data.
Response codes:
Code | Description |
200 | OK |
400 | Bad Request (sort, order, offset and/or count parameters are out of range) |
500 | Server Error (request can't be processed) |
Example request 1:
GET http://192.168.1.101/api/2/sessions/images
and example response:
{ "total":2, "items": [ { "path":"/100TTCAM/IMG_0001.JPG", "id":"7666a33a-6275-4549-836b-4f8d00281233-100-000-002-0001", "created":"2012-03-05T18:34:14Z", "size_bytes":2154637, "mode":"single", "resolution":"16MP", "aspect_ratio":"4/3", "lat_deg":44.715513732021364, "lon_deg":20.63232421875, "is_valid":true, "number_of_files":1 }, { "path":"/100TTCAM/IMG_0002.JPG", "id":"9376a883-6345-2349-966b-2a8d00281980-100-000-002-0002", "created":"2012-03-04T12:05:20Z", "size_bytes":2154637, "mode":"burst", "resolution":"16MP", "aspect_ratio":"4/3", "lat_deg":44.715637, "lon_deg":20.631237, "order":1, "total":10, "is_valid":true, "number_of_files":10 } ] }