Модель FailedHook — не отправленные хуки
* @property integer $id * @property string $create_date - дата создания * @property string $hook_data - данные запроса * @property string $hook_url - url сервиса * @property string $hook_name - имя хука, обычно совпадает с именем события, которое его вызвало * @property string $error_message - причина неудачи
Выборка хуков
curl --location --request GET 'https://{DOMAIN NAME}/rest/api/FailedHook' \ --header 'Content-Type: application/json' \ --header 'X-REST-API-KEY: {REST API KEY}'
Ответ сервера
{ "success": true, "message": "Records Retrieved Successfully", "data": { "totalCount": "4", "failedHook": [ { "id": "11", "create_date": "2021-09-23 12:12:55", "hook_data":"{\"name\":\"updateTariff\",\"data\":{\"isFree\":0,\"validUntil\":\"2023-08-11\",\"blocked\":\"0\",\"limitUsers\":20,\"lastPaidPeriod\":\"month\",\"tariffName\":\"\К\Л\И\Н\И\К\А +\",\"prolongationType\":\"VETMANAGER\",\"prolongationUsers\":2,\"prolongationPeriod\":\"1 month\",\"dateRegister\":\"2019-07-01 13:40:21\",\"tariffAddons\":{\"asterisk\":1,\"vats\":1,\"voip\":1,\"appointmentWidget\":\"1\",\"restApi\":\"1\",\"doctorSmartPhoneApp\":1,\"idexxIntegration\":\"1\",\"unisenderIntegration\":\"1\",\"pdfScannerIntegration\":\"1\",\"atolIntegration\":\"1\",\"smscenterIntegration\":\"1\",\"vetAcademyIntegration\":1,\"vetKarta\":1,\"royalPrescriptions\":1,\"number_of_users\":\"20\",\"backup_database\":\"0\",\"test1\":\"0\"}},\"params\":{\"dop_param1\":\"1\",\"dop_param2\":\"2\",\"dop_param3\":\"3\"}}", "hook_url": "https://two.localhost:8080/ajax_admission.php", "error_message": "Error in server response: Failed to connect to two. localhost port 8080: Connection refused, with http status: 0", "hook_name": "updateTariff" }, { "id": "19", "create_date": "2021-09-23 12:27:48", "hook_data": "{\"name\":\"goodEdit\",\"data\":{\"id\":\"5380\",\"group_id\":\"65\",\"title\":\"sfsdf\",\"unit_storage_id\":\"5\",\"is_warehouse_account\":\"1\",\"is_active\":\"1\",\"code\":\"\",\"category_id\":null,\"is_call\":\"0\",\"is_for_sale\":\"1\",\"barcode\":\"\",\"create_date\":null,\"description\":\"\",\"prime_cost\":\"0.0000000000\"},\"params\":{\"dop_param1\":\"1\",\"dop_param2\":\"2\",\"dop_param3\":\"3\"}}", "hook_url": "https://one.vetmanager.local:8080/ajax_admission.php", "error_message": "Error in server response: , with http status: 302", "hook_name": "goodEdit" }, { "id": "20", "create_date": "2021-09-23 12:27:57", "hook_data": "{\"name\":\"sessionUpdate\",\"data\":{\"id\":\"20\",\"user_id\":\"1\",\"session_key\":\"3603fa31dec0dad741f54385a2438e72\",\"create_date\":\"2021-09-23 15:11:54\",\"update_date\":\"now()\",\"php_session\":\"tvg7skq55336um4er1p5ahqii4\",\"IP\":\"172.18.0.1\",\"is_support\":\"0\",\"sip_number\":null},\"params\":{\"dop_param1\":\"1\",\"dop_param2\":\"2\",\"dop_param3\":\"3\"}}", "hook_url": "https://one.vetmanager.local:8080/ajax_admission.php", "error_message": "Error in server response: , with http status: 302", "hook_name": "sessionUpdate" }, { "id": "21", "create_date": "2021-09-23 12:28:17", "hook_data": "{\"name\":\"sessionUpdate\",\"data\":{\"id\":\"19\",\"user_id\":\"1\",\"session_key\":\"5f0e923b7f120dd95e286a3700d3c3be\",\"create_date\":\"2021-09-23 13:17:23\",\"update_date\":\"now()\",\"php_session\":\"tvg7skq55336um4er1p5ahqii4\",\"IP\":\"172.18.0.1\",\"is_support\":\"0\",\"sip_number\":null},\"params\":{\"dop_param1\":\"1\",\"dop_param2\":\"2\",\"dop_param3\":\"3\"}}", "hook_url": "https://one.vetmanager.local:8080/ajax_admission.php", "error_message": "Error in server response: , with http status: 302", "hook_name": "sessionUpdate" } ] } }
Чтобы очистить лог упавших хуков, следует для каждого из них выполнить запрос:
curl -X DELETE \ https://xxx.vetmanager.ru/rest/api/FailedHook/$id \ -H 'x-rest-api-key: xxx'
где $id - это ИД FailedHook, который нужно удалить.