API Update Camera

From IVS Wiki
Jump to: navigation, search

This API call will update a specified camera.

Resource URL

http://valt.example.com/api/v3/admin/cameras/{cameraid}/edit

Replace {cameraid} with the actual id number of the camera. Cameras are numbered sequentially when added to VALT.

Resource Information

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

Parameters

The JSON body must be properly formatted. All fields and values should be enclosed in double quotes and separated by a colon.

Field Name Description Required Example
name Camera Name yes Camera 1
ip Camera IP address or FQDN. yes 192.168.7.32
camera_type Device Type: Camera or Device (ipad, iphone, card reader) no camera
device_type Device Type: Camera or Device (ipad, iphone, card reader) no camera
http_port Port used for camera control. (Default: 80) no 80
rtsp_port Port used for pulling the video stream from the camera. (Default: 554) no 554
username Username to access the camera. yes root
password Password to access the camera. yes admin51
brand Camera Brand (should be 1) yes 1
model Camera Model Type (should be 1) yes 1
rooms Array of rooms the camera will be assigned to no [37,29]
wowza ID of the media server the camera will be assigned to. yes 1

Response

Code Reason
200 Camera Created Successfully
400 Invalid Request (See Response for Specific Error)
401 Unauthorized
404 Camera ID Not Found
500 JSON Body Formatted Incorrectly
JSON Response
data
id ID number for the new camera.

Examples

Request

The sample JSON body below is formatted with line breaks and indentation to make it easier to read. This is not required.

https://ivstest1.ad.ipivs.com/api/v3/admin/cameras/91/edit?access_token=e82632d19c523678fea3d1016c6df9e9
{
  "name":"API Camera",
  "ip":"192.168.7.2",
  "username":"root",
  "password":"admin51",
  "wowza":1,
  "brand":1,
  "model":1,
  "rooms":[37,43]
}

Successful Response

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

{
"data":{
"id": 91
}
}

Failure Response

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

{
"data":{
"message": "Validation Error",
"fields":[
{
"name": "name",
"message": "This value should not be blank."
}
]
},
"code": 400
}