Laravel Forge JavaScript SDK

Webhooks

Webhooks

Create a webhook

Method

forge.webhooks.create(server_id, site_id, payload)

Usage

1const forge = new Forge('API_TOKEN');
2
3const webhook = await forge.webhooks.create(server_id, site_id, payload);

Payload

1{
2 url: 'https://domain.com';
3}

Example Response

1{
2 "url": "https://domain.com"
3}

List all webhooks

Method

forge.webhooks.list(server_id, site_id)

Usage

1const forge = new Forge('API_TOKEN');
2
3const webhooks = await forge.webhooks.list(server_id, site_id);

Example Response

1{
2 "webhooks": [
3 {
4 "id": 10,
5 "url": "http://domain.com",
6 "created_at": "2018-10-10 17:01:18"
7 }
8 ]
9}

Get a webhook

Method

forge.webhooks.get(server_id, site_id, webhook_id)

Usage

1const forge = new Forge('API_TOKEN');
2
3const webhook = await forge.webhooks.get(server_id, site_id, webhook_id);

Example Response

1{
2 "webhook": {
3 "id": 10,
4 "url": "http://domain.com",
5 "created_at": "2018-10-10 17:01:18"
6 }
7}

Delete a webhook

Method

forge.webhooks.delete(server_id, site_id, webhook_id)

Usage

1const forge = new Forge('API_TOKEN');
2
3await forge.webhooks.delete(server_id, site_id, webhook_id);

Edit this page on GitHub