# WebHook
Webhook is a mechanism for sendcloud to asynchronously push the data of customers' attention to certain events to the customer's callback URL
You can use API to query, add, update and delete callback URL
# Query
URL
https://api2.sendcloud.net/api/webhook/list
1
HTTP Request Method
post get
1
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
url | string | no | callback URL |
categoryName | string | no | Associated API_ USER |
event | string | no | Event types, such as more than 1 and 3, are separated by commas. Do not fill in all by default |
Event Parameter Description
event | Description | Trigger condition |
---|---|---|
1 | Delivered | email is successfully sent |
3 | report_spam | user reports email as a spam |
4 | Invalid) | email delivery failed |
5 | Soft Bounce) | email is rejected by recipient |
10 | Click | user clicks link |
11 | Open | user opens email |
12 | Unsubcribes | user unsubscribes email |
18 | Request | email is successfully requested |
# Add
URL
https://api2.sendcloud.net/api/webhook/add
1
HTTP Request Method
post get
1
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
url | string | no | callback URL |
categoryName | string | yes | Associated API_ USER |
event | string | no | Event types, such as more than 1 and 3, are separated by commas. Do not fill in all by default |
# Update
URL
https://api2.sendcloud.net/api/webhook/update
1
HTTP Request Method
post get
1
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
url | string | no | callback URL |
categoryName | string | yes | API_USER or all |
event | string | yes | Event types, such as more than 1 and 3, are separated by commas |
newCategoryName | string | * | new API_USER |
newUrl | string | no | new callback URL |
newEvent | string | no | new event value |
Tips:
1.only one of apiuser, event and URL can be modified, and none of them can be null.
1
# delete
URL
https://api2.sendcloud.net/api/webhook/delete
1
HTTP Request Method
post get
1
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
url | string | no | callback URL |
categoryName | string | yes | API_USER or all |
event | string | yes | Event types, such as more than 1 and 3, are separated by commas |
Request Example
http://api.sendcloud.net/apiv2/webhook/list?apiUser=***&apiKey=***
1
Parameter description of general events
parameter | event | Trigger condition |
---|---|---|
1 | delivered(deliver) | Email sent successfully |
3 | spam-reporting(report_spam) | User report email |
4 | invalid email(invalid) | The message was not sent successfully |
5 | Soft Bounce(soft_bounce) | The recipient rejects the message |
10 | click(Click) | User clicks link |
11 | Open(Open) | User open mail |
12 | unsubscribe(unsubscribe) | User unsubscribe email |
18 | request(request) | Mail request succeeded |
Returned Value Example
{
"result": true,
"statusCode": 200,
"message": "success",
"info": {
"dataList": [
{
"webhookUrl": "http://qxxx.com",
"eventTypeMap": {
"11": "open"
},
"categoryName": "jianglian_test"
},
{
"webhookUrl": "http://sina12345.com",
"eventTypeMap": {
"11": "open"
},
"categoryName": "all"
},
{
"webhookUrl": "http://hhh.com",
"eventTypeMap": {
"1": "deliver",
"3": "report_spam",
"4": "invalid",
"5": "soft_bounce",
"10": "open",
"11": "click",
"12": "unsubscribe",
"18": "request"
},
"categoryName": "jianglian_test"
},
{
"webhookUrl": "http://wbw888.com",
"eventTypeMap": {
"18": "request"
},
"categoryName": "all"
},
{
"webhookUrl": "http://hh123.com",
"eventTypeMap": {
"18": "request"
},
"categoryName": "all"
},
{
"webhookUrl": "http://sina1234.com",
"eventTypeMap": {
"4": "invalid"
},
"categoryName": "jianglian_test"
}
],
"count": 6
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59