Запрос:
GET /admin/webhooks.xml
Ответ:
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<webhooks type="array">
<webhook>
<id type="integer">830</id>
<address>http://application.ru/orders/create</address>
<created-at type="datetime">2010-07-29T18:17:45+04:00</created-at>
<topic>orders/create</topic>
</webhook>
<webhook>
<id type="integer">831</id>
<address>http://application.ru/orders/create</address>
<created-at type="datetime">2010-07-29T18:17:45+04:00</created-at>
<topic>orders/update</topic>
</webhook>
</webhooks>
Запрос:
GET /admin/webhooks/#{id}.xml
Ответ:
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<webhook>
<id type="integer">831</id>
<address>http://application.ru/orders/create</address>
<created-at type="datetime">2010-07-29T18:17:45+04:00</created-at>
<topic>orders/update</topic>
</webhook>
Доступны значения для topic orders/create и orders/update.
Запрос:
POST /admin/webhooks.xml
<webhook>
<address>http://application.ru/orders/update</address>
<topic>orders/update</topic>
</webhook>
Ответ:
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<webhook>
<id type="integer">831</id>
<address>http://application.ru/orders/create</address>
<created-at type="datetime">2010-07-29T18:17:45+04:00</created-at>
<topic>orders/update</topic>
</webhook>
Запрос:
DELETE /admin/webhooks/#{id}.xml
Ответ:
HTTP/1.1 200 OK