[comment]: # translation:outdated

[comment]: # ({new-2a00571f})
# connector.create

[comment]: # ({/new-2a00571f})

[comment]: # ({abae348f-bad67477})
### Описание

`object connector.create(object/array connectors)`

Этот метод позволяет создавать новые объекты коннектора.

::: noteclassic
Этот метод доступен только пользователю с типом доступа *Супер-администратор*.
Разрешения на вызов метода можно отозвать в настройках ролей пользователя.
Дополнительную информацию см. в разделе [Роли пользователей](/manual/web_interface/frontend_sections/users/user_roles).
:::

[comment]: # ({/abae348f-bad67477})

[comment]: # ({new-98722c06})
### Parameters

`(object/array)` Connector objects to create.

Additionally to the [standard connector properties](object#connector), the method accepts the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data_types)|Description|
|--|--|------|
|tags|array|Connector [tag filter](/manual/api/reference/connector/object#tag-filter).|

[comment]: # ({/new-98722c06})

[comment]: # ({new-a513e07e})
### Return values

`(object)` Returns an object containing the IDs of the created connectors under the `connectorids` property.
The order of the returned IDs matches the order of the passed connectors.

[comment]: # ({/new-a513e07e})

[comment]: # ({41c52ba7-983d5841})
### Примеры

[comment]: # ({/41c52ba7-983d5841})

[comment]: # ({88c51e60-5936d90d})
#### Создание соединителя

Создайте соединитель для экспорта событий триггера с фильтром тегов. HTTP-аутентификация будет выполняться с использованием токена Bearer.

[Запрос](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "connector.create",
    "params": [
        {
            "name": "Export of events",
            "data_type": 1,
            "url": "{$DATA_EXPORT_URL}",
            "authtype": 5,
            "token": "{$DATA_EXPORT_BEARER_TOKEN}",
            "tags": [
                {
                    "tag": "service",
                    "operator": 0,
                    "value": "mysqld"
                }
            ]
        }
    ],
    "id": 1
}
```

Ответ:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "connectorid": [
            "3"
        ]
    },
    "id": 1
}
```

[comment]: # ({/88c51e60-5936d90d})

[comment]: # ({af9876f9-6550862d})
### Источник

CConnector::create() в *ui/include/classes/api/services/CConnector.php*.

[comment]: # ({/af9876f9-6550862d})
