Deliverlies
Regular delivery
URL
https://api.sendcloud.net/apiv2/mail/send
HTTP Request Method
post
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
from | string | yes | sender email address, e.g.support@ifaxin.com , After you configure DMARC, SendCloud will take current domain as the suffix of “from”. What is DMRC? |
to | string | * | Recipient’s email addresses, separated by semicolons, e.g.ben@ifaxin.com;joe@ifaxin.com |
subject | string | yes | subject, cannot be empty |
html | string | * | email content, formatted with text/html |
contentSummary | string | * | content summary. When adding content summary,, if content summary already exists, the former one will be replaced by the most current summary; if not, the content summary will be added to the email. For more details,click HERE |
fromName | string | no | sender name, shown as:ifaxin客服支持<support@ifaxin.com> |
cc | string | no | cc addresses, separated by semicolons |
bcc | string | no | bcc addresses, separated by semicolons |
replyTo | string | no | default reply addresses, separated by semicolons, cannot be more than 3. If “reply To” does not exist or is null, reply address defaults to “from” |
labelName | sting | no | The label name used for this send. If this label name is not saved in the account, it will be created automatically. |
headers | string | no | header of email, in JSON format, e.g.{"header1": "value1", "header2": "value2"} |
attachments | file | no | email attachment; when sending attachment, it must be submitted with “multipart/form – data” in “post” (form submission) |
xsmtpapi | string | no | SMTP extension, see X-SMTPAPI for more |
plain | string | no | email content, formatted with text/plain |
sendRequestId | string | no | supports up to 128 characters, multiple requests with the same sendRequestId within 1 hour will only be processed for the first time |
respEmailId | string (true, false) | no | default value: true . Whether returns to emailId. With multiple recipients, return to the list of emailId |
useNotification | string (true, false) | no | default value: false, whether notification is needed |
useAddressList | string (true, false) | no | default value: false, whether to use address list. For example, to=group1@maillist.sendcloud.org;group2@maillist.sendcloud.org |
Note:
- Assuming that “from” is
爱发信支持<support@ifaxin.com>
.If “fromName” is empty, “爱发信支持” will be set as “fromName”; if not, no processing is needed. - When sending emails with address lists, specify lists with parameter “to”. Each address included in the email will be sent individually. Address lists cannot be more than 5. cc, bcc and xsmtpapi turn to invalid now.
- When sending emails without address list, designate recipients with “to”. Multiple recipients are sent through multi-transmission (all recipients will be displayed). Designate cc recipients with parameter “cc”, and bcc recipients with “bcc”.
- When sending emails without address list, specify recipients with xsmtpapi. Multiple recipients are sent individually. Parameters “to”, “cc” and “bcc” turn to invalid now.
- Recipients of “to”, “cc” and “bcc” cannot be more than 100; recipients of “to” in xsmtpapi cannot be more than 100.
- “html” and “plain” cannot be both empty. If both “html” and “plain” are not empty, “html” is in priority.
- Variable is allowed in subject, html and plains. As special character, “%” needs to be processed in HTTP request.
- When using return receipt, recipients can choose whether to send reading receipt to “from” after receiving emails.
- If a “Key” in headers starts with “SC-Custom-“, then the “Key: value” will be returned to users via WebHook. when using the address list (useAddressList = true), the headers should not exceed 1024 bytes.
- “contentSummary” can only be used with “html”; value of “contentSummary” will be invalid without the value of “html”.
- Please do not include special characters such as
%
,$
,#
,*
etc - The total size of API attachments is 10M by default. Please contact customer service for special needs.
- The parameter xsmtpapi supports the user to specify the unsubscribe style page_ If you pass this parameter, the unsubscribe link and unsubscribe page are all set in the matching language and style. See X-SMTPAPI for details
- Parameter to, cc, and bcc supported format such as :
爱发信支持<support@ifaxin.com>
.
Template delivery
URL
https://api.sendcloud.net/apiv2/mail/sendtemplate
HTTP Request Method
post
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
from | string | yes | sender email address, e.g.support@ifaxin.com .After you configure DMARC, SendCloud will take current domain as the suffix of “from”. What is DMRC? |
to | string | * | address list, used when useAddressList=true |
xsmtpapi | string | * | SMTP extension, see X-SMTPAPI for more |
subject | string | * | subject |
templateInvokeName | string | yes | calling name of email template |
contentSummary | string | * | content summary. When adding content summary, if content summary already exists, the former one will be replaced by the most current content summary; if not, the content summary will be added to the email. For more details,click HERE |
fromName | string | no | sender name, shown as: ifaxin客服支持<support@ifaxin.com> |
cc | string | no | cc addresses, separated by semicolons |
bcc | string | no | bcc addresses, separated by semicolons |
replyTo | string | no | default reply addresses, separated by semicolons, cannot be more than 3. If “reply To” does not exist or is null, reply address defaults to “from” |
labelName | sting | no | The label name used for this send. If this label name is not saved in the account, it will be created automatically. |
headers | string | no | header of email, in JSON format, e.g. {"header1": "value1", "header2": "value2"} |
sendRequestId | string | no | supports up to 128 characters, multiple requests with the same sendRequestId within 1 hour will only be processed for the first time |
attachments | file | no | email attachment; when sending attachment, it must be submitted with “multipart/form – data” in “post” (form submission) |
respEmailId | string (true, false) | no | default value: true . Whether return to emailId. With multiple recipients, return to the list of emailId |
useNotification | string (true, false) | no | default value:: false . whether notification is needed |
useAddressList | string (true, false) | no | default value:: false . whether to use address list. For example, to=group1@maillist.sendcloud.org;group2@maillist.sendcloud.org |
Note:
- Assuming that “from” is
爱发信支持<support@ifaxin.com>
.If “fromName” is empty, “爱发信支持” will be set as “fromName”; if not, no processing is needed. - When sending emails with address lists, specify lists with parameter “to”. Each address in the email will be sent individually. Address list cannot be more than 5. xsmtpapi turn to invalid now.
- When sending emails without address list, designate recipients with “to”. Multiple recipients are sent through multi-transmission (all recipients will be displayed). Designate cc recipients with parameter “cc”, and bcc recipients with “bcc”.
- When sending the address list, use xsmtpapi to specify the recipients. Multiple recipients are sent separately At this time, the parameters to, cc and bcc are invalid.
- Recipients of “to”, “cc” and “bcc” cannot be more than 100; recipients of “to” in xsmtpapi cannot be more than 100.
- Email subject defaults to the topic of emails. If both are empty, an error is received.
- Variable. is allowed in subject, html and plain. As special character, “%” needs to be processed in HTTP request.
- When using return receipt, recipients can choose whether to send reading receipt to “from” after receiving emails.
- If a “Key” in headers starts with “SC-Custom-“, then the “Key: value” will be returned to users via WebHook. when using the address list (useAddressList = true), the headers should not exceed 1024 bytes.
- Please do not include special characters such as
%
,$
,#
,*
etc - The parameter xsmtpapi supports the user to specify the unsubscribe style page_ If you pass this parameter, the unsubscribe link and unsubscribe page are all set in the matching language and style. See X-SMTPAPI for details
- Parameter to, cc, and bcc supported format such as :
爱发信支持<support@ifaxin.com>
.
Samples of request and returned value
Regular delivery (call template ifaxin_bill)
# 模板内容
亲爱的%name%:
您好! 您本月在爱发信的消费金额为: %money% 元.
#---------------------------------------------------
# 调用模板发送, `%`需要 urlencode
curl -d 'apiUser=***&apiKey=***&from=test@test.com&fromName=liubida&subject=测试&replyTo=reply@test.com&templateInvokeName=ifaxin_bill' --data-urlencode 'xsmtpapi={"to": ["ben@ifaxin.com", "joe@ifaxin.com"],"sub":{"%name%": ["Ben", "Joe"],"%money%":[288, 497]}}&headers={"header1": "value1", "header2": "value2"}' https://api.sendcloud.net/apiv2/mail/sendtemplate
# 返回值
{
"statusCode": 200,
"info": {
"emailIdList": [
"1447054895514_15555555_32350_1350.sc-10_10_126_221-inbound0$ben@ifaxin.com",
"1447054895514_15555555_32350_1350.sc-10_10_126_221-inbound1$joe@ifaxin.com"
]
},
"message": "请求成功",
"result": true
}
# ben@ifaxin.com 收到的邮件:
亲爱的Ben:
您好! 您本月在爱发信的消费金额为: 288 元.
#---------------------------------------------------
# joe@ifaxin.com 收到的邮件:
亲爱的Joe:
您好! 您本月在爱发信的消费金额为: 497 元.
Regular delivery (call template ifaxin_bill, call address list user@maillist.sendcloud.org)
curl -d 'apiUser=***&apiKey=***&from=test@test.com&fromName=liubida&to=noexist@maillist.sendcloud.org&subject=测试&replyTo=reply@test.com&templateInvokeName=ifaxin_bill&useAddressList=true' --data-urlencode 'headers={"header1": "value1", "header2": "value2"}' http://api.sendcloud.net/apiv2/mail/sendtemplate
# 返回值
{
"statusCode": 40863,
"info": {},
"message": "to中有不存在的地址列表. 参数to: noexist@maillist.sendcloud.org",
"result": false
}
curl -d 'apiUser=***&apiKey=***&from=test@test.com&fromName=liubida&to=users@maillist.sendcloud.org&subject=测试&replyTo=reply@test.com&templateInvokeName=ifaxin_bill&useAddressList=true' --data-urlencode 'headers={"header1": "value1", "header2": "value2"}' http://api.sendcloud.net/apiv2/mail/sendtemplate
# 返回值
{
"statusCode": 40821,
"info": {
"maillistTaskId": [
267131
]
},
"message": "地址列表任务创建成功",
"result": true
}
Send meeting calendar
URL
https://api.sendcloud.net/apiv2/mail/sendcalendar
HTTP Request Method
post
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
from | string | yes | sender email address, e.g. support@ifaxin.com ,After you configure DMARC, SendCloud will take current domain as the suffix of “from”. What is DMRC? |
to | string | * | recipient email addresses, separated by semicolons, e.g. ben@ifaxin.com;joe@ifaxin.com |
subject | string | yes | subject, cannot be empty |
html | string | * | email content, formatted with text/html |
fromName | string | no | sender name, shown as: ifaxin客服支持<support@ifaxin.com> |
cc | string | no | cc addresses, separated by semicolons |
bcc | string | no | bcc addresses, separated by semicolons |
replyTo | string | no | default reply addresses, separated by semicolons, cannot be more than 3. If “reply To” does not exist or is null, reply address defaults to “from” |
dispositionNotificationTo | not supported | ||
labelName | sting | no | The label name used for this send. If this label name is not saved in the account, it will be created automatically. |
headers | string | no | header of email, in JSON format, e.g. {"header1": "value1", "header2": "value2"} |
attachments | file | no | email attachment; when sending attachment, it must be submitted with “multipart/form – data” in “post” (form submission) |
xsmtpapi | string | no | SMTP extension, see X-SMTPAPI for more |
plain | string | no | email content, formatted with text/plain |
sendRequestId | string | no | supports up to 128 characters, multiple requests with the same sendRequestId within 1 hour will only be processed for the first time |
respEmailId | string (true, false) | no | default value: true . Whether return to emailId. With multiple recipients, return to the list of emailId |
useAddressList | not supported | ||
startTime | string | yes | start time, formatted with: yyyy-MM-dd HH:mm:ss |
endTime | string | yes | end time, formatted with: yyyy-MM-dd HH:mm:ss |
title | string | yes | meeting title |
organizerName | string | yes | organizer name |
organizerEmail | string | yes | organizer email address |
location | string | yes | meeting location |
description | string | no | meeting description |
participatorNames | string | no | names of participants, separated by semicolons |
participatorEmails | string | no | email addresses of participants, separated by semicolons |
uid | string | no | uid parameter needs to be passed around when cancelling or updating calendar. Its value will be returned to users upon the first request of sending email calendar |
isCancel | string (true, false) | no | default value: false . Cancel calendar |
isUpdate | string (true, false) | no | default value: false . Update calendar |
Note:
- Assuming that “from” is
爱发信支持<support@ifaxin.com>
. 如果 fromName 为空, 则系统会将 fromName 设置为"爱发信支持"; 如果 fromName 为非空, 则不作处理. - If “fromName” is empty, “爱发信支持” will be set as “fromName”; if not, no processing is needed.
- When sending emails with address lists, specify lists with parameter “to”. Each address in the email will be sent individually. Address list cannot be more than 5. cc, bcc and xsmtpapi turn to invalid now.
- When sending emails without address list, specify recipients with xsmtpapi. Multiple recipients are sent individually. Parameters “to”, “cc” and “bcc” turn to invalid now.
- Recipients of “to”, “cc” and “bcc” cannot be more than 100; recipients of “to” in xsmtpapi cannot be more than 100.
- “html” and “plain” cannot be both empty . If both “html” and “plain” are not empty, “html” is in priority.
- Variable is allowed in subject, html and plain. As special character, “%” needs to be processed in HTTP request.
- “participatorNames”, “participatorEmails” represent all participants. Generally, recipients need to be include.
- Please contact customer service for relevant permission before using the interface.
Task info
URL
https://api.sendcloud.net/apiv2/mail/taskinfo
Query address list task
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
maillistTaskId | int | yes | returned maillistTaskId |
Request Example
https://api.sendcloud.net/apiv2/label/update?apiUser=***&apiKey=***&maillistTaskId=1
Returned value description
Parameter | Description |
---|---|
maillistTaskId | returned maillistTaskId |
apiUser | called apiUser |
addressList | called alias of address list |
memberCount | count of addresses |
gmtCreated | creation time |
gmtUpdated | modification time |
status | request status of address list |
Example of Returned value
{
"result": true,
"statusCode": 200,
"message": "请求成功",
"info": {
"data": {
"maillistTaskId": ***,
"apiUser": "***",
"addressList": "***",
"memberCount": 300,
"gmtCreated": "2015-11-26 14:38:09",
"gmtUpdated": "2015-11-26 14:38:23",
"status": "请求完毕"
}
}
}