Разрешены запросы:
получение списка вебхуков, получение одного вебхука, создание и обновление данных вебхука
id - ID вебхука title - название (обязательное) value - адрес на вебхук (обязательное) dop_param1 - доп. параметры dop_param2 - доп. параметры dop_param3 - доп. параметры is_active - активирован ли вебхук (по умолчанию “1”)
curl --location 'https://{DOMAIN NAME}/rest/api/webHook' \
--header 'X-REST-API-KEY: {REST API KEY}' \
--header 'Content-Type: text/plain' \
--data '{
"title": "startInvoiceRun",
"value": "someurl",
"dop_param1": "some_parameter"
}'Ответ сервера:
{
"success": true,
"message": "Record(s) Created",
"data": {
"totalCount": 1,
"webHook": [
{
"title": "startInvoiceRun",
"value": "someurl",
"dop_param1": "some_parameter",
"dop_param2": "",
"dop_param3": "",
"is_active": 1,
"id": "232"
}
]
}
}curl --location --request PUT 'https://{DOMAIN NAME}/rest/api/webHook/232' \
--header 'X-REST-API-KEY: {REST API KEY}' \
--header 'Content-Type: text/plain' \
--data '{"is_active": "0"}'{
"success": true,
"message": "Record Updated",
"data": {
"totalCount": 1,
"webHook": [
{
"id": "232",
"title": "startInvoiceRun",
"value": "someurl",
"dop_param1": "some_parameter",
"dop_param2": "",
"dop_param3": "",
"is_active": "0"
}
]
}
}curl --location 'https://{DOMAIN NAME}/rest/api/webHook' \
--header 'X-REST-API-KEY: {REST API KEY}'{
"success": true,
"message": "Records Retrieved Successfully",
"data": {
"totalCount": 22,
"webHook": [
{
"id": "1",
"title": "doSomething",
"value": "someurl",
"dop_param1": "some_parameter",
"dop_param2": "",
"dop_param3": "",
"is_active": "1"
},
***
{
"id": "100",
"title": "startInvoiceRun",
"value": "someurl",
"dop_param1": "some_parameter",
"dop_param2": "",
"dop_param3": "",
"is_active": "0"
}
]
}curl --location --request DELETE 'https://{DOMAIN NAME}/rest/api/webHook/232' \
--header 'X-REST-API-KEY: {REST API KEY}'{
"success": true,
"message": "Record Deleted",
"data": {
"id": "232"
}
}