Difference between revisions of "API Create User Group"

From IVS Wiki
Jump to: navigation, search
(Created page with "This API call will create a new user group. ===Resource URL=== <pre>http://valt.example.com/api/v3/admin/user_groups</pre> ===Resource Information=== {|class="wikitable" |''...")
 
(No difference)

Latest revision as of 13:23, 14 April 2020

This API call will create a new user group.

Resource URL

http://valt.example.com/api/v3/admin/user_groups

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 yes Staff
template yes {"marker":"2","information":"1"}
marker ID number for default marker template yes 2
information ID number for default information template yes 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
JSON Response
data
id ID number for the new 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?access_token=e82632d19c523678fea3d1016c6df9e9
{
"name":"API Group 16",
"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.

{
"data":{
"message": "Validation Error",
"fields":[
{
"name": "marker",
"message": "Invalid template ID"
},
{
"name": "information",
"message": "Invalid template ID"
}
]
},
"code": 400
}