Доступ к хукам, которые не удалось отправить



Структура моделей, назначение полей

Модель 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 - причина неудачи

Примеры запросов

Общие сведения о запросах к API

Выборка хуков

curl -i -H "Accept: application/json" -H "X-REST-API-KEY: 0781b4732d3e7a06e8c69f3c4df22987" http://example/rest/api/failedHook

{

   "success": true,
   "message": "Records Retrieved Successfully",
   "data": {
       "totalCount": "7",
       "failedHook": [{
               "id": "1",
               "create_date": "2013-03-18 19:23:01",
               "hook_data": "{\"name\":\"clientEdit\",\"data\":{\"id\":\"5\",\"address\":\"\",\"home_phone\":\"\",\"work_phone\":\"\",\"fax\":\"\",\"note\":\"\",\"type_id\":null,\"how_find\":17,\"balance\":\"0\",\"email\":\"\",\"city\":\"\",\"city_id\":\"251\",\"date_register\":\"2013-03-13 11:01:36\",\"cell_phone\":\"\",\"zip\":\"\",\"registration_index\":null,\"vip\":\"0\",\"last_name\":\"\\u0422\\u0435\\u0441\\u0442\\u043e\\u04321141111\",\"first_name\":\"\\u0422\\u0435\\u0441\\u0442\",\"middle_name\":\"\\u0422\\u0435\\u0441\\u0442\\u043e\\u0432\\u0438\\u0447\",\"status\":\"ACTIVE\",\"discount\":\"0\",\"discount_card\":\"\",\"passport_series\":\"\",\"lab_number\":\"\"},\"params\":{\"dop_param1\":\"1param-test2\",\"dop_param2\":\"2param-test2\",\"dop_param3\":\"\"}}",
               "hook_url": "http:\/\/htest.dz\/test2.php",
               "error_message": "Internal Server Error"
           }, {
               "id": "7",
               "create_date": "2013-03-19 10:19:06",
               "hook_data": "{\"name\":\"admissionAdd\",\"data\":{\"id\":16,\"admission_date\":\"2013-03-28 01:50:00\",\"description\":\"\",\"client_id\":5,\"patient_id\":3,\"user_id\":\"1\",\"type_id\":7,\"admission_length\":\"00:00:00\",\"status\":\"save\"},\"params\":{\"dop_param1\":\"1param-test2\",\"dop_param2\":\"2param-test2\",\"dop_param3\":\"\"}}",
               "hook_url": "http:\/\/htest.dz\/test2.php",
               "error_message": "Operation timed out after 5001 milliseconds with 0 bytes received"
           }
       ]
   }

}