# WebhooksApi All URIs are relative to *https://api.moysklad.ru/api/remap/1.2* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**createOrUpdateWebhooksBatch**](WebhooksApi.md#createOrUpdateWebhooksBatch) | **POST** /entity/webhook/batch | Массовое создание и обновление вебхуков | | [**createWebhook**](WebhooksApi.md#createWebhook) | **POST** /entity/webhook | Создать вебхук | | [**deleteWebhook**](WebhooksApi.md#deleteWebhook) | **DELETE** /entity/webhook/{id} | Удалить вебхук | | [**deleteWebhooksBatch**](WebhooksApi.md#deleteWebhooksBatch) | **POST** /entity/webhook/delete | Массовое удаление вебхуков | | [**getWebhookById**](WebhooksApi.md#getWebhookById) | **GET** /entity/webhook/{id} | Получить вебхук по ID | | [**getWebhooks**](WebhooksApi.md#getWebhooks) | **GET** /entity/webhook | Получить список вебхуков | | [**updateWebhook**](WebhooksApi.md#updateWebhook) | **PUT** /entity/webhook/{id} | Изменить вебхук | ## createOrUpdateWebhooksBatch > List<BatchResponseEntity> createOrUpdateWebhooksBatch(webhook, expand, accept, acceptEncoding, contentType) Массовое создание и обновление вебхуков Массовое создание и обновление вебхуков. Обновляемые вебхуки должны содержать идентификатор в виде метаданных. ### Example ```java // Import classes: import ru.moysklad.remap_1_2.ApiClient; import ru.moysklad.remap_1_2.ApiException; import ru.moysklad.remap_1_2.Configuration; import ru.moysklad.remap_1_2.auth.*; import ru.moysklad.remap_1_2.models.*; import ru.moysklad.remap_1_2.api.WebhooksApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.moysklad.ru/api/remap/1.2"); // Configure HTTP basic authorization: basicAuth HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); basicAuth.setUsername("YOUR USERNAME"); basicAuth.setPassword("YOUR PASSWORD"); // Configure HTTP bearer authorization: bearerAuth HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); bearerAuth.setBearerToken("BEARER TOKEN"); WebhooksApi apiInstance = new WebhooksApi(defaultClient); List webhook = Arrays.asList(); // List | String expand = "expand_example"; // String | Замена ссылок объектами с помощью expand String accept = "application/json"; // String | String acceptEncoding = "gzip, deflate, br"; // String | String contentType = "application/json"; // String | try { List result = apiInstance.createOrUpdateWebhooksBatch(webhook, expand, accept, acceptEncoding, contentType); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#createOrUpdateWebhooksBatch"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ### Parameters | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **webhook** | [**List<Webhook>**](Webhook.md)| | | | **expand** | **String**| Замена ссылок объектами с помощью expand | [optional] | | **accept** | **String**| | [optional] [default to application/json;charset=utf-8] [enum: application/json, application/json;charset=utf-8] | | **acceptEncoding** | **String**| | [optional] [default to gzip, deflate, br] | | **contentType** | **String**| | [optional] [default to application/json] [enum: application/json] | ### Return type [**List<BatchResponseEntity>**](BatchResponseEntity.md) ### Authorization [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json, text/html;charset=UTF-8 ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | Вебхуки созданы или изменены (элемент — сущность или объект ошибки) | - | | **0** | Ошибка запроса (тело — объект с полем errors) | - | ## createWebhook > Webhook createWebhook(webhook, expand, accept, acceptEncoding, contentType) Создать вебхук Создание вебхука. Сочетание entityType, action, url должно быть уникальным. ### Example ```java // Import classes: import ru.moysklad.remap_1_2.ApiClient; import ru.moysklad.remap_1_2.ApiException; import ru.moysklad.remap_1_2.Configuration; import ru.moysklad.remap_1_2.auth.*; import ru.moysklad.remap_1_2.models.*; import ru.moysklad.remap_1_2.api.WebhooksApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.moysklad.ru/api/remap/1.2"); // Configure HTTP basic authorization: basicAuth HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); basicAuth.setUsername("YOUR USERNAME"); basicAuth.setPassword("YOUR PASSWORD"); // Configure HTTP bearer authorization: bearerAuth HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); bearerAuth.setBearerToken("BEARER TOKEN"); WebhooksApi apiInstance = new WebhooksApi(defaultClient); Webhook webhook = new Webhook(); // Webhook | String expand = "expand_example"; // String | Замена ссылок объектами с помощью expand String accept = "application/json"; // String | String acceptEncoding = "gzip, deflate, br"; // String | String contentType = "application/json"; // String | try { Webhook result = apiInstance.createWebhook(webhook, expand, accept, acceptEncoding, contentType); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#createWebhook"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ### Parameters | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **webhook** | [**Webhook**](Webhook.md)| | | | **expand** | **String**| Замена ссылок объектами с помощью expand | [optional] | | **accept** | **String**| | [optional] [default to application/json;charset=utf-8] [enum: application/json, application/json;charset=utf-8] | | **acceptEncoding** | **String**| | [optional] [default to gzip, deflate, br] | | **contentType** | **String**| | [optional] [default to application/json] [enum: application/json] | ### Return type [**Webhook**](Webhook.md) ### Authorization [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json, text/html;charset=UTF-8 ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | Вебхук успешно создан | - | | **0** | Ошибка запроса (тело — объект с полем errors) | - | ## deleteWebhook > deleteWebhook(id, accept, acceptEncoding) Удалить вебхук Удаление вебхука с указанным id ### Example ```java // Import classes: import ru.moysklad.remap_1_2.ApiClient; import ru.moysklad.remap_1_2.ApiException; import ru.moysklad.remap_1_2.Configuration; import ru.moysklad.remap_1_2.auth.*; import ru.moysklad.remap_1_2.models.*; import ru.moysklad.remap_1_2.api.WebhooksApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.moysklad.ru/api/remap/1.2"); // Configure HTTP basic authorization: basicAuth HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); basicAuth.setUsername("YOUR USERNAME"); basicAuth.setPassword("YOUR PASSWORD"); // Configure HTTP bearer authorization: bearerAuth HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); bearerAuth.setBearerToken("BEARER TOKEN"); WebhooksApi apiInstance = new WebhooksApi(defaultClient); UUID id = UUID.randomUUID(); // UUID | ID сущности String accept = "application/json"; // String | String acceptEncoding = "gzip, deflate, br"; // String | try { apiInstance.deleteWebhook(id, accept, acceptEncoding); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#deleteWebhook"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ### Parameters | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **id** | **UUID**| ID сущности | | | **accept** | **String**| | [optional] [default to application/json;charset=utf-8] [enum: application/json, application/json;charset=utf-8] | | **acceptEncoding** | **String**| | [optional] [default to gzip, deflate, br] | ### Return type null (empty response body) ### Authorization [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json, text/html;charset=UTF-8 ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | Вебхук успешно удален | - | | **0** | Ошибка запроса (тело — объект с полем errors) | - | ## deleteWebhooksBatch > List<DeleteRowResult> deleteWebhooksBatch(webhook, accept, acceptEncoding, contentType) Массовое удаление вебхуков Массовое удаление вебхуков по массиву метаданных ### Example ```java // Import classes: import ru.moysklad.remap_1_2.ApiClient; import ru.moysklad.remap_1_2.ApiException; import ru.moysklad.remap_1_2.Configuration; import ru.moysklad.remap_1_2.auth.*; import ru.moysklad.remap_1_2.models.*; import ru.moysklad.remap_1_2.api.WebhooksApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.moysklad.ru/api/remap/1.2"); // Configure HTTP basic authorization: basicAuth HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); basicAuth.setUsername("YOUR USERNAME"); basicAuth.setPassword("YOUR PASSWORD"); // Configure HTTP bearer authorization: bearerAuth HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); bearerAuth.setBearerToken("BEARER TOKEN"); WebhooksApi apiInstance = new WebhooksApi(defaultClient); List webhook = Arrays.asList(); // List | String accept = "application/json"; // String | String acceptEncoding = "gzip, deflate, br"; // String | String contentType = "application/json"; // String | try { List result = apiInstance.deleteWebhooksBatch(webhook, accept, acceptEncoding, contentType); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#deleteWebhooksBatch"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ### Parameters | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **webhook** | [**List<Webhook>**](Webhook.md)| | | | **accept** | **String**| | [optional] [default to application/json;charset=utf-8] [enum: application/json, application/json;charset=utf-8] | | **acceptEncoding** | **String**| | [optional] [default to gzip, deflate, br] | | **contentType** | **String**| | [optional] [default to application/json] [enum: application/json] | ### Return type [**List<DeleteRowResult>**](DeleteRowResult.md) ### Authorization [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json, text/html;charset=UTF-8 ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | Результат по каждому элементу (успех или объект ошибки) | - | | **0** | Ошибка запроса (тело — объект с полем errors) | - | ## getWebhookById > Webhook getWebhookById(id, expand, accept, acceptEncoding) Получить вебхук по ID Запрос на получение отдельного вебхука с указанным id ### Example ```java // Import classes: import ru.moysklad.remap_1_2.ApiClient; import ru.moysklad.remap_1_2.ApiException; import ru.moysklad.remap_1_2.Configuration; import ru.moysklad.remap_1_2.auth.*; import ru.moysklad.remap_1_2.models.*; import ru.moysklad.remap_1_2.api.WebhooksApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.moysklad.ru/api/remap/1.2"); // Configure HTTP basic authorization: basicAuth HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); basicAuth.setUsername("YOUR USERNAME"); basicAuth.setPassword("YOUR PASSWORD"); // Configure HTTP bearer authorization: bearerAuth HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); bearerAuth.setBearerToken("BEARER TOKEN"); WebhooksApi apiInstance = new WebhooksApi(defaultClient); UUID id = UUID.randomUUID(); // UUID | ID сущности String expand = "expand_example"; // String | Замена ссылок объектами с помощью expand String accept = "application/json"; // String | String acceptEncoding = "gzip, deflate, br"; // String | try { Webhook result = apiInstance.getWebhookById(id, expand, accept, acceptEncoding); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#getWebhookById"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ### Parameters | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **id** | **UUID**| ID сущности | | | **expand** | **String**| Замена ссылок объектами с помощью expand | [optional] | | **accept** | **String**| | [optional] [default to application/json;charset=utf-8] [enum: application/json, application/json;charset=utf-8] | | **acceptEncoding** | **String**| | [optional] [default to gzip, deflate, br] | ### Return type [**Webhook**](Webhook.md) ### Authorization [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json, text/html;charset=UTF-8 ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | Успешный запрос | - | | **0** | Ошибка запроса (тело — объект с полем errors) | - | ## getWebhooks > WebhookList getWebhooks(limit, offset, search, filter, expand, order, accept, acceptEncoding) Получить список вебхуков Запрос на получение всех вебхуков на данной учетной записи ### Example ```java // Import classes: import ru.moysklad.remap_1_2.ApiClient; import ru.moysklad.remap_1_2.ApiException; import ru.moysklad.remap_1_2.Configuration; import ru.moysklad.remap_1_2.auth.*; import ru.moysklad.remap_1_2.models.*; import ru.moysklad.remap_1_2.api.WebhooksApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.moysklad.ru/api/remap/1.2"); // Configure HTTP basic authorization: basicAuth HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); basicAuth.setUsername("YOUR USERNAME"); basicAuth.setPassword("YOUR PASSWORD"); // Configure HTTP bearer authorization: bearerAuth HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); bearerAuth.setBearerToken("BEARER TOKEN"); WebhooksApi apiInstance = new WebhooksApi(defaultClient); Integer limit = 1000; // Integer | Максимальное количество элементов в выданном списке (максимум 1000) Integer offset = 0; // Integer | Отступ в выданном списке String search = "search_example"; // String | Контекстный поиск по строковым полям сущностей String filter = "filter_example"; // String | Фильтрация выборки String expand = "expand_example"; // String | Замена ссылок объектами с помощью expand String order = "order_example"; // String | Сортировка String accept = "application/json"; // String | String acceptEncoding = "gzip, deflate, br"; // String | try { WebhookList result = apiInstance.getWebhooks(limit, offset, search, filter, expand, order, accept, acceptEncoding); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#getWebhooks"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ### Parameters | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **limit** | **Integer**| Максимальное количество элементов в выданном списке (максимум 1000) | [optional] [default to 1000] | | **offset** | **Integer**| Отступ в выданном списке | [optional] [default to 0] | | **search** | **String**| Контекстный поиск по строковым полям сущностей | [optional] | | **filter** | **String**| Фильтрация выборки | [optional] | | **expand** | **String**| Замена ссылок объектами с помощью expand | [optional] | | **order** | **String**| Сортировка | [optional] | | **accept** | **String**| | [optional] [default to application/json;charset=utf-8] [enum: application/json, application/json;charset=utf-8] | | **acceptEncoding** | **String**| | [optional] [default to gzip, deflate, br] | ### Return type [**WebhookList**](WebhookList.md) ### Authorization [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json, text/html;charset=UTF-8 ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | Успешный запрос | - | | **0** | Ошибка запроса (тело — объект с полем errors) | - | ## updateWebhook > Webhook updateWebhook(id, webhook, expand, accept, acceptEncoding, contentType) Изменить вебхук Изменение сведений о вебхуке (включая отключение через enabled) ### Example ```java // Import classes: import ru.moysklad.remap_1_2.ApiClient; import ru.moysklad.remap_1_2.ApiException; import ru.moysklad.remap_1_2.Configuration; import ru.moysklad.remap_1_2.auth.*; import ru.moysklad.remap_1_2.models.*; import ru.moysklad.remap_1_2.api.WebhooksApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.moysklad.ru/api/remap/1.2"); // Configure HTTP basic authorization: basicAuth HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth"); basicAuth.setUsername("YOUR USERNAME"); basicAuth.setPassword("YOUR PASSWORD"); // Configure HTTP bearer authorization: bearerAuth HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); bearerAuth.setBearerToken("BEARER TOKEN"); WebhooksApi apiInstance = new WebhooksApi(defaultClient); UUID id = UUID.randomUUID(); // UUID | ID сущности Webhook webhook = new Webhook(); // Webhook | String expand = "expand_example"; // String | Замена ссылок объектами с помощью expand String accept = "application/json"; // String | String acceptEncoding = "gzip, deflate, br"; // String | String contentType = "application/json"; // String | try { Webhook result = apiInstance.updateWebhook(id, webhook, expand, accept, acceptEncoding, contentType); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling WebhooksApi#updateWebhook"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ### Parameters | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **id** | **UUID**| ID сущности | | | **webhook** | [**Webhook**](Webhook.md)| | | | **expand** | **String**| Замена ссылок объектами с помощью expand | [optional] | | **accept** | **String**| | [optional] [default to application/json;charset=utf-8] [enum: application/json, application/json;charset=utf-8] | | **acceptEncoding** | **String**| | [optional] [default to gzip, deflate, br] | | **contentType** | **String**| | [optional] [default to application/json] [enum: application/json] | ### Return type [**Webhook**](Webhook.md) ### Authorization [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json, text/html;charset=UTF-8 ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | Вебхук успешно изменен | - | | **0** | Ошибка запроса (тело — объект с полем errors) | - |