Skip to content

Commit 858cbc5

Browse files
authored
DE-1784: Account Webhooks - Add docs (#392)
Signed-off-by: Alex Lebedev <6421109+alex-leb@users.noreply.github.com>
1 parent d6ac8a0 commit 858cbc5

3 files changed

Lines changed: 57 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ This SDK includes the following components:
186186
- [Opt-In Handler](docs/OptInHandler.md)
187187
- [Domains](docs/Domains.md)
188188
- [Webhooks](docs/Webhooks.md)
189+
- [Account Webhooks](docs/AccountWebhooks.md)
189190
- [Events](docs/Events.md)
190191
- [Snippets](docs/Snippets.md)
191192
- [Subaccounts](docs/Subaccounts.md)

docs/AccountWebhooks.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Mailgun - Account Webhooks
2+
====================
3+
4+
This is the Mailgun Ruby *Account Webhook* utilities.
5+
6+
The below assumes you've already installed the Mailgun Ruby SDK in to your
7+
project. If not, go back to the master README for instructions.
8+
9+
Usage - Account Webhooks
10+
-----------------------
11+
12+
```ruby
13+
# First, instantiate the Mailgun Client with your API key
14+
mg_client = Mailgun::Client.new('your-api-key')
15+
hook = Mailgun::AccountWebhooks.new(mg_client)
16+
17+
```
18+
19+
Account Webhooks methods:
20+
21+
```ruby
22+
# List account-level webhooks
23+
hook.list
24+
hook.list('id1, id2')
25+
26+
# Create an account-level webhook
27+
hook.create(
28+
description: 'desc',
29+
event_types: 'accepted',
30+
url: 'https://the.webhook.url/'
31+
)
32+
33+
# Delete account-level webhooks
34+
hook.remove(all: true)
35+
hook.remove('id1, id2')
36+
37+
# Get account-level webhook by ID
38+
hook.get('id1')
39+
40+
# Update an account-level webhook
41+
hook.update(
42+
'hook',
43+
description: 'desc',
44+
event_types: 'accepted',
45+
url: 'https://the.webhook.url/'
46+
)
47+
48+
# Delete account-level webhook by ID
49+
hook.remove_by_id('id1')
50+
```
51+
52+
More Documentation
53+
------------------
54+
See the official [Mailgun Account Webhooks Docs](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-webhooks)
55+
for more information

docs/Webhooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ hook.remove_all 'my.perfect.domain'
3838

3939
More Documentation
4040
------------------
41-
See the official [Mailgun Domain Docs](https://documentation.mailgun.com/en/latest/api-webhooks.html)
41+
See the official [Mailgun Webhooks Docs](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-webhooks)
4242
for more information

0 commit comments

Comments
 (0)