The Get Media, or Public Safety, API returns a list of assets deployed within a bounding box (bbox) that you define with GPS coordinates.
Note: APIs for streaming media are identified as future enhancements using the following URI:
<production url>/v1/assets/{id}/live-media?mediat-types=<media type>&locationid={id}
METHOD |
GET |
Request URI |
<production url/v1/assets/{id}/media?media-types=IMAGE (start-ts,end-ts,size,page) |
Sample Request URI |
<production url/v1/assets/1000000018/media?media-types=IMAGE&start-ts=1453832741281&end-ts=1453832741281&size=1&page=1 |
Query Parameters
Parameter |
Description |
Required? |
Filter Values |
start-ts |
Start time (timestamp) recorded in EPOCH format. |
|
Numerical value, such as 1453766605577. |
end-ts |
End time (timestamp) recorded in EPOCH format. |
|
Numerical value, such as 1453772603879. |
id |
GE identifier for the media device. |
|
Identifier, such as 1000000018. |
media-type |
Filter by type of media. |
No |
Insert one of the following enumeration codes for a specific media type.- IMAGE
- If you filter by IMAGE, you receive a list of images in in JPG, PNG, or GIF formats.
- VIDEO
- If you filter by VIDEO, you receive a list of videos in MP4 format.
- AUDIO
- If you filter by AUDIO, you receive a list of audio files in MP3 or WAV format.
- OTHERS
- If you filtered by OTHERS, you receive a list of non-standard formats.
|
size |
Maximum number of records to return per page. If none is specified, the default is used automatically. |
No |
Numerical value. |
page |
Indicates the page number. Default is 1 |
No |
Numerical value. |
Response Parameters
Parameter |
Data Type |
Required? |
Description |
media |
Array |
Yes |
List, by media type. |
media-type |
String |
Yes |
Media output. - IMAGE
- If you filtered by IMAGE, you receive a list of images in in JPG, PNG, or GIF formats.
- VIDEO
- If you filtered by VIDEO, you receive a list of on-demand videos in MP4 format.
- AUDIO
- If you filtered by AUDIO, you receive a list of audio files in MP3 or WAV format.
- OTHERS
- If you filtered by OTHERS, you receive a list of non-standard formats.
|
timestamp |
Number |
Yes |
Timestamp recorded in EPOCH format. |
size |
String |
Yes |
Media file size. |
unit |
String |
Yes |
Media file size unit of measure (such as megabytes). |
url |
String |
Yes |
Link to the stored media file in its captured format (for example, JPEG, PNG, MP4, MP3). |
Sample Response
{
"_embedded": {
"medias": [
{
"url": "http://ie-media-service-dev.run.aws-usw02-pr.ice.predix.io/media/file/1000000022_1457390757339_IMAGE",
"timestamp": 1457390757339,
"device-id": "HYP1040-75",
"media-type": "IMAGE",
"asset-id": "1000000022"
},
{
"url": "http://ie-media-service-dev.run.aws-usw02-pr.ice.predix.io/media/file/1000000022_1457390784372_IMAGE",
"timestamp": 1457390784372,
"device-id": "HYP1040-75",
"media-type": "IMAGE",
"asset-id": "1000000022"
}
]
},
"_links": {
"first": {
"href": "http://ie-parking-dev.run.aws-usw02-pr.ice.predix.io/v1/assets/1000000022/media?media-types=IMAGE,AUDIO&start-ts=0&end-ts=1758118140000&page=0&size=2"
},
"self": {
"href": "http://ie-parking-dev.run.aws-usw02-pr.ice.predix.io/v1/assets/1000000022/media?media-types=IMAGE,AUDIO&start-ts=0&end-ts=1758118140000&page=0&size=2"
},
"next": {
"href": "http://ie-parking-dev.run.aws-usw02-pr.ice.predix.io/v1/assets/1000000022/media?media-types=IMAGE,AUDIO&start-ts=0&end-ts=1758118140000&page=1&size=2"
},
"last": {
"href": "http://ie-parking-dev.run.aws-usw02-pr.ice.predix.io/v1/assets/1000000022/media?media-types=IMAGE,AUDIO&start-ts=0&end-ts=1758118140000&page=19&size=2"
}
},
"page": {
"size": 2,
"totalElements": 40,
"totalPages": 20,
"number": 0
}
}