API Update User Group

From IVS Wiki
Jump to: navigation, search

This API call will update an existing user group.

Resource URL

http://valt.example.com/api/v3/admin/user_groups/{groupid}/edit

Replace {groupid} with the actual id number of the group. Groups 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 Group Name no Staff
template no {"marker":"2","information":"1"}
marker ID number for default marker template no 2
information ID number for default information template no 1
max_record_duration Maximum duration for recordings created by users in the new group. no 180
rooms Array of rooms the new group will have access to. no [1,4,7]
video_access no {"users":[15],"user_groups":[1]}
users Array of user ids who's videos the new group will have access to. no [17,39,84]
user_groups Array of user group ids who's videos the new group will have access to. no [1,3,17]
retention no {"type":"days","for":6}
type Retention Type (Valid Values: infinitely, until, days, hours, minutes) no until
until Date videos will be retained until. no 06-01-2020
for Number of hours, days, or minutes videos will be retained for. no 180
rights Array of rights and subrights names no ["general",

"general--home",

"general--alert",

"general--edit-profile",

"general--password-complexity",

"general--change-password",

"general--notifications"]

Response

Code Reason
200 Request Successful
400 Invalid Request (See Response for Specific Error)
401 Unauthorized
404 User Group Not Found
JSON Response
data
id ID number for the updated group.

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/user_groups/8/edit?access_token=e82632d19c523678fea3d1016c6df9e9
{
"name":"New API Group 1",
"template":{
  "marker":2,
  "information":1
	},
"max_record_duration": 180,
  "rooms":[37,39,40],
  "video_access":{
    "users":[15],
    "user_groups":[1]
  },
  "retention":{
    "type":"days",
    "for":6
  },
  "rights":["general","general--home","general--alert","general--edit-profile","general--password-complexity","general--change-password","general--notifications"]
}

Successful Response

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

{
"data":{
"id": 8
}
}

Failure Response

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

{
"error":{
"code": 404
}
}