Skip to main content
Skip table of contents

Oбновление пользователя. VMS Billing API

Обновление пользователя

JSON
{
    "login": "test@mail.com",
    "password": "qweasdzxc",
    "status": "active",
    "billing_info": {
        "billing_id": "123123123",
        "billing_extra": []
    },
    "billing_properties": [
        {
            "type": "phone",
            "value": "+80283289362"
        }
    ],
    "permissions_to_attach": [
        "archives-show",
        "archives-download"
    ],
    "permissions_to_detach": [
        "archives-preview-download"
    ]
}

PATCH /api/v1/billing/user/manage

Параметры метода

string login, Login пользователя


string password, Пароль


string status, Статус пользователя


array billing_info, Дополнительная информация о пользователе получаемая из биллинга


string properties, [value] Значение свойства


array permissions_to_attach, Список имен пермишенов для добавления


array permissions_to_detach, Список имен пермишенов для удаления

200 OK

Возвращает объект пользователя

JSON
{
    "id": 1,
    "login": "test@mail.com",
    "name": null,
    "type": "type_value",
    "status": "active",
    "created_at": "2023-05-02T10:18:50.000000Z",
    "updated_at": "2023-05-02T10:18:50.000000Z",
    "deleted_at": null,
    "can_update_password": false,
    "billing_properties": [
        {
            "type": "phone",
            "value": "+80283289362"
        }
    ]
}

422 Unprocessable Entity

Возвращает JSON объект с ошибкой. Детали в разделе Валидация.

JSON
{
    "message": "Тут не будет информативного сообщения",
    "errors": {
        "any_key": [
            "Тут будет описана причина ошибки"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/v1/billing/user/manage' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "login": "string",
    "password": "string",
    "status": "string",
    "billing_info": [],
    "properties": "string",
    "permissions_to_attach": [],
    "permissions_to_detach": []
}'
PHP
PHP
$data = array (
  'login' => 'string',
  'password' => 'string',
  'status' => 'string',
  'billing_info' => 
  array (
  ),
  'properties' => 'string',
  'permissions_to_attach' => 
  array (
  ),
  'permissions_to_detach' => 
  array (
  ),
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'PATCH',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/billing/user/manage', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.