WebHook

最新更新:2023-03-14

邮件状态回调

URL

用户 web 页面自定义填写
          用户 web 页面自定义填写

        
此代码块在浮窗中显示

Content-Type:

application/json; charset=utf-8
          application/json; charset=utf-8

        
此代码块在浮窗中显示

HTTP 请求方式

post
          post

        
此代码块在浮窗中显示

请求 Headers

Header Type Required Description
Authorization String true 签名

请求 Body

参数 类型 说明
message_id string 消息 id
to string 收件人 (target 消息中为空)
server string email
itime long 消息产生时间戳
custom_args json 客户自定义字段
status json 消息状态回调

注意:
签名算法:以用户 app key 为加密密钥对时间戳 itime 进行 HmacSHA256 运算,得到十六进制字符。

邮件 target 状态消息

status

参数 类型 说明
message_status string target
status_data json object 状态数据
message string successfully request
task_id int 任务 id
api_user string api user
tos array 收信人数组
email_ids array 收信人 email id 数组
label_id int 标签 id
{ "server": "email", "message_id": "1676615711309_104117_18546_8821.sc-10_43_7_16-inbound", "itime": 1676615711325, "status": { "message_status": "target", "status_data": { "email_ids": [ "1676615711309_104117_18546_8821.sc-10_43_7_16-inbound0$12345@hotmail.com" ], "tos": [ "12345@hotmail.com" ], "task_id": "-1", "api_user": "scgp_email_system_trigger", "message": "successfully request", "label_id": 0 } } }
          {
    "server": "email", 
    "message_id": "1676615711309_104117_18546_8821.sc-10_43_7_16-inbound", 
    "itime": 1676615711325, 
    "status": {
        "message_status": "target", 
        "status_data": {
            "email_ids": [
                "1676615711309_104117_18546_8821.sc-10_43_7_16-inbound0$12345@hotmail.com"
            ], 
            "tos": [
                "12345@hotmail.com"
            ], 
            "task_id": "-1", 
            "api_user": "scgp_email_system_trigger", 
            "message": "successfully request", 
            "label_id": 0
        }
    }
}

        
此代码块在浮窗中显示

邮件 sent 状态消息

status

参数 类型 说明
message_status string sent
status_data json object 状态数据
message string Successfully sent
task_id int 任务 id
api_user string api user
email_id string 邮件 id
label_id int 标签 id
{ "server": "email", "message_id": "1676615711309_104117_18546_8821.sc-10_43_7_16-inbound0$12345@hotmail.com", "to": "12345@hotmail.com", "itime": 1676615714397, "status": { "message_status": "sent", "status_data": { "email_id": "1676615711309_104117_18546_8821.sc-10_43_7_16-inbound0$12345@hotmail.com", "task_id": "-1", "api_user": "scgp_email_system_trigger", "message": "successfully sent", "label_id": 0 } } }
          {
    "server": "email", 
    "message_id": "1676615711309_104117_18546_8821.sc-10_43_7_16-inbound0$12345@hotmail.com", 
    "to": "12345@hotmail.com", 
    "itime": 1676615714397, 
    "status": {
        "message_status": "sent", 
        "status_data": {
            "email_id": "1676615711309_104117_18546_8821.sc-10_43_7_16-inbound0$12345@hotmail.com", 
            "task_id": "-1", 
            "api_user": "scgp_email_system_trigger", 
            "message": "successfully sent", 
            "label_id": 0
        }
    }
}

        
此代码块在浮窗中显示

邮件 delivered 状态消息

status

参数 类型 说明
message_status string delivered
status_data json object 状态数据
message string successfully delivered
task_id int 任务 id
api_user string api user
email_id string 邮件 id
label_id int 标签 id
{ "server": "email", "message_id": "1675758375681_15_6393_8309.sc-10_2_226_96-test0$12345@gmail.com", "to": "12345@gmail.com", "itime": 1675758376586, "status": { "message_status": "delivered", "status_data": { "email_id": "1675758375681_15_6393_8309.sc-10_2_226_96-test0$12345@gmail.com", "task_id": "-1", "api_user": "1224_xjm", "message": "successfully delivered", "label_id": 0 } } }
          {
    "server": "email", 
    "message_id": "1675758375681_15_6393_8309.sc-10_2_226_96-test0$12345@gmail.com", 
    "to": "12345@gmail.com", 
    "itime": 1675758376586, 
    "status": {
        "message_status": "delivered", 
        "status_data": {
            "email_id": "1675758375681_15_6393_8309.sc-10_2_226_96-test0$12345@gmail.com", 
            "task_id": "-1", 
            "api_user": "1224_xjm", 
            "message": "successfully delivered", 
            "label_id": 0
        }
    }
}

        
此代码块在浮窗中显示

邮件 delivered_failed 状态消息

status

参数 类型 说明
message_status string delivered_failed
status_data json object 状态数据
task_id int 任务 id
api_user string api user
email_id string 邮件 id
label_id int 标签 id
error_code int 错误代码
error_detail json 错误明细
message string 邮箱返回日志
sub_stat int 错误子类,4xx 表示 大类为无效邮件 5XX 表示大类为软退信
sub_stat_desc string 错误分类
{ "server": "email", "message_id": "1676537131885_95_4921_8644.sc-10_2_226_96-test0$12345@gmail.com", "to": "12345@gmail.com", "itime": 1676537132783, "status": { "message_status": "delivered_failed", "error_code": 409, "error_detail": { "sub_stat": 409, "message": "Domain may not exist or DNS check failed [MF99jssew+U8hyLhCJdZwkffXOKzGzvvQq5UZaSZR1BIotz1+sUrL6gFET3lJu6KdQ== IP: 8.219.236.47].", "sub_stat_desc": "Other" }, "status_data": { "email_id": "1676537131885_95_4921_8644.sc-10_2_226_96-test0$12345@gmail.com", "task_id": "-1", "api_user": "postmaster@sendcloud.io", "label_id": 0 } } }
          {
    "server": "email", 
    "message_id": "1676537131885_95_4921_8644.sc-10_2_226_96-test0$12345@gmail.com", 
    "to": "12345@gmail.com", 
    "itime": 1676537132783, 
    "status": {
        "message_status": "delivered_failed", 
        "error_code": 409, 
        "error_detail": {
            "sub_stat": 409, 
            "message": "Domain may not exist or DNS check failed [MF99jssew+U8hyLhCJdZwkffXOKzGzvvQq5UZaSZR1BIotz1+sUrL6gFET3lJu6KdQ== IP: 8.219.236.47].", 
            "sub_stat_desc": "Other"
        }, 
        "status_data": {
            "email_id": "1676537131885_95_4921_8644.sc-10_2_226_96-test0$12345@gmail.com", 
            "task_id": "-1", 
            "api_user": "postmaster@sendcloud.io", 
            "label_id": 0
        }
    }
}

        
此代码块在浮窗中显示

邮件 open 状态消息

status

参数 类型 说明
message_status string open
status_data json object 状态数据
message string open email
task_id int 任务 id
api_user string api user
email_id string 邮件 id
label_id int 标签 id
{ "server": "email", "message_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", "to": "12345@hotmail.com", "itime": 1676618644458, "status": { "message_status": "open", "status_data": { "email_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", "task_id": "0", "api_user": "JGgkm3wedVik_test_y1mQMX", "message": "open email", "label_id": 0 } } }
          {
    "server": "email", 
    "message_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", 
    "to": "12345@hotmail.com", 
    "itime": 1676618644458, 
    "status": {
        "message_status": "open", 
        "status_data": {
            "email_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", 
            "task_id": "0", 
            "api_user": "JGgkm3wedVik_test_y1mQMX", 
            "message": "open email", 
            "label_id": 0
        }
    }
}

        
此代码块在浮窗中显示

邮件 click 状态消息

status

参数 类型 说明
message_status string click
status_data json object 状态数据
message string click email
task_id int 任务 id
api_user string api user
email_id string 邮件 id
label_id int 标签 id
{ "server": "email", "message_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", "to": "12345@hotmail.com", "itime": 1676618644458, "status": { "message_status": "click", "status_data": { "email_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", "task_id": "0", "api_user": "JGgkm3wedVik_test_y1mQMX", "message": "click email", "label_id": 0 } } }
          {
    "server": "email", 
    "message_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", 
    "to": "12345@hotmail.com", 
    "itime": 1676618644458, 
    "status": {
        "message_status": "click", 
        "status_data": {
            "email_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", 
            "task_id": "0", 
            "api_user": "JGgkm3wedVik_test_y1mQMX", 
            "message": "click email", 
            "label_id": 0
        }
    }
}

        
此代码块在浮窗中显示

邮件响应回调

URL

用户自定义
          用户自定义

        
此代码块在浮窗中显示

Content-Type:

application/json; charset=utf-8
          application/json; charset=utf-8

        
此代码块在浮窗中显示

HTTP 请求方式

post
          post

        
此代码块在浮窗中显示

请求 Headers

Header Type Required Description
Authorization String true 签名

请求 Body

参数 类型 说明
message_id string 消息 id
to string 收信人
server string email
itime long 消息产生时间戳
custom_args json 客户自定义字段
response json 消息响应回调

注意:
签名算法:以用户 api key 为加密密钥对时间戳 itime 进行 HmacSHA256 运算,得到十六进制字符。

邮件取消订阅响应消息

response

参数 类型 说明
event string unsubscribe
response_data json object 响应数据
message string unsubscribe email
task_id int 任务 id
api_user string api user
email_id string 邮件 id
label_id int 标签 id
ip string 操作 IP
explorer_name string 浏览器名称
explorer_ver string 浏览器版本
os_name string 操作系统名称
os_ver string 操作系统版本
{ "server": "email", "message_id": "1676460128030_100669_28018_8253.sg-10_1_253_26-inbound86$12345@gmail.com", "to": "12345@gmail.com", "itime": 1676623616503, "response": { "event": "unsubscribe", "response_data": { "email_id": "1676460128030_100669_28018_8253.sg-10_1_253_26-inbound86$12345@gmail.com", "explorer_ver": "16.2", "os_ver": "16.2", "explorer_name": "Mobile Safari", "ip": "80.14.210.102", "os_name": "iOS", "task_id": "0", "api_user": "1224_xjm", "message": "unsubscribe email", "label_id": 221223 } } }
          {
    "server": "email", 
    "message_id": "1676460128030_100669_28018_8253.sg-10_1_253_26-inbound86$12345@gmail.com", 
    "to": "12345@gmail.com", 
    "itime": 1676623616503, 
    "response": {
        "event": "unsubscribe", 
        "response_data": {
            "email_id": "1676460128030_100669_28018_8253.sg-10_1_253_26-inbound86$12345@gmail.com", 
            "explorer_ver": "16.2", 
            "os_ver": "16.2", 
            "explorer_name": "Mobile Safari", 
            "ip": "80.14.210.102", 
            "os_name": "iOS", 
            "task_id": "0", 
            "api_user": "1224_xjm", 
            "message": "unsubscribe email", 
            "label_id": 221223
        }
    }
}

        
此代码块在浮窗中显示

邮件垃圾举报响应消息

response

参数 类型 说明
event string report_spam
response_data json object 响应数据
api_user string api user
email_id string 邮件 id
label_id int 标签 id
{ "server": "email", "message_id": "1676857822846_15_23558_89.sg-10_1_253_26-inbound0$12345@gmail.com", "to": "12345@gmail.com", "itime": 1677548340323, "response": { "event": "report_spam", "response_data": { "email_id": "1676857822846_15_23558_89.sg-10_1_253_26-inbound0$1406064670@gmail.com", "api_user": "huangli", "label_id": 0 } } }
          {
    "server": "email", 
    "message_id": "1676857822846_15_23558_89.sg-10_1_253_26-inbound0$12345@gmail.com", 
    "to": "12345@gmail.com", 
    "itime": 1677548340323, 
    "response": {
        "event": "report_spam", 
        "response_data": {
            "email_id": "1676857822846_15_23558_89.sg-10_1_253_26-inbound0$1406064670@gmail.com", 
            "api_user": "huangli", 
            "label_id": 0
        }
    }
}

        
此代码块在浮窗中显示

邮件 open 响应消息

response

参数 类型 说明
event string open
response_data json object 响应数据
message string open email
task_id int 任务 id
api_user string api user
email_id string 邮件 id
label_id int 标签 id
ip string 操作 IP
explorer_name string 浏览器名称
explorer_ver string 浏览器版本
os_name string 操作系统名称
os_ver string 操作系统版本
{ "server": "email", "message_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", "to": "12345@hotmail.com", "itime": 1676620370426, "response": { "event": "open", "response_data": { "email_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", "explorer_ver": "101.0.4951", "os_ver": "8", "explorer_name": "Chrome", "ip": "8.219.124.204", "os_name": "Windows", "task_id": "0", "api_user": "JGgkm3wedVik_test_y1mQMX", "message": "open email", "label_id": 0 } } }
          {
    "server": "email", 
    "message_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", 
    "to": "12345@hotmail.com", 
    "itime": 1676620370426, 
    "response": {
        "event": "open", 
        "response_data": {
            "email_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", 
            "explorer_ver": "101.0.4951", 
            "os_ver": "8", 
            "explorer_name": "Chrome", 
            "ip": "8.219.124.204", 
            "os_name": "Windows", 
            "task_id": "0", 
            "api_user": "JGgkm3wedVik_test_y1mQMX", 
            "message": "open email", 
            "label_id": 0
        }
    }
}

        
此代码块在浮窗中显示

邮件 click 响应消息

response

参数 类型 说明
event string click
response_data json object 响应数据
message string click email
task_id int 任务 id
api_user string api user
email_id string 邮件 id
label_id int 标签 id
url string 点击 url
ip string 操作 IP
explorer_name string 浏览器名称
explorer_ver string 浏览器版本
os_name string 操作系统名称
os_ver string 操作系统版本
{ "server": "email", "message_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", "to": "12345@hotmail.com", "itime": 1676620370426, "response": { "event": "click", "response_data": { "email_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", "explorer_ver": "101.0.4951", "os_ver": "8", "explorer_name": "Chrome", "ip": "8.219.124.204", "url": "https://www.engagelab.com/zh_CN/email/", "os_name": "Windows", "task_id": "0", "api_user": "JGgkm3wedVik_test_y1mQMX", "message": "click email", "label_id": 0 } } }
          {
    "server": "email", 
    "message_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", 
    "to": "12345@hotmail.com", 
    "itime": 1676620370426, 
    "response": {
        "event": "click", 
        "response_data": {
            "email_id": "1676618583015_104117_18546_8822.sc-10_43_7_16-inbound0$12345@hotmail.com", 
            "explorer_ver": "101.0.4951", 
            "os_ver": "8", 
            "explorer_name": "Chrome", 
            "ip": "8.219.124.204", 
            "url": "https://www.engagelab.com/zh_CN/email/", 
            "os_name": "Windows", 
            "task_id": "0", 
            "api_user": "JGgkm3wedVik_test_y1mQMX", 
            "message": "click email", 
            "label_id": 0
        }
    }
}

        
此代码块在浮窗中显示

邮件转信响应消息

response

参数 类型 说明
event string route
response_data json object 响应数据
message string mx route
html string 邮件 html 原文
text string 邮件 plain 原文
headers string 转信邮件 header
from_name string 发信人名称
subject string 邮件主题
from string 发信人地址
reference string reference
email_id string 邮件 id
raw_message string 邮件原文
raw_message_url string 邮件原文下载地址
x_mx_mailfrom string x_mx_mailfrom
x_mx_rcptto string x_mx_rcptto
{ "server": "email", "message_id": "01b6f68b-da52-4f6f-a049-68d0ca01dd8c", "to": "Goblin <12345@gmail.com>;Illidan <12345@hotmail.com>", "itime": 1676618346192, "response": { "event": "route", "response_data": { "headers": { "Cc": "Malfurion <12345@gmail.com>", "To": "Goblin <12345@gmail.com>", "Content-Type": "multipart/alternative; boundary=\"00000000000092f9ca05f4e02010\"", "From": "Archimonde <12345@outlook.com>", "MIME-Version": "1.0", "Date": "Fri, 17 Feb 2023 12:48:48 +0530", "Subject": "Re: Work plan for next month" }, "raw_message": "Received: from MAIL-ED1-F51.GOOGLE.COM (unknown [209.85.208.51]) by mx2.sendcloud.org with SMTP ......", "subject": "Re: Work plan for next month", "x_mx_rcptto": "12345@icloud.com", "html": "<div dir=\"ltr\">Hi Team,<div><br></div><div>Let's start ......", "from": "Archimonde <12345@outlook.com>", "text": "Hi Team,Let's start ......", "x_mx_mailfrom": "12345@hotmail.com", "message": "mx route", "from_name": "Sargeras", "raw_message_url": "https://......eml" } } }
          {
    "server": "email", 
    "message_id": "01b6f68b-da52-4f6f-a049-68d0ca01dd8c", 
    "to": "Goblin <12345@gmail.com>;Illidan <12345@hotmail.com>", 
    "itime": 1676618346192, 
    "response": {
        "event": "route", 
        "response_data": {
            "headers": {
                "Cc": "Malfurion <12345@gmail.com>", 
                "To": "Goblin <12345@gmail.com>", 
                "Content-Type": "multipart/alternative; boundary=\"00000000000092f9ca05f4e02010\"", 
                "From": "Archimonde <12345@outlook.com>", 
                "MIME-Version": "1.0", 
                "Date": "Fri, 17 Feb 2023 12:48:48 +0530", 
                "Subject": "Re: Work plan for next month"
            }, 
            "raw_message": "Received: from MAIL-ED1-F51.GOOGLE.COM (unknown [209.85.208.51])
    by mx2.sendcloud.org with SMTP ......", 
            "subject": "Re: Work plan for next month", 
            "x_mx_rcptto": "12345@icloud.com", 
            "html": "<div dir=\"ltr\">Hi Team,<div><br></div><div>Let's start ......", 
            "from": "Archimonde <12345@outlook.com>", 
            "text": "Hi Team,Let's start ......", 
            "x_mx_mailfrom": "12345@hotmail.com", 
            "message": "mx route", 
            "from_name": "Sargeras", 
            "raw_message_url": "https://......eml"
        }
    }
}

        
此代码块在浮窗中显示
在文档中心打开