See Web Hook documentation for information about web hooks.
GET
http://api.cratejoy.com/v1/hooks/
PUT
http://api.cratejoy.com/v1/hooks/{hook_id}/
POST
https://api.cratejoy.com/v1/hooks/
DELETE
https://api.cratejoy.com/v1/hooks/{hook_id}/
List hooks
GET
https://api.cratejoy.com/v1/hooks/
$.get("https://api.cratejoy.com/v1/hooks");
{
"count": 1,
"next": "?page=1",
"prev": null,
"results": [
{
"created_at": "Fri, 18 Sep 2015 14:14:30 GMT",
"enabled": true,
"event": "customer_new",
"id": 75572246,
"name": "Test hook",
"querystring": null,
"request_type": "get",
"store_id": 4848355,
"target": "https://my.website.com/new_customer",
"type": "hook",
"url": "/v1/hooks/75572246/"
}
]
}
Update a hook
PUT
https://api.cratejoy.com/v1/hooks/{hook_id}/
$.ajax({
method: 'PUT',
url: 'https://api.cratejoy.com/v1/hooks/75572246/',
data: {"target": "http://my.newsite.com/"},
contentType: 'application/json'
});
See the Web Hook documentation for a complete list of writeable properties.
#Create a new webhook
POST
https://api.cratejoy.com/v1/hooks/
$.post("https://api.cratejoy.com/v1/hooks/",{
"name":"Test hook",
"target":"https://my.website.com/new_customer",
"request_type": "GET",
"event": "customer_new"
});
See the Web Hook documentation for a complete list of writeable properties.