Skip to main content
Skip table of contents

Создание группы планoв

Создание группы планов

Создание группы. Создать можно пустую группу без планов

JSON
{
    "name": "MAP GROUP",
    "parent_id": 1,
    "items": [
        1
    ]
}

POST /api/v1/maps/group

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

string name, Название группы


integer parent_id, id родительской группы


array items, Масcив id планов, которые нужно добавить в группу

200 OK

Успешный ответ

JSON
{
    "id": 2,
    "name": "MAP GROUP",
    "has_items": true,
    "has_groups": false,
    "children": null
}

401 Unauthorized

Токен авторизации не передан или не валидный

422 Unprocessable Entity

Возвращает JSON объект с ошибкой.

JSON
{
    "message": "Тут не будет информативного сообщения",
    "errors": {
        "any_key": [
            "Тут будет описана причина ошибки"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/v1/maps/group' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "name": "string",
    "parent_id": "integer",
    "items": []
}'
PHP
PHP
$data = array (
  'name' => 'string',
  'parent_id' => 'integer',
  'items' => 
  array (
  ),
);
$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-domain/api/v1/maps/group', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.