API List Camera Presets

From IVS Wiki
Jump to: navigation, search

This API call retrieves all presets associated with a specific camera.

Resource URL

http://valt.example.com/api/v3/presets/{camera}

Replace {camera} with the ID of the camera.

Resource Information

Method GET
Headers Content-Type: application/json
Response Type JSON
Authentication Required Yes

Parameters

Path Parameters

Parameter Description Example
camera The ID of the camera. 1

Response

Code Reason
200 Success
400 Invalid Request (See Response for Specific Error)
401 Unauthorized
500 Internal Server Error

A successful response returns a JSON array of Preset objects. Each Preset object contains the following fields:

Preset Object Fields
Field Type Description
id int Unique identifier of the preset.
name string The name of the preset.
camera int The ID of the camera the preset belongs to.
data string The PTZ (pan, tilt, zoom) data for the preset, formatted as a query string.

Examples

Request

https://ivstest1.ad.ipivs.com/api/v3/presets/1?access_token=e82632d19c523678fea3d1016c6df9e9

Successful Response

Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks.

[
  {
    "id": 14,
    "name": "preset 1",
    "camera": 1,
    "data": "pan=12.8&tilt=-0.99&zoom=1"
  }
]

Failure Response

Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks.

{
  "error": {
    "code": 500,
    "message": "Internal Server Error"
  }
}