API Update User
Revision as of 13:24, 14 April 2020 by IVSWikiBlue (talk | contribs) (Created page with "This API call will update an existing user group. ===Resource URL=== <pre>http://valt.example.com/api/v3/admin/users/{userid}/edit</pre> ''Replace {userid} with the actual i...")
This API call will update an existing user group.
Contents
Resource URL
http://valt.example.com/api/v3/admin/users/{userid}/edit
Replace {userid} with the actual id number of the user. Users 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 | User Name | no | John | |||
| password | User Name | no | VALTisGR3@T | |||
| display_name | If populated will display instead of the user name. | no | John Doe | |||
| user_group | Primary group ID for the new user. | no | 7 | |||
| card_number | RFID Card Number or PIN Code for Keypad | no | 362504 | |||
| 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] | |||
Response
| Code | Reason |
|---|---|
| 200 | Update Successful |
| 401 | Unauthorized |
| 404 | User ID does not exist. |
| data | |
|---|---|
| id | ID number for the updated user. |
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/users/52/edit?access_token=e82632d19c523678fea3d1016c6df9e9
{
"name":"jdoe3",
"password":"apiuser",
"display_name":"John Doe",
"user_group":1,
"card_number":"32650",
"rooms":[37,39,43],
"video_access":
{
"users":[15],
"user_groups":[1]
}
}
Successful Response
Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks.
{
"data":{
"id": 48
}
}
Failure Response
Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks.
{
"error":{
"code": 404
}
}