Creating a temporary user
Creating a temporary user
Creating a temporary user
When creating users with a large number of cameras, it will be necessary to send multiple requests.
In one request, up to 500 cameras can be included.
See the description below in the parameter description.
POST api/admin/v1/special-users |
Method parameters
string
name, name
string
login, unique login among all users
string
password, password
string
password_confirmation, password confirmation to ensure the correct input
array
permissions, array of permission IDs
array
cameras_to_attach, array of camera IDs that will be available to the user. You can send a maximum of 500 items in the request. If you need more, you need to send an Temporary user update request with the remaining cameras immediately after creation
date
expired_at, date until which the temporary user will be active
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' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"name": "string",
"login": "string",
"password": "string",
"password_confirmation": "string",
"permissions": [],
"cameras_to_attach": [],
"expired_at": "date",
"ptz_priority": 0
}'
PHP
$data = array (
'name' => 'string',
'login' => 'string',
'password' => 'string',
'password_confirmation' => 'string',
'permissions' =>
array (
),
'cameras_to_attach' =>
array (
),
'expired_at' => 'date',
'ptz_priority' => 0,
);
$context = stream_context_create([
'ssl'=>['verify_peer' => false],
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/json\r
Accept: application/json",
'content'=>json_encode($data)
]
]);
$result = file_get_contents('https://your-domainapi/admin/v1/special-users', false, $context);