API Update Room

From IVS Wiki
Revision as of 13:51, 14 April 2020 by IVSWikiBlue (talk | contribs) (Created page with "This API call will update an existing new room. ===Resource URL=== <pre>http://valt.example.com/api/v3/admin/rooms/{roomid}/edit</pre> ''Replace {roomid} with the actual id n...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This API call will update an existing new room.

Resource URL

http://valt.example.com/api/v3/admin/rooms/{roomid}/edit

Replace {roomid} with the actual id number of the room. Rooms 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 Room Name yes Room 174
is_io Enable IO control of room (true = enabled, false = disabled) no false
io_camera_id Camera ID number for IO control. no 63
io_user_id User ID number that IO recordings should be assigned to. no 47

Response

Code Reason
200 Room Created Successfully
400 Invalid Request (See Response for Specific Error)
401 Unauthorized
500 JSON Body Formatted Incorrectly
JSON Response
data
id ID number for the updated room.

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/rooms/69/edit?access_token=e82632d19c523678fea3d1016c6df9e9
{
  "name":"API Test 4",
  "is_io":true,
  "io_camera_id":63,
  "io_user_id":47
}

Successful Response

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

{
"data":{
"id": 68
}
}

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
}