WebHook Management

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://api.sendcloud.net/apiv2/webhook/list

HTTP Request Method

post    get

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

Add

URL

https://api.sendcloud.net/apiv2/webhook/add

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
apiUser string yes API_USER
apiKey string yes API_KEY
url string yes callback URL
categoryName string API_USER or all
event string yes Event types, such as more than 1 and 3, are separated by commas

Update

URL

https://api.sendcloud.net/apiv2/webhook/update

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
apiUser string yes API_USER
apiKey string yes API_KEY
url string yes callback URL
categoryName string yes API_USER or all
event string no Event types, such as more than 1 and 3, are separated by commas. Do not fill in all by default
newCategoryName string * new API_USER
newUrl string * new callback URL
newEvent string * new event value

Tipes:

  1. * only one of apiuser, event and URL can be modified, and none of them can be null.

delete

URL

https://api.sendcloud.net/apiv2/webhook/delete

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
apiUser string yes API_USER
apiKey string yes API_KEY
url string yes 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

https://api.sendcloud.net/apiv2/webhook/list?apiUser=***&apiKey=***

General return value description

parameter description
eventTypeMap Event collection list
categoryName apiUser
webhookUrl callback URL

Parameter description of general events

parameter event Trigger condition
1 送达(Delivered) Email sent successfully
3 垃圾邮件举报(report_spam) User report email
4 无效邮件(Invalid) The message was not sent successfully
5 软退信(Soft Bounce) The recipient rejects the message
10 点击(Click) User clicks link
11 打开(Open) User open mail
12 取消订阅(Unsubcribes) User unsubscribe email
18 请求(Request) Mail request succeeded

Returned Value Example

{
    "result": true,
    "statusCode": 200,
    "message": "请求成功",
    "info": {
        "dataList": [
            {
                "webhookUrl": "http://qxxx.com",
                "eventTypeMap": {
                    "11": "打开"
                },
                "categoryName": "jianglian_test"
            },
            {
                "webhookUrl": "http://sina12345.com",
                "eventTypeMap": {
                    "11": "打开"
                },
                "categoryName": "all"
            },
            {
                "webhookUrl": "http://hhh.com",
                "eventTypeMap": {
                    "1": "发送",
                    "3": "垃圾邮件举报",
                    "4": "无效邮件",
                    "5": "退信",
                    "10": "点击",
                    "11": "打开",
                    "12": "取消订阅",
                    "18": "请求"
                },
                "categoryName": "jianglian_test"
            },
            {
                "webhookUrl": "http://wbw888.com",
                "eventTypeMap": {
                    "18": "请求"
                },
                "categoryName": "all"
            },
            {
                "webhookUrl": "http://hh123.com",
                "eventTypeMap": {
                    "18": "请求"
                },
                "categoryName": "all"
            },
            {
                "webhookUrl": "http://sina1234.com",
                "eventTypeMap": {
                    "4": "无效邮件"
                },
                "categoryName": "jianglian_test"
            }
        ],
        "count": 6
    }
}