Temporary user update
Temporary user update
When updating users, the parameters cameras_to_attach and cameras_to_detach should only be sent when something has changed, and only the camera IDs that have been added or removed at the moment should be included. When adding or removing a large number of cameras, multiple requests will be required because a single request can only contain up to 500 cameras.
PUT api/admin/v1/special-users/{user} |
Method parameters
int
user, unique identifier of the temporary user
string
name, name
string
login, unique login among other administrators
string
password, password
string
password_confirmation, re-enter the password to ensure it is entered correctly
array
permissions, array of permission IDs
array
cameras_to_attach, array of camera IDs to be added to the user. Maximum 500 elements
array
cameras_to_detach, array of camera IDs to be removed from the user. Maximum 500 elements
date
expired_at, date until which the temporary user will be valid
int
ptz_priority, PTZ priority
200 |
Returns the temporary user object
JSON
|
401 |
Authorization token is not provided or is invalid |
402 |
Exceeded the license limit for the selected analytics case |
422 |
Returns a JSON object with an error. Validation
JSON
|
cURL
curl -k --request POST \
--url 'https://your-domainapi/admin/v1/special-users/{user}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"user": 0,
"name": "string",
"login": "string",
"password": "string",
"password_confirmation": "string",
"permissions": [],
"cameras_to_attach": [],
"cameras_to_detach": [],
"expired_at": "date",
"ptz_priority": 0
}'
PHP
$data = array (
'user' => 0,
'name' => 'string',
'login' => 'string',
'password' => 'string',
'password_confirmation' => 'string',
'permissions' =>
array (
),
'cameras_to_attach' =>
array (
),
'cameras_to_detach' =>
array (
),
'expired_at' => 'date',
'ptz_priority' => 0,
);
$context = stream_context_create([
'ssl'=>['verify_peer' => false],
'http' => [
'method' => 'PUT',
'header' => "Content-Type: application/json\r
Accept: application/json",
'content'=>json_encode($data)
]
]);
$result = file_get_contents('https://your-domainapi/admin/v1/special-users/{user}', false, $context);