Surenotify API Documentation
API Endpoint
https://mail.surenotifyapi.comOverview ¶
Newsleopard’s Surenotify Transactional API allows developers to send system-triggered notifications via Email or SMS — such as account activation emails, password reset emails, abandoned cart reminders, SMS delivery notifications, and SMS verification codes — delivering a more real-time customer service experience. Surenotify is divided into four main parts:
-
Email Sending Service
-
Analytics Tracking Service
-
Sending Status Verification Service
-
Email Sender Authentication Configuration or SMS Dedicated Number Configuration
For usage instructions for each API, please refer to the respective sections. If you have any questions, please feel free to contact us.
-
Email: service@newsleopard.tw
-
Customer Service Hours: Monday to Friday 09:30-12:00 / 13:30-18:00
Authentication
-
When connecting to the API, you must include authentication information in the request header:
key value x-api-keyYour API Key -
If the authentication information is missing or the API key is incorrect, the following will be returned:
{"message": "Forbidden"} -
How to apply for an API KEY?
- Step 1: Register for a Newsleopard account.
- Step 2: Send an email to service@newsleopard.tw with the subject
Request for Surenotify Test API KEYand include yourregistered account. You will be notified by email upon activation.
Variable Usage
Description
Use the variables field of each recipient to achieve personalized content.
Email Example
The following is an example of an account activation email:
<html>
<body>
<h2>Hello, {{account}},</h2>
<div>Please click the button below to complete Email verification. After verification, you can return to the original page to continue.</div>
<a href="https://api-sample.newsleopard.com/account/activation?id={{systemId}}&signature={{signature}}">Verify Email Address</a>
</body>
</html>
Assume the email is sent to Alice and Bob respectively using the request example below:
{
"subject": "{{nickname}}, come activate your Newsleopard account",
"fromName": "Newsleopard Team",
"fromAddress": "no-replay@example.com",
"content": "<html> <body> <h2>Hello, {{account}},</h2> <div>Please click the button below to complete Email verification. After verification, you can return to the original page to continue.</div> <a href=\"https://api-sample.newsleopard.com/account/activation?id={{systemId}}&signature={{signature}}\">Verify Email Address</a> </body> </html>",
"unsubscribedLink": "https://links.to.your.unsubscribe.link",
"recipients": [
{
"name": "bob",
"address": "bob@gmail.com",
"variables": {
"nickname": "Mr.B",
"account": "bob@gmail.com",
"systemId": "1234-56-78-9012",
"signature": "Ym9iQGdtYWlsLmNvbQ=="
}
},
{
"name": "alice",
"address": "alice@hotmail.com",
"variables": {
"nickname": "Alice",
"account": "alice@hotmail.com",
"systemId": "9012-34-56-7890",
"signature": "YWxpY2VAaG90bWFpbC5jb20="
}
}
]
}
Alice will receive an email with the subject Alice, come activate your Newsleopard account
The email body text will be replaced with Hello, alice@hotmail.com, Please click the button below to complete Email verification. After verification, you can return to the original page to continue.
The verification link in the email will be replaced by the system. When Alice clicks it, she will be redirected to https://api-sample.newsleopard.com/account/activation?id=9012-34-56-7890&signature=YWxpY2VAaG90bWFpbC5jb20%3D
Similarly, Bob will receive an email with the subject Mr.B, come activate your Newsleopard account
The email body text will be replaced with Hello, bob@gmail.com, Please click the button below to complete Email verification. After verification, you can return to the original page to continue.
The verification link in the email will be replaced by the system. When Bob clicks it, he will be redirected to https://api-sample.newsleopard.com/account/activation?id=1234-56-78-9012&signature=Ym9iQGdtYWlsLmNvbQ%3D%3D
Note
Please note that variable names cannot contain special characters, for example: {{#subject}}
SMS Example
The following is an example of a delivery notification:
Dear {{nickname}}, your package has arrived. Please bring two forms of ID to pick it up. Your pickup number is: {{number}}
Assume the SMS is sent to Alice and Bob respectively using the request example below:
{
"content": "Dear {{NAME}}, your package has arrived. Please bring two forms of ID to pick it up. Your pickup number is: {{NUMBER}}",
"recipients": [
{
"address": "0912345678",
"country_code": "886",
"variables": {
"nickname": "Alice",
"number": "Xa98eG",
}
},
{
"address": "0987654321",
"country_code": "886",
"variables": {
"nickname": "Bob",
"number": "YY09dq",
}
}
]
}
Alice will receive: Dear Alice, your package has arrived. Please bring two forms of ID to pick it up. Your pickup number is: Xa98eG
Bob will receive: Dear Bob, your package has arrived. Please bring two forms of ID to pick it up. Your pickup number is: YY09dq
SMS Supported Regions
| Region | Country Code | Country Name | Country Name (Chinese) |
|---|---|---|---|
| Asia | 60 | Malaysia | 馬來西亞 |
| Asia | 62 | Indonesia | 印尼 |
| Asia | 63 | Philippines | 菲律賓 |
| Asia | 65 | Singapore | 新加坡 |
| Asia | 66 | Thailand | 泰國 |
| Asia | 670 | Timor Leste | 東帝汶 |
| Asia | 673 | Brunei | 汶萊 |
| Asia | 7 | Russia | 俄羅斯 |
| Asia | 77 | Kazakhstan | 哈薩克 |
| Asia | 81 | Japan | 日本 |
| Asia | 82 | Korea | 韓國 |
| Asia | 84 | Vietnam | 越南 |
| Asia | 852 | Hong Kong | 香港 |
| Asia | 853 | Macau | 澳門 |
| Asia | 855 | Cambodia | 柬埔寨 |
| Asia | 856 | Laos | 寮國 |
| Asia | 86 | China | 大陸 |
| Asia | 880 | Bangladesh | 孟加拉 |
| Asia | 90 | Turkey | 土耳其 |
| Asia | 91 | India | 印度 |
| Asia | 92 | Pakistan | 巴基斯坦 |
| Asia | 93 | Afghanistan | 阿富汗 |
| Asia | 94 | Sri Lanka | 斯里蘭卡 |
| Asia | 95 | Myanma | 緬甸 |
| Asia | 961 | Lebanon | 黎巴嫩 |
| Asia | 962 | Jordan | 約旦 |
| Asia | 963 | Syria | 敘利亞 |
| Asia | 964 | Iraq | 伊拉克 |
| Asia | 965 | Kuwait | 科威特 |
| Asia | 966 | Saudi Arabia | 沙烏地阿拉伯 |
| Asia | 967 | Yemen | 葉門 |
| Asia | 968 | Oman | 阿曼 |
| Asia | 970 | Palestine | 巴勒斯坦 |
| Asia | 971 | UAE | 阿拉伯聯合大公國 |
| Asia | 972 | Israel | 以色列 |
| Asia | 973 | Bahrain | 巴林 |
| Asia | 974 | Qatar | 卡達 |
| Asia | 975 | Bhutan | 不丹 |
| Asia | 976 | Mongolia | 蒙古 |
| Asia | 977 | Nepal | 尼泊爾 |
| Asia | 98 | Iran | 伊朗 |
| Asia | 992 | Tajikistan | 坦吉克 |
| Asia | 993 | Turkmenistan | 土庫曼 |
| Asia | 996 | Kyrgyzstan | 吉爾吉斯坦 |
| Oceania | 61 | Australia | 澳大利亞 |
| Oceania | 64 | New Zealand | 紐西蘭 |
| Oceania | 674 | Nauru | 諾魯 |
| Oceania | 675 | Papua New Guinea | 巴布亞紐幾內亞 |
| Oceania | 676 | Tonga | 東加王國 |
| Oceania | 677 | Solomon Islands | 索羅門群島 |
| Oceania | 678 | Vanuatu | 萬那度 |
| Oceania | 679 | Fiji | 斐濟 |
| Oceania | 680 | Republic of Palau | 帛琉 |
| Oceania | 682 | Cook Islands | 庫克群島 |
| Oceania | 685 | Samoa | 薩摩亞 |
| Oceania | 686 | Kiribati | 吉里巴斯共和國 |
| Oceania | 687 | New Caledonia | 法屬新喀里多尼亞 |
| Oceania | 689 | French Polynesia | 法屬波里尼西亞 |
| Oceania | 960 | Maldives | 馬爾地夫 |
| Europe | 30 | Greece | 希臘 |
| Europe | 31 | Netherlands | 荷蘭 |
| Europe | 32 | Belgium | 比利時 |
| Europe | 33 | France | 法國 |
| Europe | 34 | Spain | 西班牙 |
| Europe | 350 | Gibraltar | 直布羅陀 |
| Europe | 351 | Portugal | 葡萄牙 |
| Europe | 352 | Luxembourg | 盧森堡 |
| Europe | 353 | Ireland | 愛爾蘭 |
| Europe | 354 | Iceland | 冰島 |
| Europe | 356 | Malta | 馬爾他 |
| Europe | 357 | Cyprus | 賽普勒斯 |
| Europe | 358 | Finland | 芬蘭 |
| Europe | 359 | Bulgaria | 保加利亞 |
| Europe | 36 | Hungary | 匈牙利 |
| Europe | 370 | Lithuania | 立陶宛 |
| Europe | 371 | Latvia | 拉脫維亞 |
| Europe | 372 | Estonia | 愛沙尼亞 |
| Europe | 373 | Moldova | 摩爾多瓦 |
| Europe | 374 | Armenia | 亞美尼亞 |
| Europe | 375 | Belarus | 白俄羅斯 |
| Europe | 377 | Kosovo | 柯索沃/摩納哥 |
| Europe | 380 | Ukraine | 烏克蘭 |
| Europe | 381 | Serbia | 賽爾維亞 |
| Europe | 382 | Montenegro | 蒙特內哥羅 |
| Europe | 385 | Croatia | 克羅埃西亞共和國 |
| Europe | 386 | Slovenia | 斯洛維尼亞 |
| Europe | 387 | Bosnia and Herzegovina | 波士尼亞赫塞哥維納 |
| Europe | 389 | Macedonia | 馬其頓共和國 |
| Europe | 39 | Italy | 義大利 |
| Europe | 40 | Romania | 羅馬尼亞 |
| Europe | 41 | Switzerland | 瑞士 |
| Europe | 420 | Czech | 捷克 |
| Europe | 421 | Slovakia | 斯洛伐克 |
| Europe | 423 | Liechtenstein | 列支敦斯登 |
| Europe | 43 | Austria | 奧地利 |
| Europe | 44 | UK | 英國 |
| Europe | 45 | Denmark | 丹麥 |
| Europe | 46 | Sweden | 瑞典 |
| Europe | 47 | Norway | 挪威 |
| Europe | 48 | Poland | 波蘭 |
| Europe | 49 | Germany | 德國 |
| Europe | 599 | Netherlands Antilles | 荷屬安地列斯 |
| Europe | 882 | Norway Maritime | 挪威船舶 |
| Europe | 994 | Azerbaijan | 亞賽拜然 |
| Europe | 995 | Georgia | 喬治亞 |
| Europe | 998 | Uzbekistan | 烏茲別克斯坦 |
| Americas | 1 | USA | 美國 |
| Americas | 11 | Canada | 加拿大 |
| Americas | 1242 | Bahamas | 巴哈馬 |
| Americas | 124625 | Barbados | 巴貝多 |
| Americas | 126447 | Anguilla | 英屬安圭拉島 |
| Americas | 126876 | Antigua & Barbud | 安地卡及巴布達 |
| Americas | 128454 | British Virgin Islands | 英屬處女島 |
| Americas | 134599 | Cayman Islands | 英屬開曼群島 |
| Americas | 147340 | Gernada | 格瑞那達 |
| Americas | 16492 | Turks & Caicos | 英屬土克思&開柯斯群 |
| Americas | 166449 | Montserrat | 蒙哲臘 |
| Americas | 175828 | St. Lucia | 聖露西亞 |
| Americas | 176727 | Dominica | 多米尼克 |
| Americas | 178449 | St. Vincent | 聖文森島國 |
| Americas | 1809 | Dominicana | 多明尼加共和國 |
| Americas | 186966 | St. Kitts/Nevis | 聖克里斯多福及尼維 |
| Americas | 187682 | Jamaica | 牙買加 |
| Americas | 1939 | Puerto Rico | 波多黎各 |
| Americas | 297 | Aruba | 阿廬巴島 |
| Americas | 501 | Belize | 貝里斯 |
| Americas | 502 | GUATEMALA | 瓜地馬拉 |
| Americas | 503 | El_Salvador | 薩爾瓦多 |
| Americas | 504 | Honduras | 宏都拉斯 |
| Americas | 505 | Nicaragua | 尼加拉瓜 |
| Americas | 506 | Costa Rica | 哥斯大黎加 |
| Americas | 509 | HAITI | 海地 |
| Americas | 51 | Peru | 秘魯 |
| Americas | 52 | Mexico | 墨西哥 |
| Americas | 53 | Cuba | 古巴 |
| Americas | 54 | Argentina | 阿根廷 |
| Americas | 55 | Brazil | 巴西 |
| Americas | 56 | Chile | 智利 |
| Americas | 57 | Colombia | 哥倫比亞 |
| Americas | 590 | Carribean | 瓜德羅普 |
| Americas | 591 | Bolivia | 玻利維亞 |
| Americas | 592 | Guyana | 圭亞那 |
| Americas | 593 | Ecuado | 厄瓜多爾 |
| Americas | 595 | Paraguay | 巴拉圭 |
| Americas | 597 | Suriname | 蘇利南 |
| Americas | 598 | Uruguay | 烏拉圭 |
| Americas | 71401 | Panama | 巴拿馬 |
| Africa | 20 | Egypt | 埃及 |
| Africa | 211 | South Sudan | 南蘇丹 |
| Africa | 212 | Morocco | 摩洛哥 |
| Africa | 213 | Algeria | 阿爾及利亞 |
| Africa | 216 | Turusia | 突尼西亞 |
| Africa | 220 | Gambia | 甘比亞 |
| Africa | 221 | Senegal | 塞內加爾 |
| Africa | 222 | Mauritania | 茅利塔尼亞 |
| Africa | 223 | Mali | 馬利 |
| Africa | 224 | Guinea | 幾內亞 |
| Africa | 225 | Ivory Coast | 象牙海岸 |
| Africa | 226 | Burkina Faso | 布吉納法索 |
| Africa | 227 | Niger | 尼日 |
| Africa | 228 | Togo | 多哥 |
| Africa | 229 | Benin | 貝南 |
| Africa | 230 | Mauritius | 模里西斯 |
| Africa | 231 | Liberia | 賴比瑞亞 |
| Africa | 233 | Ghana | 迦納 |
| Africa | 234 | Nigeria | 奈及利亞 |
| Africa | 235 | Chad | 查德 |
| Africa | 236 | Central African Rep | 中非共和國 |
| Africa | 237 | Cameroun | 喀麥隆 |
| Africa | 238 | Cape Verde | 維德角 |
| Africa | 239 | São Tomé and Príncipe | 聖多美普林西比 |
| Africa | 241 | Gabon | 加彭 |
| Africa | 242 | Congo | 剛果 |
| Africa | 243 | The Democratic Republic of the Congo | 剛果民主共和國 |
| Africa | 245 | Bissau | 幾內亞比紹 |
| Africa | 248 | Seychelles | 塞席爾 |
| Africa | 249 | Sudan | 蘇丹 |
| Africa | 250 | Rwanda | 盧安達 |
| Africa | 254 | Kenya | 肯亞 |
| Africa | 255 | Tanzania | 坦尚尼亞 |
| Africa | 256 | Uganda | 烏干達 |
| Africa | 257 | Burundi | 蒲隆地 |
| Africa | 258 | Mozambique | 莫三比克 |
| Africa | 260 | Zambia | 尚比亞 |
| Africa | 261 | Madagascar | 馬達加斯加 |
| Africa | 262 | Reunion | 留尼旺 |
| Africa | 263 | Zimbabwe | 辛巴威 |
| Africa | 264 | Namibia | 那米比亞 |
| Africa | 265 | Malawi | 馬拉威 |
| Africa | 266 | Lesotho | 賴索托 |
| Africa | 268 | Swaziland | 史瓦濟蘭 |
| Africa | 27 | South Africa | 南非 |
| Africa | 355 | Albania | 阿爾巴尼亞 |
| Africa | 652 | Botswana | 波扎那 |
SMS Domain Whitelist Application
NCC Regulations:
- Please clearly indicate your real-name identity in the SMS content. Add the company, brand, or campaign name at the beginning or end of the message so recipients can clearly identify the source.
- If the SMS includes a URL, you must apply for a domain whitelist with the telecom operator in advance; otherwise, the SMS cannot be sent. Please email service@newsleopard.tw with the information below. Review may take 5–7 business days.
Email Subject: [SMS Domain Whitelist Application]
User Email:
Requested URL (must be a publicly accessible webpage):
Requested Domain (must be the domain of the URL above):
Real-name Identity (enter the company, brand, or campaign name that will appear in the SMS):
Company Name:
Business Registration Number:
Contact Phone:
Business Category:
Webhook Usage
Description
Provides behavioral event tracking and delivers real-time event callbacks via Webhook.
Callback Method
Events are sent via HTTP POST to the URL configured by the user.
Signature Verification
To ensure that the request is sent by Surenotify, you can verify the x-surenotify-signature in the request header to confirm it originates from this service.
- Verification Steps:
- Retrieve the
x-surenotify-signaturefrom the Surenotify callback header. - Retrieve the
idandeventfields (id,eventType) from the request body. - Concatenate
idandeventTypeinto a single string. - Use the API key (
x-api-key) as the secret key and encrypt the message using HmacSHA256 to generate a Hex string (signature). - Compare the
x-surenotify-signaturein the header with the calculated signature.
- Retrieve the
Example:
id = 20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7
eventType = delivery Concatenated string = 20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7delivery
Email Webhook Fields / Examples
Field Descriptions
| Field | Type | Description |
|---|---|---|
event |
string |
Event type, one of: ・delivery ・open ・click ・bounce ・complaint |
id |
string |
Email ID |
subject |
string |
Email subject |
content |
string |
Email content |
from |
string |
Sender |
to |
string |
Recipient |
variables |
object |
Recipient variables |
delivery.timestamp |
long |
Delivery timestamp |
open.timestamp |
long |
Open timestamp |
open.client_headers |
string |
Recipient client headers |
click.timestamp |
long |
Click timestamp |
click.sort |
string |
Link order within the email body, starting from 0 |
click.link_url |
string |
Clicked URL |
click.client_headers |
string |
Recipient client headers |
bounce.timestamp |
long |
Bounce timestamp |
bounce.code |
string |
SMTP code |
bounce.type |
number |
Bounce type: 0 = soft bounce; 1 = hard bounce |
bounce.reason |
string |
Bounce reason |
complaint.timestamp |
long |
Complaint timestamp |
Examples:
delivery
{
"event": "delivery",
"mail": {
"id": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"subject": "System Notification",
"content": "",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"variables": {
"UUID": "1234-56-78-9012"
},
},
"delivery": {
"timestamp": 1577836800000
}
}
open
{
"event": "open",
"mail": {
"id": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"subject": "System Notification",
"content": "",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"variables": {
"UUID": "1234-56-78-9012"
},
},
"open": {
"timestamp": 1577836800000,
"client_headers": "{Accept=image/png,image/svg+xml,image/*;q=0.8,video/*;q=0.8,*/*;q=0.5, Accept-Encoding=br, gzip, deflate, Accept-Language=en-us, CloudFront-Forwarded-Proto=https, CloudFront-Is-Desktop-Viewer=true, CloudFront-Is-Mobile-Viewer=false, CloudFront-Is-SmartTV-Viewer=false, CloudFront-Is-Tablet-Viewer=false, CloudFront-Viewer-Country=HK, Host=mail.surenotifyapi.com, Referer=https://outlook.live.com/, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15, Via=2.0 632ca9875c25dbcff60b54139f83cb7a.cloudfront.net (CloudFront), X-Amz-Cf-Id=nOTGJmuDsy7LYnSma1kDmDvp-tpkNtibo9pRaRvcwP-xJsfvKYnnrw==, X-Amzn-Trace-Id=Root=1-5ed33920-c6e20b989a5e0ddc092e726c, X-Forwarded-For=192.168.0.0, 192.168.0.1, X-Forwarded-Port=443, X-Forwarded-Proto=https}"
}
}
click
{
"event": "click",
"mail": {
"id": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"subject": "System Notification",
"content": "",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"variables": {
"UUID": "1234-56-78-9012"
},
},
"click": {
"timestamp": 1577836800000,
"sort": "0",
"link_url": "https://example.com",
"client_headers": "{Accept=image/png,image/svg+xml,image/*;q=0.8,video/*;q=0.8,*/*;q=0.5, Accept-Encoding=br, gzip, deflate, Accept-Language=en-us, CloudFront-Forwarded-Proto=https, CloudFront-Is-Desktop-Viewer=true, CloudFront-Is-Mobile-Viewer=false, CloudFront-Is-SmartTV-Viewer=false, CloudFront-Is-Tablet-Viewer=false, CloudFront-Viewer-Country=HK, Host=mail.surenotifyapi.com, Referer=https://outlook.live.com/, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15, Via=2.0 632ca9875c25dbcff60b54139f83cb7a.cloudfront.net (CloudFront), X-Amz-Cf-Id=nOTGJmuDsy7LYnSma1kDmDvp-tpkNtibo9pRaRvcwP-xJsfvKYnnrw==, X-Amzn-Trace-Id=Root=1-5ed33920-c6e20b989a5e0ddc092e726c, X-Forwarded-For=192.168.0.0, 192.168.0.1, X-Forwarded-Port=443, X-Forwarded-Proto=https}"
}
}
bounce
{
"event": "bounce",
"mail": {
"id": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"subject": "System Notification",
"content": "",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"variables": {
"UUID": "1234-56-78-9012"
},
},
"bounce": {
"timestamp": 1577836800000,
"code": "5.0.0",
"type": "1",
"reason": "system: user unknown",
}
}
complaint
{
"event": "complaint",
"mail": {
"id": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"subject": "System Notification",
"content": "",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"variables": {
"UUID": "1234-56-78-9012"
},
},
"complaint": {
"timestamp": 1577836800000
}
}
Note
Due to varying response times from different mail servers, Surenotify defines an email as “delivered” as soon as it is sent. Therefore, it is possible to receive a bounce event after receiving a delivery event. Please be aware of this behavior.
SMS Webhook Fields / Examples
Field Descriptions
| Field | Type | Description |
|---|---|---|
event |
string |
Event type, one of: ・delivery ・bounce |
id |
string |
SMS ID |
content |
string |
SMS content |
variables |
object |
Recipient variables |
alive_mins |
number |
Retry duration in minutes. Valid range: 5–480. If not specified, defaults to the minimum. Values below the minimum or above the maximum are treated as the minimum or maximum respectively. A longer alive_mins maximizes delivery success, but you must wait until alive_mins expires before receiving the final webhook result. Set this value according to your use case’s real-time requirements. |
recipient |
string |
Recipient |
address |
string |
Recipient phone number |
country_code |
string |
Recipient country code |
delivery.timestamp |
long |
Delivery timestamp |
delivery.point |
number |
Billing units (message segments) |
delivery.srcaddr |
string |
Sender phone number |
bounce.timestamp |
long |
Bounce timestamp |
bounce.code |
string |
Error code |
bounce.reason |
string |
Error reason |
Examples:
delivery
{
"event": "delivery",
"sms_data": {
"id": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"content": "Newsleopard Team sincerely invites you to join the Newsleopard family",
"recipient": "886912345678",
"address": "0912345678",
"country_code": "886",
"variables": {
"UUID": "1234-56-78-9012"
},
"alive_mins": 5
},
"delivery": {
"timestamp": 1577836800000,
"point": 1,
"srcaddr": "0988777666",
}
}
bounce
{
"event": "bounce",
"sms_data": {
"id": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"content": "Newsleopard Team sincerely invites you to join the Newsleopard family",
"recipient": "886912345678",
"address": "0912345678",
"country_code": "886",
"variables": {
"UUID": "1234-56-78-9012"
},
"alive_mins": 5
},
"bounce": {
"timestamp": 1577836800000,
"code": "-5",
"reason": "destination number invalid",
}
}
Email API ¶
Send Single/Multiple Emails ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyBody
{
"subject": "System Notification",
"fromName": "Newsleopard Team",
"fromAddress": "name@example.com",
"content": "<html><body><h3>Hello, World</h3></body></html>",
"unsubscribedLink": "https://links.to.your.unsubscribe.link",
"recipients": [
{
"name": "bob",
"address": "bob@gmail.com",
"variables": {
"UUID": "1234-56-78-9012"
}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "Email subject"
},
"fromName": {
"type": "string",
"description": "Sender name"
},
"fromAddress": {
"type": "string",
"description": "Sender email address"
},
"content": {
"type": "string",
"description": "Email content"
},
"unsubscribedLink": {
"type": "string",
"description": "Unsubscribe link, displayed in the email client's header area"
},
"recipients": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Recipient name"
},
"address": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"UUID": {
"type": "string"
}
}
}
},
"required": [
"address"
]
}
}
},
"required": [
"subject",
"fromAddress",
"content"
]
}Headers
Content-Type: application/jsonBody
{
"id": "7897e18f-19bc-44eb-9149-e95e9ffc5d27",
"success": [
{
"id": "20191107080336-47f09d97-9a46-4215-bdb7-de68eca1c436",
"address": "bob@gmail.com"
}
],
"failure": {}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/id"
},
{
"$ref": "#/definitions/success"
},
{
"$ref": "#/definitions/failure"
}
],
"definitions": {
"id": {
"type": "object",
"patternProperties": {
"": {
"type": "string"
}
}
},
"success": {
"type": "object",
"patternProperties": {
"": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"address": {
"type": "string"
}
}
}
}
}
},
"failure": {
"type": "object",
"patternProperties": {
"": {
"type": "object",
"properties": {}
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"errors": "Invalid: sender domain unverified"
}Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyBody
{
"subject": "System Notification",
"fromName": "Newsleopard Team",
"fromAddress": "name@example.com",
"content": "<html><body><h3>Hello, World</h3></body></html>",
"unsubscribedLink": "https://links.to.your.unsubscribe.link",
"recipients": [
{
"name": "alice",
"address": "alice@yahoo.com.tw",
"variables": {
"gender": "woman"
}
},
{
"name": "bob",
"address": "bob@gmail.com",
"variables": {
"gender": "man"
}
},
{
"name": "iamnotanemail",
"address": "iamnotanemail",
"variables": {}
},
{
"name": "variable_too_long",
"address": "variable_too_long@gmail.com",
"variables": {
"description": [
"i_am_the_variable_whose_length_is_over_100_characeters_Lorem",
"ipsum dolor sit amet consectetur adipisicing elit. Quis quaerat quas",
"architecto magni id minima labore illum eligendi impedit numquam debitis. Recusandae eos placeat dolorum. Aliquam obcaecati delectus adipisci molestias?"
]
}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "Email subject"
},
"fromName": {
"type": "string",
"description": "Sender name"
},
"fromAddress": {
"type": "string",
"description": "Sender email address"
},
"content": {
"type": "string",
"description": "Email content"
},
"unsubscribedLink": {
"type": "string",
"description": "Unsubscribe link, displayed in the email client's header area"
},
"recipients": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Recipient name"
},
"address": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"gender": {
"type": "string"
}
}
}
},
"required": [
"address"
]
},
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Recipient name"
},
"address": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"gender": {
"type": "string"
}
}
}
},
"required": [
"address"
]
},
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Recipient name"
},
"address": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {}
}
},
"required": [
"address"
]
},
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Recipient name"
},
"address": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"description": {
"type": "array"
}
}
}
},
"required": [
"address"
]
}
]
}
},
"required": [
"subject",
"fromAddress",
"content"
]
}Headers
Content-Type: application/jsonBody
{
"id": "7897e18f-19bc-44eb-9149-e95e9ffc5d27",
"success": [
{
"id": "20191107080336-4ca1d97-216e-4a2b-b7ad-68deeac1c1ca6",
"address": "alice@yahoo.com.tw"
},
{
"id": "20191107080336-47f09d97-9a46-4215-bdb7-de68eca1c436",
"address": "bob@gmail.com"
}
],
"failure": {
"iamnotanemail": "Invalid: address is not a valid email format",
"variable_too_long@gmail.com": "Invalid: the value of recipient variables should under 100 characters"
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/id"
},
{
"$ref": "#/definitions/success"
},
{
"$ref": "#/definitions/failure"
}
],
"definitions": {
"id": {
"type": "object",
"patternProperties": {
"": {
"type": "string"
}
}
},
"success": {
"type": "object",
"patternProperties": {
"": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"address": {
"type": "string"
}
}
},
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"address": {
"type": "string"
}
}
}
]
}
}
},
"failure": {
"type": "object",
"patternProperties": {
"": {
"type": "object",
"properties": {
"iamnotanemail": {
"type": "string"
},
"variable_too_long@gmail.com": {
"type": "string"
}
}
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"errors": "Invalid: sender domain unverified"
}Send Single/Multiple EmailsPOST/v1/messages
Description
Use this service to send single or multiple emails. You can also use variables (see: Variable Usage) to achieve personalized email content.
Request Fields * Required field
| Field | Type | Description |
|---|---|---|
subject * |
string |
Email subject |
fromName |
string |
Sender name. If not provided, the system will use the local part of fromAddress.For example: support from support@example.com |
fromAddress * |
string |
Sender email address |
content * |
string |
Email HTML content |
unsubscribedLink |
string |
Unsubscribe link allowing recipients to opt out. Following MIME Spec, it will be displayed in the email client’s header area. |
recipients * |
array |
Recipient list. Maximum 100 recipients per request. |
recipients.name * |
string |
Recipient name |
recipients.address * |
string |
Recipient email address |
recipients.variables |
object |
Recipient variables (custom). Each variable value must not exceed 100 characters, cannot use mathematical expressions, and must not start with a number. For usage, see: Variable Usage |
Response Properties
| Field | Type | Description |
|---|---|---|
id |
string |
Request ID |
success.id |
string |
Email ID |
success.address |
string |
Recipient email address |
failure |
object |
Recipient errors, including: ・Invalid email format: Invalid: address is not a valid email format・Recipient variable value too long: Invalid: the value of recipient variables should under 100 characters |
Add/Update Webhook ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyBody
{
"type": 3,
"url": "https://urwebhook.com"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"type": {
"type": "number",
"description": "Event type"
},
"url": {
"type": "string",
"description": "Webhook URL"
}
},
"required": [
"type"
]
}Headers
Content-Type: application/jsonBody
{
"success": true
}Headers
Content-Type: application/jsonBody
{
"success": false,
"messages": [
"Invalid: type is not a valid value."
]
}Add/Update WebhookPOST/v1/webhooks
Description
This service allows you to configure a Webhook URL to receive real-time event notifications for each email’s sending status, including: delivery, open, click, bounce, and complaint.
Request Fields * Required field
| Field | Type | Description |
|---|---|---|
type * |
number |
Event type code: ・delivery: 3 ・open: 4 ・click: 5 ・bounce: 6 ・complaint: 7 |
url * |
string |
Webhook registration URL |
Response Properties
| Field | Type | Description |
|---|---|---|
success |
boolean |
Whether the operation succeeded: true or false |
message |
array |
Reason for failure |
Notes
If no record exists for the specified type and url, a new entry will be created; otherwise, the existing record will be updated.
Query Webhooks ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"type": 3,
"domain": "default",
"url": "https://urwebhook.com",
"createDate": "2019-03-05T08:19:26Z"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"type": {
"type": "number",
"description": "Event type"
},
"domain": {
"type": "string",
"description": "Domain name"
},
"url": {
"type": "string",
"description": "Webhook URL"
},
"createDate": {
"type": "string",
"description": "Creation time"
}
},
"required": [
"type"
]
}Query WebhooksGET/v1/webhooks
Description
This service allows you to retrieve all currently configured Webhook settings.
Response Properties
| Field | Type | Description |
|---|---|---|
type |
number |
Event type code: ・delivery: 3 ・open: 4 ・click: 5 ・bounce: 6 ・complaint: 7 |
domain |
string |
Domain name |
url |
string |
Webhook registration URL |
createDate |
string |
Creation time |
Delete Webhook ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyBody
{
"type": 3
}Headers
Content-Type: application/jsonBody
{
"success": true,
}Headers
Content-Type: application/jsonBody
{
"success": false,
}Delete WebhookDELETE/v1/webhooks
Description
This service allows you to delete a currently configured Webhook.
Request Fields * Required field
| Field | Type | Description |
|---|---|---|
type * |
number |
Event type code: ・delivery: 3 ・open: 4 ・click: 5 ・bounce: 6 ・complaint: 7 |
Response Properties
| Field | Type | Description |
|---|---|---|
success |
boolean |
Whether the deletion succeeded: true or false |
Event Query ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"logs": [
{
"messageId": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"status": "accept",
"mail": {
"subject": "System Notification",
"content": "<html><body><h3>Hello, World</h3></body></html>",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"sender": "name@example.com",
"recipient": "bob@gmail.com",
"variables": {
"UUID": "1234-56-78-9012"
}
},
"eventTime": "2019-12-15T08:38:32Z",
"rawEvent": {}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "Email ID"
},
"status": {
"type": "string",
"description": "Event type"
},
"mail": {
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "Email subject"
},
"content": {
"type": "string",
"description": "Email content"
},
"from": {
"type": "string",
"description": "Sender"
},
"to": {
"type": "string",
"description": "Recipient"
},
"sender": {
"type": "string",
"description": "Sender email address"
},
"recipient": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"UUID": {
"type": "string"
}
}
}
}
},
"eventTime": {
"type": "string",
"description": "Event timestamp"
},
"rawEvent": {
"type": "object",
"properties": {}
}
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"error": "Error reason message"
}Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"logs": [
{
"messageId": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"status": "retry",
"mail": {
"subject": "System Notification",
"content": "<html><body><h3>Hello, World</h3></body></html>",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"sender": "name@example.com",
"recipient": "bob@gmail.com",
"variables": {
"UUID": "1234-56-78-9012"
}
},
"eventTime": "2019-12-15T08:38:32Z",
"rawEvent": {}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "Email ID"
},
"status": {
"type": "string",
"description": "Event type"
},
"mail": {
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "Email subject"
},
"content": {
"type": "string",
"description": "Email content"
},
"from": {
"type": "string",
"description": "Sender"
},
"to": {
"type": "string",
"description": "Recipient"
},
"sender": {
"type": "string",
"description": "Sender email address"
},
"recipient": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"UUID": {
"type": "string"
}
}
}
}
},
"eventTime": {
"type": "string",
"description": "Event timestamp"
},
"rawEvent": {
"type": "object",
"properties": {}
}
}
}
}
}
}Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"logs": [
{
"messageId": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"status": "delivery",
"mail": {
"subject": "System Notification",
"content": "<html><body><h3>Hello, World</h3></body></html>",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"sender": "name@example.com",
"recipient": "bob@gmail.com",
"variables": {
"UUID": "1234-56-78-9012"
}
},
"eventTime": "2019-12-15T08:38:32Z",
"rawEvent": {}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "Email ID"
},
"status": {
"type": "string",
"description": "Event type"
},
"mail": {
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "Email subject"
},
"content": {
"type": "string",
"description": "Email content"
},
"from": {
"type": "string",
"description": "Sender"
},
"to": {
"type": "string",
"description": "Recipient"
},
"sender": {
"type": "string",
"description": "Sender email address"
},
"recipient": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"UUID": {
"type": "string"
}
}
}
}
},
"eventTime": {
"type": "string",
"description": "Event timestamp"
},
"rawEvent": {
"type": "object",
"properties": {}
}
}
}
}
}
}Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"logs": [
{
"messageId": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"status": "open",
"mail": {
"subject": "System Notification",
"content": "<html><body><h3>Hello, World</h3></body></html>",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"sender": "name@example.com",
"recipient": "bob@gmail.com",
"variables": {
"UUID": "1234-56-78-9012"
}
},
"eventTime": "2019-12-15T08:38:32Z",
"rawEvent": {
"clientHeaders": "User-Agent=Mozilla/5.0 Chrome/81.0.4044.129 Safari/537.36"
}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "Email ID"
},
"status": {
"type": "string",
"description": "Event type"
},
"mail": {
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "Email subject"
},
"content": {
"type": "string",
"description": "Email content"
},
"from": {
"type": "string",
"description": "Sender"
},
"to": {
"type": "string",
"description": "Recipient"
},
"sender": {
"type": "string",
"description": "Sender email address"
},
"recipient": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"UUID": {
"type": "string"
}
}
}
}
},
"eventTime": {
"type": "string",
"description": "Event timestamp"
},
"rawEvent": {
"type": "object",
"properties": {
"clientHeaders": {
"type": "string",
"description": "Client headers"
}
}
}
}
}
}
}
}Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"logs": [
{
"messageId": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"status": "click",
"mail": {
"subject": "System Notification",
"content": "<html><body><h3>Hello, World</h3></body></html>",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"sender": "name@example.com",
"recipient": "bob@gmail.com",
"variables": {
"UUID": "1234-56-78-9012"
}
},
"eventTime": "2019-12-15T08:38:32Z",
"rawEvent": {
"sort": "0",
"linkUrl": "https://newsleopard.com/",
"clientHeaders": "User-Agent=Mozilla/5.0 Chrome/81.0.4044.129 Safari/537.36"
}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "Email ID"
},
"status": {
"type": "string",
"description": "Event type"
},
"mail": {
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "Email subject"
},
"content": {
"type": "string",
"description": "Email content"
},
"from": {
"type": "string",
"description": "Sender"
},
"to": {
"type": "string",
"description": "Recipient"
},
"sender": {
"type": "string",
"description": "Sender email address"
},
"recipient": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"UUID": {
"type": "string"
}
}
}
}
},
"eventTime": {
"type": "string",
"description": "Event timestamp"
},
"rawEvent": {
"type": "object",
"properties": {
"sort": {
"type": "string",
"description": "Link order within the email"
},
"linkUrl": {
"type": "string",
"description": "Clicked URL"
},
"clientHeaders": {
"type": "string",
"description": "Client headers"
}
}
}
}
}
}
}
}Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"logs": [
{
"messageId": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"status": "bounce",
"mail": {
"subject": "System Notification",
"content": "<html><body><h3>Hello, World</h3></body></html>",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"sender": "name@example.com",
"recipient": "bob@gmail.com",
"variables": {
"UUID": "1234-56-78-9012"
}
},
"eventTime": "2019-12-15T08:38:32Z",
"rawEvent": {
"code": "451",
"type": "0",
"reason": "Internal resource temporarily unavailable - https://community.mimecast.com/docs/DOC-1369#451 [e2v-qRg9O1y4DLy5or9YqA.us411]"
}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "Email ID"
},
"status": {
"type": "string",
"description": "Event type"
},
"mail": {
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "Email subject"
},
"content": {
"type": "string",
"description": "Email content"
},
"from": {
"type": "string",
"description": "Sender"
},
"to": {
"type": "string",
"description": "Recipient"
},
"sender": {
"type": "string",
"description": "Sender email address"
},
"recipient": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"UUID": {
"type": "string"
}
}
}
}
},
"eventTime": {
"type": "string",
"description": "Event timestamp"
},
"rawEvent": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "SMTP code"
},
"type": {
"type": "string",
"description": "Bounce type"
},
"reason": {
"type": "string",
"description": "Bounce reason"
}
}
}
}
}
}
}
}Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"logs": [
{
"messageId": "20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7",
"status": "complaint",
"mail": {
"subject": "System Notification",
"content": "<html><body><h3>Hello, World</h3></body></html>",
"from": "Newsleopard Team <name@example.com>",
"to": "bob <bob@gmail.com>",
"sender": "name@example.com",
"recipient": "bob@gmail.com",
"variables": {
"UUID": "1234-56-78-9012"
}
},
"eventTime": "2019-12-15T08:38:32Z",
"rawEvent": {}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "Email ID"
},
"status": {
"type": "string",
"description": "Event type"
},
"mail": {
"type": "object",
"properties": {
"subject": {
"type": "string",
"description": "Email subject"
},
"content": {
"type": "string",
"description": "Email content"
},
"from": {
"type": "string",
"description": "Sender"
},
"to": {
"type": "string",
"description": "Recipient"
},
"sender": {
"type": "string",
"description": "Sender email address"
},
"recipient": {
"type": "string",
"description": "Recipient email address"
},
"variables": {
"type": "object",
"properties": {
"UUID": {
"type": "string"
}
}
}
}
},
"eventTime": {
"type": "string",
"description": "Event timestamp"
},
"rawEvent": {
"type": "object",
"properties": {}
}
}
}
}
}
}Event QueryGET/v1/events{?from,to,status,id,recipient}
Description
This service allows you to query the sending records for a specific recipient to confirm the current status of an email. Queryable events include: accept, retry, delivery, open, click, bounce, and complaint.
URI Parameters * Required field
| Parameters | Type | Description |
|---|---|---|
id * |
string |
Email ID (provide either id or recipient) |
recipient * |
string |
Recipient email address (provide either id or recipient) |
from |
string |
Start time of the query range. Example format: 2019-12-15T08:38:32ZPlease ensure the datetime is in UTC+0. |
If from is not provided, a default value will be applied:- If to is specified, from defaults to one month before to.- If to is not specified, from defaults to one month before today. |
||
to |
string |
End time of the query range. Example format: 2019-12-25T08:38:32ZPlease ensure the datetime is in UTC+0. |
If to is not provided, a default value will be applied:- If from is specified, to defaults to one month after from.- If from is not specified, to defaults to today. |
||
status |
string |
Event type, one of: ・accept ・retry ・delivery ・open ・click ・bounce ・complaint Multiple values can be selected, separated by commas ,. |
Response Properties
| Field | Type | Description |
|---|---|---|
messageId |
string |
Email ID |
status |
string |
Event type, one of: ・accept ・retry ・delivery ・open ・click ・bounce ・complaint |
mail.subject |
string |
Email subject |
mail.content |
string |
Email content |
mail.from |
string |
Sender |
mail.to |
string |
Recipient |
mail.sender |
string |
Sender email address |
mail.recipient |
string |
Recipient email address |
mail.variables |
object |
Recipient variables |
eventTime |
string |
Event timestamp |
rawEvent.clientHeaders |
string |
Recipient client headers |
rawEvent.sort |
string |
Link order within the email body, starting from 0 |
rawEvent.linkUrl |
string |
Clicked URL |
rawEvent.code |
string |
SMTP code |
rawEvent.type |
string |
Bounce type: 0 = soft bounce; 1 = hard bounce |
rawEvent.reason |
string |
Bounce reason |
Bounce Reasons
Notes
-
Only data within the past 30 days can be queried. If the results exceed 50 records, only the first 50 will be returned. To retain complete event records, please refer to the Add/Update Webhook section to configure a Webhook in advance and store events in your own system.
-
If both
idandrecipientare provided in the URI Parameters,idtakes priority.
- id
string(optional) Example: 20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7Email ID
- recipient
string(optional) Example: user@gmail.comRecipient email address
- from
string(optional) Example: 2019-12-15T08:38:32ZStart datetime
Format:2019-12-15T08:38:32Z
Note: Please ensure the datetime is inUTC+0- to
string(optional) Example: 2019-12-25T08:38:32ZEnd datetime
Format:2019-12-25T08:38:32Z
Note: Please ensure the datetime is inUTC+0- status
string(optional) Example: accept,retry,openEvent type
accept
retry
delivery
open
click
bounce
complaint
Create Sender Authentication ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
[
{
"name": "yours.domain.com",
"value": "v=spf1 include:amazonses.com include:mailgun.org ?all",
"record_type": 0,
"valid": "false"
}
]Create Sender AuthenticationPOST/v1/domains/{domain}
Description
Use this service to obtain the configuration records for sender authentication and set them up in your DNS server. Once configured, please refer to Verify Sender Authentication to complete the verification process. Setting up sender authentication ensures that emails are sent from your configured domain, that the content has not been spoofed or tampered with, and helps improve email deliverability.
URI Parameters * Required field
| Parameters | Type | Description |
|---|---|---|
domain * |
string |
The sender domain to configure for authentication |
Response Properties
| Field | Type | Description |
|---|---|---|
name |
string |
Sender domain configured for authentication |
value |
string |
Configuration record value |
record_type |
number |
DNS record type: 0 = TXT; 1 = CNAME |
valid |
boolean |
Whether verification passed: true or false |
- domain
string(required)The domain to configure for sender authentication
Verify Sender Authentication ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
[
{
"name": "yours.domain.com",
"value": "v=spf1 include:amazonses.com include:mailgun.org ?all",
"record_type": 0,
"valid": true
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Verify Sender AuthenticationPUT/v1/domains/{domain}
Description
Use this service to verify the sender authentication and confirm whether the DNS settings have taken effect.
URI Parameters * Required field
| Parameters | Type | Description |
|---|---|---|
domain * |
string |
The sender domain to verify authentication for |
Response Properties
| Field | Type | Description |
|---|---|---|
name |
string |
Sender domain configured for authentication |
value |
string |
Configuration record value |
record_type |
number |
DNS record type: 0 = TXT; 1 = CNAME |
valid |
boolean |
Whether verification passed: true or false |
- domain
string(required)The domain to verify sender authentication for
Delete Sender Authentication ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"success": true,
}Headers
Content-Type: application/jsonBody
{
"success": false,
}Delete Sender AuthenticationDELETE/v1/domains/{domain}
Description
Use this service to delete a previously created sender authentication configuration.
URI Parameters * Required field
| Parameters | Type | Description |
|---|---|---|
domain * |
string |
The sender domain to delete authentication for |
Response Properties
| Field | Type | Description |
|---|---|---|
success |
boolean |
Whether the deletion succeeded: true or false |
- domain
string(required)The domain to delete sender authentication for
SMS API ¶
Send Single/Multiple SMS ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyBody
{
"from": "0987654321",
"content": "This is a test SMS. Please do not reply.",
"alive_mins": 5,
"recipients": [
{
"address": "0912345678",
"country_code": "886",
"variables": {
"UUID": "1234-56-78-9012"
}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"from": {
"type": "string",
"description": "Sender phone number"
},
"content": {
"type": "string",
"description": "SMS content"
},
"alive_mins": {
"type": "number",
"description": "Retry duration"
},
"recipients": {
"type": "array",
"items": {
"type": "object",
"properties": {
"address": {
"type": "string",
"description": "Recipient phone number"
},
"country_code": {
"type": "string",
"description": "Recipient country code"
},
"variables": {
"type": "object",
"properties": {
"UUID": {
"type": "string"
}
}
}
},
"required": [
"address",
"country_code"
]
}
}
},
"required": [
"content"
]
}Headers
Content-Type: application/jsonBody
{
"id": "7897e18f-19bc-44eb-9149-e95e9ffc5d27",
"success": [
{
"id": "20191107080336-47f09d97-9a46-4215-bdb7-de68eca1c436",
"address": "0912345678"
}
],
"failure": {}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/id"
},
{
"$ref": "#/definitions/success"
},
{
"$ref": "#/definitions/failure"
}
],
"definitions": {
"id": {
"type": "object",
"patternProperties": {
"": {
"type": "string"
}
}
},
"success": {
"type": "object",
"patternProperties": {
"": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"address": {
"type": "string"
}
}
}
}
}
},
"failure": {
"type": "object",
"patternProperties": {
"": {
"type": "object",
"properties": {}
}
}
}
}
}Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyBody
{
"from": "0987654321",
"content": "This is a test SMS. Please do not reply.",
"alive_mins": 5,
"recipients": [
{
"address": "0912345678",
"country_code": "886",
"variables": {
"gender": "woman"
}
},
{
"address": "0933444888",
"country_code": "886",
"variables": {
"gender": "man"
}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"from": {
"type": "string",
"description": "Sender phone number"
},
"content": {
"type": "string",
"description": "SMS content"
},
"alive_mins": {
"type": "number",
"description": "Retry duration"
},
"recipients": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"address": {
"type": "string",
"description": "Recipient phone number"
},
"country_code": {
"type": "string",
"description": "Recipient country code"
},
"variables": {
"type": "object",
"properties": {
"gender": {
"type": "string"
}
}
}
},
"required": [
"address",
"country_code"
]
},
{
"type": "object",
"properties": {
"address": {
"type": "string",
"description": "Recipient phone number"
},
"country_code": {
"type": "string",
"description": "Recipient country code"
},
"variables": {
"type": "object",
"properties": {
"gender": {
"type": "string"
}
}
}
},
"required": [
"address",
"country_code"
]
}
]
}
},
"required": [
"content"
]
}Headers
Content-Type: application/jsonBody
{
"id": "7897e18f-19bc-44eb-9149-e95e9ffc5d27",
"success": {
"id": "20191107080336-4ca1d97-216e-4a2b-b7ad-68deeac1c1ca6",
"address": "0912345678"
},
"failure": {
"0933444888": "address is not a valid format"
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/id"
},
{
"$ref": "#/definitions/success"
},
{
"$ref": "#/definitions/failure"
}
],
"definitions": {
"id": {
"type": "object",
"patternProperties": {
"": {
"type": "string"
}
}
},
"success": {
"type": "object",
"patternProperties": {
"": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"address": {
"type": "string"
}
},
"required": [
"id",
"address"
],
"additionalProperties": false
}
}
},
"failure": {
"type": "object",
"patternProperties": {
"": {
"type": "object",
"properties": {
"0933444888": {
"type": "string"
}
}
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"message": "Invalid request body",
"errors": "[ array is too long: must have at most 100 elements ]"
}Send Single/Multiple SMSPOST/v1/sms/messages
Description
Use this service to send single or multiple SMS messages. You can also use variables (see: Variable Usage) to achieve personalized SMS content.
Request Fields * Required field
| Field | Type | Description |
|---|---|---|
content * |
string |
SMS content. NCC regulations require:
|
recipients * |
array |
Recipient list. Maximum 100 recipients per request. |
recipients.address * |
string |
Recipient phone number (digits only). Example: 0912345678 or 912345678 |
recipients.country_code * |
string |
Recipient country code. For a list of supported codes, see: SMS Supported Regions |
recipients.variables |
object |
Recipient variables (custom). Each variable value must not exceed 100 characters, cannot use mathematical expressions, and must not start with a number. For usage, see: Variable Usage |
from |
string |
Sender’s dedicated phone number. Leave blank if you do not have one. |
alive_mins |
number |
Retry duration in minutes. Valid range: 5–480. If not specified, defaults to the minimum. Values below the minimum or above the maximum are treated as the minimum or maximum respectively. A longer alive_mins maximizes delivery success, but you must wait until alive_mins expires before receiving the final webhook result. Set this value according to your use case’s real-time requirements. |
Response Properties
| Field | Type | Description |
|---|---|---|
id |
string |
Request ID |
success.id |
string |
SMS ID |
success.address |
string |
Recipient phone number |
failure |
object |
Recipient errors, including: ・Invalid phone format: address is not a valid format・Empty content: content can not be empty・Content exceeds limit: content length 390 exceeds the limit 268 |
Add/Update Webhook ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyBody
{
"type": 3,
"url": "https://urwebhook.com"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"type": {
"type": "number",
"description": "Event type"
},
"url": {
"type": "string",
"description": "Webhook URL"
}
},
"required": [
"type"
]
}Headers
Content-Type: application/jsonBody
{
"success": true
}Headers
Content-Type: application/jsonBody
{
"success": false,
"messages": [
"Invalid: type is not a valid value."
]
}Add/Update WebhookPOST/v1/sms/webhooks
Description
This service allows you to configure a Webhook URL to receive real-time event notifications for each SMS’s sending status, including: delivery and bounce.
Request Fields * Required field
| Field | Type | Description |
|---|---|---|
type * |
number |
Event type code: ・delivery: 3 ・bounce: 6 |
url * |
string |
Webhook registration URL |
Response Properties
| Field | Type | Description |
|---|---|---|
success |
boolean |
Whether the operation succeeded: true or false |
message |
array |
Reason for failure |
Notes
If no record exists for the specified type and url, a new entry will be created; otherwise, the existing record will be updated.
Query Webhooks ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"type": 3,
"domain": "default",
"url": "https://urwebhook.com",
"createDate": "2019-03-05T08:19:26Z"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"type": {
"type": "number",
"description": "Event type"
},
"domain": {
"type": "string",
"description": "Domain name"
},
"url": {
"type": "string",
"description": "Webhook URL"
},
"createDate": {
"type": "string",
"description": "Creation time"
}
},
"required": [
"type"
]
}Query WebhooksGET/v1/sms/webhooks
Description
This service allows you to retrieve all currently configured Webhook settings.
Response Properties
| Field | Type | Description |
|---|---|---|
type |
number |
Event type code: ・delivery: 3 ・bounce: 6 |
url |
string |
Webhook registration URL |
createDate |
string |
Creation time |
Delete Webhook ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyBody
{
"type": 3
}Headers
Content-Type: application/jsonBody
{
"success": true,
}Headers
Content-Type: application/jsonBody
{
"success": false,
}Delete WebhookDELETE/v1/sms/webhooks
Description
This service allows you to delete a currently configured Webhook.
Request Fields * Required field
| Field | Type | Description |
|---|---|---|
type * |
number |
Event type code: ・delivery: 3 ・bounce: 6 |
Response Properties
| Field | Type | Description |
|---|---|---|
success |
boolean |
Whether the deletion succeeded: true or false |
Event Query ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"logs": [
{
"messageId": "20210401092034-0-bf4269e8-d30c-43bd-aa0a-668502050694",
"recipient": "886912345678",
"address": "0912345678",
"countryCode": "886",
"status": "accept",
"content": "Welcome to Newsleopard platform services",
"eventTime": "2021-04-01T09:20:34Z",
"alive_mins": 5,
"variables": {},
"rawEvent": {}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "SMS ID"
},
"recipient": {
"type": "string",
"description": "Recipient"
},
"address": {
"type": "string",
"description": "Recipient phone number"
},
"countryCode": {
"type": "string",
"description": "Recipient country code"
},
"status": {
"type": "string",
"description": "Event type"
},
"content": {
"type": "string",
"description": "SMS content"
},
"eventTime": {
"type": "string",
"description": "Event timestamp"
},
"alive_mins": {
"type": "number",
"description": "Retry duration"
},
"variables": {
"type": "object",
"properties": {}
},
"rawEvent": {
"type": "object",
"properties": {}
}
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"error": "Error reason message"
}Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"logs": [
{
"messageId": "20210401092034-0-bf4269e8-d30c-43bd-aa0a-668502050694",
"recipient": "886912345678",
"address": "0912345678",
"countryCode": "886",
"status": "delivery",
"content": "Welcome to Newsleopard platform services",
"eventTime": "2021-04-01T09:20:34Z",
"alive_mins": 5,
"variables": {},
"rawEvent": {
"point": "1",
"srcaddr": "0988777666"
}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "SMS ID"
},
"recipient": {
"type": "string",
"description": "Recipient"
},
"address": {
"type": "string",
"description": "Recipient phone number"
},
"countryCode": {
"type": "string",
"description": "Recipient country code"
},
"status": {
"type": "string",
"description": "Event type"
},
"content": {
"type": "string",
"description": "SMS content"
},
"eventTime": {
"type": "string",
"description": "Event timestamp"
},
"alive_mins": {
"type": "number",
"description": "Retry duration"
},
"variables": {
"type": "object",
"properties": {}
},
"rawEvent": {
"type": "object",
"properties": {
"point": {
"type": "string",
"description": "Billing units (message segments)"
},
"srcaddr": {
"type": "string",
"description": "Sender phone number"
}
}
}
}
}
}
}
}Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"logs": [
{
"messageId": "20210401092034-0-bf4269e8-d30c-43bd-aa0a-668502050694",
"recipient": "886912345678",
"address": "0912345678",
"countryCode": "886",
"status": "bounce",
"content": "Welcome to Newsleopard platform services",
"eventTime": "2021-04-01T09:20:34Z",
"alive_mins": 5,
"variables": {},
"rawEvent": {
"code": "-5",
"reason": "destination number invalid"
}
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "SMS ID"
},
"recipient": {
"type": "string",
"description": "Recipient"
},
"address": {
"type": "string",
"description": "Recipient phone number"
},
"countryCode": {
"type": "string",
"description": "Recipient country code"
},
"status": {
"type": "string",
"description": "Event type"
},
"content": {
"type": "string",
"description": "SMS content"
},
"eventTime": {
"type": "string",
"description": "Event timestamp"
},
"alive_mins": {
"type": "number",
"description": "Retry duration"
},
"variables": {
"type": "object",
"properties": {}
},
"rawEvent": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Error code"
},
"reason": {
"type": "string",
"description": "Bounce reason"
}
}
}
}
}
}
}
}Event QueryGET/v1/sms/events{?from,to,status,id,recipient,country_code}
Description
This service allows you to query the sending records for a specific recipient to confirm the current status of an SMS. Queryable events include: accept, delivery, and bounce.
URI Parameters * Required field
| Parameters | Type | Description |
|---|---|---|
id * |
string |
SMS ID (provide either id or recipient) |
recipient * |
string |
Recipient phone number (provide either id or recipient). Example: 0912345678 or 912345678 |
country_code * |
string |
Recipient country code (required when using recipient) |
from |
string |
Start time of the query range. Example format: 2019-12-15T08:38:32ZPlease ensure the datetime is in UTC+0. |
If from is not provided, a default value will be applied:- If to is specified, from defaults to one month before to.- If to is not specified, from defaults to one month before today. |
||
to |
string |
End time of the query range. Example format: 2019-12-25T08:38:32ZPlease ensure the datetime is in UTC+0. |
If to is not provided, a default value will be applied:- If from is specified, to defaults to one month after from.- If from is not specified, to defaults to today. |
||
status |
string |
Event type, one of: ・accept ・delivery ・bounce Multiple values can be selected, separated by commas ,. |
Response Properties
| Field | Type | Description |
|---|---|---|
messageId |
string |
SMS ID |
recipient |
string |
Recipient |
address |
string |
Recipient phone number |
countryCode |
string |
Recipient country code |
status |
string |
Event type, one of: ・accept ・delivery ・bounce |
content |
string |
SMS content |
eventTime |
string |
Event timestamp |
alive_mins |
number |
Retry duration in minutes. Valid range: 5–480. If not specified, defaults to the minimum. Values below the minimum or above the maximum are treated as the minimum or maximum respectively. A longer alive_mins maximizes delivery success, but you must wait until alive_mins expires before receiving the final webhook result. Set this value according to your use case’s real-time requirements. |
variables |
object |
Recipient variables |
rawEvent.point |
string |
Billing units (message segments) |
rawEvent.srcaddr |
string |
Sender phone number |
rawEvent.code |
string |
Bounce code |
rawEvent.reason |
string |
Bounce reason |
Notes
-
Only data within the past 30 days can be queried. If the results exceed 50 records, only the first 50 will be returned. To retain complete event records, please refer to the Add/Update Webhook section to configure a Webhook in advance and store events in your own system.
-
If both
idandrecipientare provided in the URI Parameters,idtakes priority.
- id
string(optional) Example: 20191217065433-0-08d0c68d-bd83-422b-9457-8cc7f0804ab7SMS ID
- recipient
string(optional) Example: 0912345678Recipient phone number
- country_code
string(optional) Example: 886Recipient country code
- from
string(optional) Example: 2019-12-15T08:38:32ZStart datetime
Format:2019-12-15T08:38:32Z
Note: Please ensure the datetime is inUTC+0- to
string(optional) Example: 2019-12-25T08:38:32ZEnd datetime
Format:2019-12-25T08:38:32Z
Note: Please ensure the datetime is inUTC+0- status
string(optional) Example: accept,deliveryEvent type
accept
retry
delivery
open
click
bounce
complaint
Query Exclusive Numbers ¶
Headers
Content-Type: application/json
Accept: application/json
x-api-key: Your API KeyHeaders
Content-Type: application/jsonBody
{
"phoneNumbers": [
{
"phoneNumber": "0988777666",
"createDate": "2019-03-05T08:19:26Z`",
"updateDate": "2019-03-05T09:31:26Z`",
},
{
"phoneNumber": "0911222333",
"createDate": "2019-04-05T08:19:26Z`",
"updateDate": "2019-04-05T09:31:26Z`",
}
]
}Query Exclusive NumbersGET/v1/sms/exclusive-number
Description
This service is available to users who have a dedicated phone number assigned. Sending SMS from a dedicated number helps recipients recognize your brand and reduces the risk of phishing. For inquiries about applying for a dedicated number, please contact us.
Response Properties
| Field | Type | Description |
|---|---|---|
phoneNumber |
string |
Exclusive phone number |
createDate |
string |
Creation time |
updateDate |
string |
Last updated time |
