Alibaba CloudAlibaba Cloud
Direct Mail
API Reference
Document Version: 20220402
Alibaba CloudAlibaba Cloud
Direct Mail
API Reference
Document Version: 20220402
Legal disclaimer
Alibaba Cloud reminds you t o carefully read and fully underst and t he terms and condit ions of t his legal
disclaimer before you read or use t his document . If you have read or used this document , it shall be deemed
as your t ot al accept ance of t his legal disclaimer.
1. You shall download and obtain this document from the Alibaba Cloud websit e or ot her Alibaba Cloud-
aut horized channels, and use this document for your own legal business act ivit ies only. The cont ent of
t his document is considered confident ial informat ion of Alibaba Cloud. You shall st rict ly abide by t he
confident ialit y obligations. No part of t his document shall be disclosed or provided t o any third part y for
use wit hout t he prior writ t en consent of Alibaba Cloud.
2. No part of t his document shall be excerpt ed, t ranslat ed, reproduced, transmit t ed, or disseminat ed by
any organization, company or individual in any form or by any means wit hout the prior writ t en consent of
Alibaba Cloud.
3. The cont ent of t his document may be changed because of product version upgrade, adjust ment , or
other reasons. Alibaba Cloud reserves t he right to modify the cont ent of t his document wit hout not ice
and an updat ed version of t his document will be released through Alibaba Cloud-aut horized channels
from t ime to t ime. You should pay at t ent ion to t he version changes of t his document as t hey occur and
download and obt ain the most up-t o-dat e version of t his document from Alibaba Cloud-aut horized
channels.
4. This document serves only as a reference guide for your use of Alibaba Cloud products and services.
Alibaba Cloud provides t his document based on t he "st at us quo", "being defect ive", and "exist ing
funct ions" of it s product s and services. Alibaba Cloud makes every effort t o provide relevant operat ional
guidance based on exist ing t echnologies. However, Alibaba Cloud hereby makes a clear st at ement that
it in no way guarant ees t he accuracy, int egrit y, applicabilit y, and reliabilit y of t he cont ent of t his
document , eit her explicit ly or implicit ly. Alibaba Cloud shall not t ake legal responsibilit y for any errors or
lost profit s incurred by any organization, company, or individual arising from download, use, or t rust in
t his document . Alibaba Cloud shall not , under any circumst ances, t ake responsibilit y for any indirect,
consequent ial, punit ive, cont ingent , special, or punit ive damages, including lost profit s arising from t he
use or t rust in t his document (even if Alibaba Cloud has been not ified of t he possibilit y of such a loss).
5. By law, all t he cont ent s in Alibaba Cloud document s, including but not limit ed t o pictures, archit ect ure
design, page layout , and text description, are int ellect ual propert y of Alibaba Cloud and/or it s
affiliat es. This int ellect ual propert y includes, but is not limit ed to, t rademark right s, pat ent right s,
copyright s, and t rade secret s. No part of t his document shall be used, modified, reproduced, publicly
t ransmit t ed, changed, disseminat ed, dist ribut ed, or published wit hout t he prior writ t en consent of
Alibaba Cloud and/or it s affiliates. The names owned by Alibaba Cloud shall not be used, published, or
reproduced for market ing, advertising, promot ion, or ot her purposes wit hout t he prior writ t en consent of
Alibaba Cloud. The names owned by Alibaba Cloud include, but are not limit ed to, "Alibaba Cloud",
"Aliyun", "HiChina", and ot her brands of Alibaba Cloud and/or it s affiliat es, which appear separat ely or in
combinat ion, as well as t he auxiliary signs and patt erns of t he preceding brands, or anyt hing similar to
t he company names, t rade names, trademarks, product or service names, domain names, pat t erns,
logos, marks, signs, or special descriptions t hat t hird part ies ident ify as Alibaba Cloud and/or it s
affiliat es.
6. Please direct ly cont act Alibaba Cloud for any errors of t his document .
Direct Mail API Reference··Legal disclaimer
> Document Version: 20220402 I
Document conventions
St yleSt yle Descript io nDescript io n ExampleExample
DangerDanger
A danger notice indicates a situation that
will cause major system changes, faults,
physical injuries, and other adverse
results.
Danger:Danger:
Resetting will result in the loss of user
configuration data.
WarningWarning
A warning notice indicates a situation
that may cause major system changes,
faults, physical injuries, and other adverse
results.
Warning:Warning:
Restarting will cause business
interruption. About 10 minutes are
required to restart an inst ance.
No t iceNot ice
A caution notice indicates warning
information, supplementary instructions,
and ot her content that the user must
understand.
No t ice:Not ice:
If the weight is set to 0, the server no
longer receives new requests.
No t eNot e
A note indicates supplemental
instructions, best practices, tips, and
other content.
No t e:Not e:
You can use Ctrl + A to select all files.
>
Closing angle brackets are used to
indicate a multi-level menu cascade.
Click Set t ingsSet t ings > Net w orkNet wo rk> Set net workSet net w ork
t ypet ype .
Bo ldBold
Bold formatting is used for buttons ,
menus, page names, and other UI
elements.
Click OKOK.
Courier font Courier font is used for commands
Run the cd /d C:/window command to
enter the Windows system folder.
Italic
Italic formatt ing is used for parameters
and variables.
bae log list --instanceid
Instance_ID
[] or [a|b]
This format is used for an optional value,
where only one item can be selected.
ipconfig [-all|-t]
{} or {a|b}
This format is used for a required value,
where only one item can be selected.
swit ch {active|stand}
Direct Mail
API Reference··Document convent io
ns
> Document Version: 20220402 I
Table of Contents
1.Introduction
2.API overview
3.Call Method
3.1. Summary
3.2. Request
3.3. Public parameters
3.5. Signature
4.Send emails
4.1. SingleSendMail
4.2. BatchSendMail
5.Query account information
5.1. DescAccountSummary
6.Manage domain names
6.1. CheckDomain
6.2. CreateDomain
6.3. DescDomain
6.4. ModifyPWByDomain
6.5. QueryDomainByParam
7.Manage sender addresses
7.1. ApproveReplyMailAddress
7.2. CheckReplyToMailAddress
7.3. CreateMailAddress
7.4. DeleteMailAddress
7.5. ModifyMailAddress
8.Manage recipients
06
07
08
08
08
08
11
12
17
17
20
23
23
26
26
28
29
32
34
38
38
39
41
43
45
47
Direct Mail API Reference··Table of Cont ent s
> Document Version: 20220402 I
8.1. CreateReceiver
8.2. DeleteReceiverDetail
8.3. DeleteReceiver
9.Manage tags
9.1. CreateTag
9.2. DeleteTag
9.3. ModifyTag
10.Error codes
11.New API
11.1. domain Operation
11.2. send mail operation
11.3. receiver operation
11.4. tag operation
47
48
50
53
53
54
55
57
58
58
65
73
78
API Reference··Table of Cont ent s Direct Mail
II > Document Version: 20220402
Welcome to Alibaba Cloud DirectMail. This document describes the APIs used to perform operations on
Direct Mail.
Before using these int erfaces, make sure that you have fully understood the DirectMail product
instructions, usage agreements, and billing methods.
GlossaryGlossary
T erminologyT erminology EnglishEnglish Descript ionDescript ion
AccountName Email address
Sender addresses must be
creat ed on the console, and the
sender addresses must be
verified by Alibaba Cloud
DirectMail.
Template Email template
An email template must be
creat ed in advance for sending
batch emails.
Receiver Recipient list
A recipient list must be created in
advance for sending batch
emails.
Description of business resource type restrictionsDescription of business resource type restrictions
Direct Mail imposes rest rictions on the number of sender addresses, email templates, recipient lists, and
sending emails of every account . When using DirectMail API, see the latest business rest rictions and
resource type restrictions on t he official websit e: Limits.
If any conflicts appear between the API description section and the resource or specification
constraints given on the official websit e concerning optional parameter values or available
specifications, the information on the official websit e prevails.
1.Introduction1.Introduction
Direct Mail API Reference··Int roduct ion
> Document Version: 20220402 6
Email sending related interfacesEmail sending related interfaces
APIAPI Descript ionDescript ion
SingleSendMail
The sending interface for single emails. It supports
sending triggered emails and other emails.
BatchSendMail
The sending interface for sending batch emails. It
supports sending batch emails by calling email
templates.
2.API overview2.API overview
API Reference··API overview Direct Mail
7 > Document Version: 20220402
To call the Direct Mail API, you send an HTT P GET/POST request to the Direct Mail API server and ent er
the corresponding request parameters according to the instructions. The system returns the handling
results based on t he request handling stat us.
For more information, see:
Request st ructure.
Public parameter.
Response result.
Signature mechanism.
Service addressService address
The DirectMail API service access address:
China East 1: dm.aliyuncs.com
Asia Pacific SE 1 (Singapore): dm.ap-southeast-1.aliyuncs.com
Asia Pacific SE 2 (Sydney): dm.ap-southeast-2.aliyuncs.com
Communication protocolCommunication protocol
Request communication over HTTP or HTTPS is supported. HTTPS channel is recommended because it
provides higher security.
Request methodsRequest methods
The system supports HTTP GET request s. In t his method, you must include the request parameters in
the request URL. The system supports HTT P POST request s. In t his method, you must include the
request parameters in the request body.
Request parametersRequest parameters
For each request , the Action parameter (for example, SingleSendMail), must be specified. Each
action must contain the public request parameters and the specific request parameters of the specified
operat ion.
Character encodingCharacter encoding
Requests and returned results are both encoded using the UTF-8 charact er set.
Public request parametersPublic request parameters
Public request parameters refer to the request parameters that every int erface uses.
3.Call Method3.Call Method
3.1. Summary3.1. Summary
3.2. Request3.2. Request
3.3. Public parameters3.3. Public parameters
Direct Mail API Reference··Call Method
> Document Version: 20220402 8
NameName T ypeT ype
Required?Required?
Descript ionDescript ion
Format String No
Type of response
values. JSON and XML
are supported. XML is
the default format.
Version String Yes
API version number. T he
format is in the form of
YYYY-MM-DD. T he
version number is 2015-
11-23 if RegionID is cn -
hangzhou. The version
number is 2017-06-22 if
RegionID is not cn -
hangzhou, such as ap -
southeast - 1.
AccessKeyId String Yes
The AccessKeyId that
Alibaba Cloud issues to
a user for accessing
services.
Signature String Yes
The signature result
string. See Signature for
the signature
calculation method.
SignatureMethod String Yes
The signature method.
HMAC-SHA1 is currently
supported.
API Reference··Call Method Direct Mail
9 > Document Version: 20220402
Timestamp String Yes
The request’s
timestamp. T he dat e
format follows the
ISO8601 standard and
adopts the UT C time.
Format: YYYY-MM-
DDThh:mm:ssZ. For
example: 2015-11-
23T04:00:00Z (for
12:00:00 on November
23, 2015, Beijing time).
SignatureVersion String Yes
Signature algorithm
version. T he current
version is 1.0.
SignatureNonce String Yes
A unique random
number. It is used to
prevent replay attacks.
Different random
numbers must be used
for different requests.
RegionId String Yes
Data center
information. cn-
hangzhou, ap-
southeast-1 and ap-
southeast-2 are
currently supported.
NameName T ypeT ype
Required?Required?
Descript ionDescript ion
ExampleExample
Direct Mail API Reference··Call Method
> Document Version: 20220402 10
https://dm.aliyuncs.com/
?Format=xml
&Version=2015-11-23
&Signature=Pc5WB8gokVn0xfeu%2FZV%2BiNM1dgI%3D
&SignatureMethod=HMAC-SHA1
&SignatureNonce=e1b44502-6d13-4433-9493-69eeb068e955
&SignatureVersion=1.0
&AccessKeyId=key-test
&Timestamp=2015-11-23T12:00:00Z
Public return parametersPublic return parameters
The system returns a unique identification code (RequestId) each time you send a request to call an
interface, no matter whether the call succeeds or not.
ExampleExample
XML exampleXML example
<?xml version="1.0" encoding="UTF-8"?>
<!--Result root node-->
<Interface name + Response>
<!--Return request tag-->
<RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId>
<!--Return result data-->
</Interface name + Response>
JSON exampleJSON example
{
"RequestId": "4C467B38-3910-447D-87BC-AC049166F216"
/* Return result data*/
}
After the API service is called, the returned data is in a unified format.
The returned HT TP status code 2xx indicates that the call is successful.
The returned HT TP status code 4xx or 5xx indicates that the call failed.
The formats of returned data from successful calls are mainly XML and JSON. An external system can
pass in parameters during requesting to specify the format of t he returned data. XML is the default
format.
The formats in the examples in t his document are adjusted for viewing convenience. The actual
returned results have no line breaks, indentation, or ot her layouts.
Successful resultsSuccessful results
XML exampleXML example
3.4. Returned results3.4. Returned results
API Reference··Call Method Direct Mail
11 > Document Version: 20220402
<?xml version="1.0" encoding="UTF-8"?>
<!--Result root node-->
<Interface name + Response>
<!--Return request tag-->
<RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId>
<!--Return result data-->
</Interface name + Response>
JSON exampleJSON example
{
"RequestId": "4C467B38-3910-447D-87BC-AC049166F216"
/* Return result data*/
}
Error resultsError results
When an error occurs in an int erface call, no result data returns. You can pinpoint the causes of the error
based on the error codes corresponding to each interface and the public error codes that are listed in
Error codes.
When an error occurs in a call, an HTTP stat us code of 4xx or 5xx will be returned. The returned message
body contains the specific error code and error message. The message body also contains a globally
unique Request Id and the requested HostId. If you cannot find the error cause, you can contact Alibaba
Cloud customer service and provide the HostId and Request Id to help us solve the problem as quickly as
possible.
XML exampleXML example
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<RequestId>8906582E-6722-409A-A6C4-0E7863B733A5</RequestId>
<HostId>dm.aliyuncs.com</HostId>
<Code>InvalidTemplate.NotFound</Code>
<Message>The specified template is not found.</Message>
</Error>
JSON exampleJSON example
{
"RequestId": "8906582E-6722-409A-A6C4-0E7863B733A5",
"HostId": "dm.aliyuncs.com",
"Code": "InvalidTemplate.NotFound",
"Message": "The specified template does not found."
}
Not e:Not e:
If SDK is used, signature is not required. Currently, Java, PHP, and C# SDKs have been provided.
3.5. Signature3.5. Signature
Direct Mail API Reference··Call Method
> Document Version: 20220402 12
Interfaces support GET and POST request s, but the StringToSigns of a GET request and a POST
request are different.
Direct Mail service performs sender authent ication for each access request. Therefore, whether HTTP or
HT TPS protocol is used to submit a request , t he request must contain the signature information.
Direct Mail performs symmetric encryption to aut henticate the request sender using the AccessKeyId and
AccessKeySecret. The AccessKeyId and AccessKeySecret are officially issued to visitors by Alibaba Cloud
(visitors can apply for and manage them on t he Alibaba Cloud official websit e). The AccessKeyId
indicates the ident ity of the visit or. The AccessKeySecret is the secret key to encrypt the signature
string and verify the signature string on t he server. The AccessKeySecret must be kept strictly
confidential and only be known to Alibaba Cloud and the authenticated visit or.
ProcedureProcedure
The following method is used to sign the access request:
1. Construct Canonicalized Query String using the request parameters.
i. Order all the request parameters (including the public request parameters and custom
parameters for the given request interfaces described in this document, but excluding the
Signature parameter mentioned in public request parameters) alphabetically by parameter
names.
Not e:Not e: When a request is submit ted using the GET method, these parameters constitut e the
parameter section of the request URI (t hat is, the section in the URI following ? and
connect ed by & ).
ii. T he name and value of each request parameter are encoded. The names and values must
adopt URL encoding in the UT F-8 character set. The URL encoding rules are as follows:
The charact ers A-Z, a-z, 0-9, - , _ , . , and ~ are not encoded;
Ot her characters are encoded in the %XY format, with XY representing the charact ers
ASCII code in hexadecimal notat ion. For example, the English double quotes " are
encoded as %22 .
Extended UTF-8 characters are encoded in the %XY%ZA... format;
The English space is encoded as %20 , rather than the plus sign + .
Not e:Not e: Generally, libraries that support URL encoding (such as java.net.URLEncoder in
Java) are all encoded following the rules for the application/x-www-form-urlencoded
MIME type. This encoding method can apply directly during implementation, namely
replacing the plus signs + in the encoded strings with %20 , the asterisks * with
%2A , and change %7E back to the tilde ~ to conform to the encoding rules.
iii. Connect the encoded parameter names and values with the English equal sign = .
API Reference··Call Method Direct Mail
13 > Document Version: 20220402
iv. Connect the parameter name and value pairs connect ed by equal signs alphabetically with the
ampersand & to produce the Canonicalized Query String.
2. Follow the following rules to construct the st ring for signature calculation using the Canonicalized
Query String constructed in the previous step:
StringToSign=
HTTPMethod + "&" +
percentEncode("/") + "&" +
percentEncode(CanonicalizedQueryString)
Here, HTTPMethod is the HTTP method used for request submission, for example, GET or POST.
percentEncode (“/“) is the encoded value for the character / according to the URL encoding
rules, namely %2F .
percentEncode (CanonicalizedQueryString) is the encoded st ring of the Canonicalized Query String
constructed in step 1, produced by t he URL encoding rules.
3. Based on the RFC2104 definit ion, the signature string is used to calculate the signature’s HMAC
value.
Not e:Not e: The Key used for signature calculation is the AccessKeySecret with a&” character
(ASCII:38) added in the end, and the SHA1 hashing algorit hm is used.
4. Encode the HMAC value into a st ring based on Base64 encoding rules, and you can get the
signature value (Signature).
5. Add the obtained signature value to the request parameters as the Signature parameter. The
request signing process is completed.
Not e:Not e: URL encoding must be implemented for the obtained signature value based on the RFC3986 rule,
like in the case of other parameters, before the signature value is submitted to the DirectMail server as
the final request parameter value.
ExampleExample
Take sending a POST request for calling the SingleSendMail interface over HPPTS as an example.
The request URL is: ht tp://dm.aliyuncs.com/.
The parameters are:
AccessKeyId=testid&AccountName=<a%b'>&Action=SingleSendMail&AddressType=1&Format=XML&HtmlBo
dy=4&RegionId=cn-hangzhou&ReplyToAddress=true&SignatureMethod=HMAC-SHA1&SignatureNonce=c1b2
c332-4cfb-4a0f-b8cc-ebe622aa0a5c&SignatureVersion=1.0&Subject=3&TagName=2&Timestamp=2016-10
-20T06:27:56Z&ToAddress=1@test.com&Version=2015-11-23
Therefore, t he StringToSign is:
POST&%2F&AccessKeyId%3Dtestid%26AccountName%3D%253Ca%2525b%2527%253E%26Action%3DSingleSendM
ail%26AddressType%3D1%26Format%3DXML%26HtmlBody%3D4%26RegionId%3Dcn-hangzhou%26ReplyToAddre
ss%3Dtrue%26SignatureMethod%3DHMAC-SHA1%26SignatureNonce%3Dc1b2c332-4cfb-4a0f-b8cc-ebe622aa
0a5c%26SignatureVersion%3D1.0%26Subject%3D3%26TagName%3D2%26Timestamp%3D2016-10-20T06%253A2
7%253A56Z%26ToAddress%3D1%2540test.com%26Version%3D2015-11-23
Direct Mail API Reference··Call Method
> Document Version: 20220402 14
Suppose the AccessKeyId is testid , t he AccessKeySecret is testsecret ,and the Key used for
HMAC calculation is testsecret& , then the calculated signature value is:
llJfXJjBW3OacrVgxxsITgYaYm0=
The body content of the signed POST request from https://dm.aliyuncs.com/ .
Not e:Not e: t he Signature parameter added and the change in the request header Content-Type:
application/x-www-form-urlencoded.
Signature=llJfXJjBW3OacrVgxxsITgYaYm0&AccessKeyId=testid&AccountName=<a%b'>&Action=SingleSe
ndMail&AddressType=1&Format=XML&HtmlBody=4&RegionId=cn-hangzhou&ReplyToAddress=true&Signatu
reMethod=HMAC-SHA1&SignatureNonce=c1b2c332-4cfb-4a0f-b8cc-ebe622aa0a5c&SignatureVersion=1.0
&Subject=3&TagName=2&Timestamp=2016-10-20T06:27:56Z&ToAddress=1@test.com&Version=2015-11-23
The following codes are for your reference.
private static final String MAC_NAME ="HmacSHA1";
private static final String ENCODING ="UTF-8";
/**
* Use HMAC-SHA1 to encrypt the encryptText
*
*@param encryptText The string to be encrypted
*@param encryptKey The secret key
*@return
*@throws Exception
*/
public static byte[] HmacSHA1Encrypt(StringencryptText, String encryptKey) throwsException
{
byte[] data = encryptKey.getBytes(ENCODING);
//Construct the secret key according to the specified bytes, and the second parameter speci
fies the name of the key caculation.
SecretKey secretKey = new SecretKeySpec(data,MAC_NAME);
//Generate a MAC caculation object.
Mac mac = Mac.getInstance(MAC_NAME);
//Initialize the MAC object by the specified secret key.
mac.init(secretKey);
byte[] text = encryptText.getBytes(ENCODING);
//Complete the MAC caculation.
return mac.doFinal(text);
}
@Test
public void test() throws Exception {
/*StringToSign=
HTTPMethod +&” +
percentEncode(“/”) + ”&+
percentEncode(CanonicalizedQueryString*/
String str ="AccessKeyId=testid&AccountName=<a%b'>&Action=SingleSendMail&AddressType=1&Form
at=XML&HtmlBody=4&RegionId=cn-hangzhou&ReplyToAddress=true&SignatureMethod=HMAC"+
API Reference··Call Method Direct Mail
15 > Document Version: 20220402
at=XML&HtmlBody=4&RegionId=cn-hangzhou&ReplyToAddress=true&SignatureMethod=HMAC"+
"-SHA1&SignatureNonce=c1b2c332-4cfb-4a0f-b8cc-ebe622aa0a5c&SignatureVersion=1.0&Subject=3&T
agName=2&Timestamp=2016-10-20T06:27:56Z&ToAddress=1@test.com&Version=2015-11-23";
String percentStr = "";
String[] strs = str.split("&");
for (int i = 0; i < strs.length;i++) {
String[] str1 =strs[i].split("=");
if (str1.length == 1){
percentStr = percentStr + getUtf8Encoder(str1[0])+ "=" + getUtf8Encoder("")
+ "&";
}else {
percentStr = percentStr + getUtf8Encoder(str1[0])+ "=" + getUtf8Encoder(str
1[1]) + "&";
}
}
percentStr =percentStr.substring(0,percentStr.lastIndexOf("&"));
String percent = URLEncoder.encode("/","UTF-8");
percentStr = getUtf8Encoder(percentStr);
String toSign = HttpMethod.POST + "&"+ percent +"&" + percentStr;
System.out.println("--------------"+ toSign);
/*AccessKeyId%3Dtestid%26AccountName%3D%253Ca%2525b%2527%253E%26Action%3DSingleSendMail%26A
ddressType%3D1%26Format%3DXML%26HtmlBody%3D4%26RegionId%3Dcn-hangzhou%26ReplyToAddress%3Dtr
ue%26SignatureMethod%3DHMAC-SHA1%26SignatureNonce%3Dc1b2c332-4cfb-4a0f-b8cc-ebe622aa0a5c%26
SignatureVersion%3D1.0%26Subject%3D3%26TagName%3D2%26Timestamp%3D2016-10-20T06%253A27%253A5
6Z%26ToAddress%3D1%2540test.com%26Version%3D2015-11-23*/
byte[] bytes = HmacSHA1Encrypt(toSign,"testsecret&");
String base64Str = Base64.encode(bytes);
System.out.println(base64Str);//llJfXJjBW3OacrVgxxsITgYaYm0=
}
private String getUtf8Encoder(String param) throws UnsupportedEncodingException {
return URLEncoder.encode(param, "UTF-8")
.replaceAll("\\+","%20")
.replaceAll("\\*","%2A")
.replaceAll("%7E","~");
};
Direct Mail API Reference··Call Method
> Document Version: 20220402 16
DescriptionDescription
SingleSendMail interface is used for sending single emails.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
Operation interface
name, a syst em
required parameter.
Value: SingleSendMail.
AccountName String Required
The sender address
configured in the
console.
ReplyToAddress String Required
The reply-to address
(The status must be
“verified”) configured
in the console. Values:
“true”, “false”.
String Format instead
of Boolean.
AddressType Number Required
Value range: 0-1. 0
indicates a random
account, and 1 indicates
the sender address.
ToAddress String Required
The recipient address.
Multiple addresses can
be separated by
commas, and a
maximum of 100
addresses are
supported.
4.Send emails4.Send emails
4.1. SingleSendMail4.1. SingleSendMail
API Reference··Send emails Direct Mail
17 > Document Version: 20220402
FromAlias String Optional
Sender nickname. The
length of the nickname
must be shorter than 15
characters. For
example, the sender
nickname is set to
“Daisy”, and the
sender address is
“test@example.com”.
Recipients see the
address of
“‘Daisy’test@example.
com“.
Subject String Optional
Subject
(recommended).
HtmlBody String Optional Email body in HTML.
TextBody String Optional Email body in text.
ClickTrace String Optional
Value range: 0-1. 1
indicates enabling
recipient tracking. 0
indicates that not
enabling recipient
tracking. The default
value of this parameter
is 0.
NameName T ypeT ype Required?Required? Descript ionDescript ion
For other request parameters, see Public parameters.
Return parametersReturn parameters
For more information about public return parameters, see Public parameters.
Error codesError codes
Error codeError code Descript ionDescript ion HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidMailAddress.NotF
ound
The specified
mailAddress does not
exist.
400
The sender address
does not exist.
InvalidMailAddressStatu
s.Malformed
The specified
mailAddress status is
wrongly formed.
400
The sender address
status is incorrect.
InvalidT oAddress
The specified toAddress
is wrongly formed.
400
The recipient address is
incorrect.
Direct Mail API Referenc·Send emails
> Document Version: 20220402 18
InvalidBody
The specified textBody
or htmlBody is wrongly
formed.
400
The email body is
incorrect. The textBody
and htmlBody cannot
be empty at the same
time.
InvalidSendMail.Spam
Sendmail rejected by
spam filter.
400
This mailing is detected
as spam mailing by the
anti-spam system and
the email is forbidden
from being sent.
Carefully check the
email content and the
domain status.
InvalidSubject.Malforme
d
The specified subject is
wrongly formed.
400
The subject is limited
within 100 characters.
InvalidMailAddressDoma
in.Malformed
The specified
mailAddress domain
does not exist.
400
The domain status of
the sender address is
incorrect. Check the MX
and SPF configuration.
InvalidFromALias.Malfor
med
The specified fromAlias
is wrongly formed.
400
The sender nickname is
incorrect. Check the
sender nickname, which
must be shorter than 15
characters.
Error codeError code Descript ionDescript ion HT T P st at us codeHT T P st at us code MeaningMeaning
ExampleExample
Request exampleRequest example
https://dm.aliyuncs.com/?Action=SingleSendMail
&AccountName=test@example.com
&ReplyToAddress=true
&AddressType=1
&ToAddress=test1@example.com
&Subject=Subject
&HtmlBody=body
&<Public request parameter>
Response exampleResponse example
XML formatXML format
<SingleSendMailResponse>
<RequestId>12D086F6-8F31-4658-84C1-006DED011A85</RequestId>
</SingleSendMailResponse>
API Reference··Send emails Direct Mail
19 > Document Version: 20220402
JSON exampleJSON example
{
"RequestId": "12D086F6-8F31-4658-84C1-006DED011A85"
}
DescriptionDescription
BatchSendMail is used for sending bat ch emails.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
Operation interface
name, a syst em
required parameter.
Value: BatchSendMail.
AccountName String Required
The sender address
configured in the
console.
AddressType Number Required
Value range: 0-1. 0
indicates a random
address, and 1 indicates
the sender address.
TemplateName String Required
The name of the
template that is
creat ed and verified in
advance .
ReceiversName String Required
The name of the
recipient list that is
creat ed in advance and
uploaded with
recipients.
TagName String Optional The mail tag name.
ClickTrace String Optional
Value range: 0-1. 1
indicates enabling
recipient tracking. 0
indicates that not
enabling recipient
tracking. The default
value of this parameter
is 0.
For other request parameters, see Public parameters.
4.2. BatchSendMail4.2. BatchSendMail
Direct Mail API Referenc·Send emails
> Document Version: 20220402 20
Return parametersReturn parameters
For more information about public return parameters, see Public parameters.
Error codesError codes
Error codeError code Descript ionDescript ion HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidMailAddress.NotF
ound
The specified
mailAddress does not
exist.
400
The sender address
does not exist.
InvalidMailAddressStatu
s.Malformed
The specified
mailAddress status is
wrongly formed.
400
The sender address
status is incorrect.
InvalidMailAddressSend
Type.Malformed
The specified
mailAddress sendT ype
is wrongly formed.
400
The sender address
type is incorrect. Only
the bat ch-type sender
address is allowed.
InvalidReceiverName.Mal
formed
The specified receiver
name is wrongly
formed.
400
The recipient list name
is incorrect. T he list
does not exist or the
list is empty.
InvalidSendMail.Spam
Sendmail rejected by
spam filter.
400
This mailing is detected
as spam mailing by the
anti-spam system and
the email is forbidden
from being sent. Check
and optimize the email
content.
InvalidT emplateName.M
alformed
The specified template
name is wrongly
formed.
400
The template name is
incorrect.
InvalidMailAddressDoma
in.Malformed
The specified
mailAddress domain
does not exist.
400
The domain status of
the sender address is
incorrect. Check the
domain status, the
ownership, MX and SPF
configurations.
ExampleExample
Request exampleRequest example
API Reference··Send emails Direct Mail
21 > Document Version: 20220402
https://dm.aliyuncs.com/?Action=BatchSendMail
&AccountName=test@example.com
&AddressType=1
&TemplateName=test1
&ReceiversName=test2
&TagName=test3
&<Public request parameter>
Response exampleResponse example
XML formatXML format
<BatchSendMailResponse>
<RequestId>12D086F6-8F31-4658-84C1-006DED011A85</RequestId>
</BatchSendMailResponse>
JSON exampleJSON example
{
"RequestId": "12D086F6-8F31-4658-84C1-006DED011A85"
}
Direct Mail API Referenc·Send emails
> Document Version: 20220402 22
Queries the detailed information of an Alibaba Cloud account .
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype RequiredRequired ExampleExample Descript ionDescript ion
AccessKeyId String No your_accesskey_id
The AccessKey ID
provided to you
by Alibaba Cloud.
Action String Yes
DescAccountSum
mary
The operation
that you want to
perform. Set t he
value to
DescAccount SuDescAccount Su
mmarymmary.
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
DailyQuota Integer 2000
The maximum number
of emails that you can
send every day.
DayuStatus Integer 0
Indicates whether you
have enabled the Short
Message Service.
Domains Integer 1
The number of domain
names.
5.Query account information5.Query account information
5.1. DescAccountSummary5.1. DescAccountSummary
API Reference··Query account inform
at ion
Direct Mail
23 > Document Version: 20220402
EnableTimes Integer 0
Indicates how many
times you have enabled
the Direct Mail service.
MailAddresses Integer 0
The number of sender
addresses.
MaxQuotaLevel Integer 10
The highest privilege
level of users.
MonthQuota Integer 60000
The maximum number
of emails that you can
send every month.
QuotaLevel Integer 2
The current privilege
level.
Receivers Integer 0
The number of
recipients.
RequestId String
82B295BB-7E69-491F-
9896-ECEAFF09E1A4
The ID of the request.
Tags Integer 0 The number of tags.
Templates Integer 1
The number of
templates.
UserStatus
Integer 0
The status of the
account. Valid values: 0
to 3. 00: indicates that
your account is
available. 11: indicates
that your account is
frozen. 22: indicates that
you have overdue
payments. 33: indicates
that you cannot send
emails.
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
SamplesSamples
Direct Mail
API Reference··Query account inform
at ion
> Document Version: 20220402 24
Sample requests
http(s)://dm.aliyuncs.com/? Action=DescAccountSummary
&<Common request parameters>
Sample success responses
XML format
<DescAccountSummaryResponse>
<DayuStatus>0</DayuStatus>
<SmsRecord>0</SmsRecord>
<SmsSign>0</SmsSign>
<UserStatus>0</UserStatus>
<SmsTemplates>0</SmsTemplates>
<Templates>1</Templates>
<Domains>1</Domains>
<MonthQuota>60000</MonthQuota>
<Tags>0</Tags>
<QuotaLevel>2</QuotaLevel>
<EnableTimes>0</EnableTimes>
<RequestId>82B295BB-7E69-491F-9896-ECEAFF09E1A4</RequestId>
<MaxQuotaLevel>10</MaxQuotaLevel>
<MailAddresses>0</MailAddresses>
<DailyQuota>2000</DailyQuota>
<Receivers>0</Receivers>
</DescAccountSummaryResponse>
JSON format
{
"DayuStatus":0,
"SmsRecord":0,
"SmsSign":0,
"UserStatus":0,
"SmsTemplates":0,
"Templates":1,
"Domains":1,
"MonthQuota":60000,
"Tags":0,
"QuotaLevel":2,
"EnableTimes":0,
"RequestId":"82B295BB-7E69-491F-9896-ECEAFF09E1A4",
"MailAddresses":0,
"MaxQuotaLevel":10,
"Receivers":0,
"DailyQuota":2000
}
Error codesError codes
For a list of error codes, visit the API Error Center.
API Reference··Query account inform
at ion
Direct Mail
25 > Document Version: 20220402
Verifies a domain name.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype RequiredRequired ExampleExample Descript ionDescript ion
DomainId Integer Yes 153345
The ID of the
domain name.
AccessKeyId String No xx
The AccessKey ID
provided to you
by Alibaba Cloud.
Action String Yes CheckDomain
The operation
that you want to
perform. Set t he
value to
CheckDomainCheckDomain.
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
6.Manage domain names6.Manage domain names
6.1. CheckDomain6.1. CheckDomain
Direct Mail
API Reference··Manage domain nam
es
> Document Version: 20220402 26
DomainStatus Integer 1
The status of the
domain name. Indicates
whether the domain
name is verified and
available.
0: indicates that the
domain name is
verified and available.
1: indicates that the
domain name fails to
be verified and is
unavailable.
2: indicates that the
domain name is
available, but not
filed or configured
with a CNAME record.
3: indicates that the
domain name is
available but not
filed.
4: indicates that the
domain name is
available but not
configured with a
CNAME record.
RequestId String
F0B82E83-A1D9-4FE6-
97D2-F4B231F80B02
The ID of the request.
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=CheckDomain
&DomainId=153345
&<Common request parameters>
Sample success responses
XML format
<CheckDomainResponse>
<DomainStatus>1</DomainStatus>
<RequestId>F0B82E83-A1D9-4FE6-97D2-F4B231F80B02</RequestId>
</CheckDomainResponse>
API Reference··Manage domain nam
es
Direct Mail
27 > Document Version: 20220402
JSON format
{
"RequestId":"F0B82E83-A1D9-4FE6-97D2-F4B231F80B02",
"DomainStatus":1
}
Error codesError codes
For a list of error codes, visit the API Error Center.
Creat es a domain name.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
DomainName String Yes abc.com
The domain name. It must be 1 to 50
characters in lengt h and can contain
digits, letters, periods (.), and hyphens
(-).
AccessKeyId String No xxxx
The AccessKey ID provided to you by
Alibaba Cloud.
Action String No CreateDomain
The operation that you want to
perform. Set t he value to
Creat eDomainCreat eDomain.
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
DomainId String 158910 The ID of the domain name.
RequestId String
B49AD828-25D1-
488C-90B7-
8853C1944486
The ID of the request.
6.2. CreateDomain6.2. CreateDomain
Direct Mail
API Reference··Manage domain nam
es
> Document Version: 20220402 28
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=CreateDomain
&DomainName=abc.com
&<Common request parameters>
Sample success responses
XML format
<CreateDomainResponse>
<RequestId>B49AD828-25D1-488C-90B7-8853C1944486</RequestId>
<DomainId>158910</DomainId>
</CreateDomainResponse>
JSON format
{
"RequestId":"B49AD828-25D1-488C-90B7-8853C1944486",
"DomainId":158910
}
Error codesError codes
For a list of error codes, visit the API Error Center.
Configures a domain name.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
DomainId Integer Yes 13464
The ID of the domain name.
AccessKeyId String No xxx
The AccessKey ID provided to you by
Alibaba Cloud.
6.3. DescDomain6.3. DescDomain
API Reference··Manage domain nam
es
Direct Mail
29 > Document Version: 20220402
Action String No DescDomain
The operation that you want to
perform. Set t he value to
DescDomainDescDomain.
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
CnameAuthStat
us
String 1
Indicates whether your ownership of the
domain is verified.
CnameConfirmS
tatus
String 0
Indicates whether the CNAME record is
successfully verified. Valid values: 0 and 1. 0:
indicates the verification is successful. 1:
indicates that the verification fails.
CnameRecord String dmtrace The value of the CNAME record.
CreateT ime String 2019-09-29T 12:49Z The time when the DNS record was created.
DefaultDomain String 0 The default domain name.
DnsMx String abc-com.xxxx.com The value of the MX record.
DnsSpf String v=xxxx The value of the SPF record.
DnsT xt String 121309ohdsa The value of the TXT ownership record.
DomainId String 158910 The ID of the domain name.
DomainName String abc.com The domain name.
Direct Mail
API Reference··Manage domain nam
es
> Document Version: 20220402 30
DomainStatus String 1
The status of the domain name. Indicates
whether the domain name is verified and
available. Valid values:
00 : indicates that the domain name is
verified and available.
11 : indicates that the domain name fails to
be verified and is unavailable.
22 : indicates that the domain name is
available, but not filed or configured with
a CNAME record.
33 : indicates that the domain name is
available but not filed.
44 : indicates that the domain name is
available but not configured with a CNAME
record.
DomainT ype String
0c40d5f125af4e428
92a
The type of the domain.
IcpStatus String 1
The status of ICP filing. Valid values: 0 and 1.
11 : indicates that the domain name is filed.
00 : indicates that the domain name is not
filed.
MxAuthStatus String 1
Indicates whether the MX record is
successfully verified. Valid values: 0 and 1. 0:
indicates the verification is successful. 1:
indicates that the verification fails.
MxRecord String mx01.dm.aliyun.com
The MX verification record provided by
Alibaba Cloud DNS.
RequestId String
51B74264-46B4-
43C8-A9A0-
6B8E8BC04F34
The ID of the request.
SpfAuthStatus String 1
Indicates whether the SPF record is
successfully verified. Valid values: 0 and 1. 0:
indicates the verification is successful. 1:
indicates that the verification fails.
SpfRecord String
include:spf1.dm.aliy
un.com
The SPF verification record provided by
Alibaba Cloud DNS.
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
API Reference··Manage domain nam
es
Direct Mail
31 > Document Version: 20220402
TlDomainName String abc.com The primary domain name.
TracefRecord String
tracedm.aliyuncs.co
m
The CNAME verification record provided by
Alibaba Cloud DNS.
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
SamplesSamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=DescDomain
&DomainId=13464
&<Common request parameters>
Sample success responses
JSON format
{
"MxAuthStatus":1,
"DnsMx":"abc-com.mail.protection.outlook.com",
"IcpStatus":1,
"TracefRecord":"tracedm.aliyuncs.com",
"DnsSpf":"v=spf1 include:spf.disney.com -all",
"DomainStatus":1,
"DefaultDomain":0,
"CnameConfirmStatus":1,
"TlDomainName":"abc.com",
"MxRecord":"mx01.dm.aliyun.com",
"SpfRecord":"include:spf1.dm.aliyun.com",
"CnameRecord":"dmtrace",
"SpfAuthStatus":1,
"CreateTime":"2019-09-29T12:49Z",
"RequestId":"51B74264-46B4-43C8-A9A0-6B8E8BC04F34",
"DomainType":"0c40d5f125af4e42892a",
"DomainName":"abc.com",
"DomainId":158910,
"CnameAuthStatus":1
}
Error codesError codes
For a list of error codes, visit the API Error Center.
Sets the SMT P password for a domain name.
DebuggingDebugging
6.4. ModifyPWByDomain6.4. ModifyPWByDomain
Direct Mail
API Reference··Manage domain nam
es
> Document Version: 20220402 32
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
DomainName String Yes abc.com
The domain name. It must be 1 to 50
characters in lengt h and can contain
digits, letters, periods ( . ), hyphens
( - ).
Password String Yes pwd The password.
Action String No
ModifyPWByDom
ain
The operation that you want to
perform. Set t he value to
Modif yPWByDomainModif yPWByDomain.
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
Code String OK The status code.
Message String
The request is
successful.
The description of the st atus code.
RequestId String
02B2A890-CBD8-
4806-9BCA-
C93190CE7EF6
The ID of the request.
Success Boolean true
Indicates whether the operation is
successful.
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=ModifyPWByDomain
&DomainName=abc.com
&Password=pwd
&<Common request parameters>
Sample success responses
XML format
API Reference··Manage domain nam
es
Direct Mail
33 > Document Version: 20220402
<ModifyPWByDomainResponse>
<RequestId>02B2A890-CBD8-4806-9BCA-C93190CE7EF6</RequestId>
<Code>OK</Code>
<Message>xxx</Message>
<Success>true</Success>
</ModifyPWByDomainResponse>
JSON format
{
"Message":"xxx",
"RequestId":"02B2A890-CBD8-4806-9BCA-C93190CE7EF6",
"Success":"true",
"Code":"OK"
}
Error codesError codes
For a list of error codes, visit the API Error Center.
Queries a list of domain names.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
AccessKeyId String No xxxx
The AccessKey ID provided to you by
Alibaba Cloud.
Action String No
QueryDomainByP
aram
The operation that you want to
perform. Set t he value to
QueryDomainByParamQueryDomainByParam.
KeyWord String No abc.com
The domain name. It must be 1 to 50
characters in lengt h and can contain
digits, letters, periods (.), and hyphens
(-).
6.5. QueryDomainByParam6.5. QueryDomainByParam
Direct Mail
API Reference··Manage domain nam
es
> Document Version: 20220402 34
PageNo Integer No 1
The number of the page to return.
Default value: 1.
PageSize Integer No 10
The number of entries to return on
each page. Default value: 10.
Status Integer No 0
0: normal
1: abnormal
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
PageNumber Integer 1 The page number of t he returned page.
PageSize Integer 50 The number of entries returned per page.
RequestId String
8C90CCD3-627C-
4F87-AD8C-
2F03146071EB
The ID of the request.
TotalCount Integer 2 The total number of domain names.
data The information about domain names.
domain The information about domain names.
CnameAuthStat
us
String 0
Indicates whether your ownership of the
domain is verified.
ConfirmStatus String 0
Indicates whether the CNAME record is
successfully verified. Valid values: 0 and 1. 0:
indicates the verification is successful. 1:
indicates that the verification fails.
CreateT ime String 2019-09-29T 13:28Z The time when the DNS record was created.
DomainId String 158923 The ID of the domain name.
API Reference··Manage domain nam
es
Direct Mail
35 > Document Version: 20220402
DomainName String vmeixme.com T he domain name.
DomainStatus String 0
The status of the domain name. Valid
values: 0 to 4.
0: indicates that the domain name is
verified and available.
1: indicates that the domain name fails to
be verified and is unavailable.
2: indicates that the domain name is
available, but not filed or configured with
a CNAME record.
3: indicates that the domain name is
available but not filed.
4: indicates that the domain name is
available but not configured with a CNAME
record.
IcpStatus String 1
The status of ICP filing. Valid values: 0 and 1.
1: indicates that the domain name is filed.
0: indicates that the domain name is not
filed.
MxAuthStatus String 0
Indicates whether the MX record is
successfully verified. Valid values: 0 and 1. 0:
indicates the verification is successful. 1:
indicates that the verification fails.
SpfAuthStatus String 0
Indicates whether the SPF record is
successfully verified. Valid values: 0 and 1. 0:
indicates the verification is successful. 1:
indicates that the verification fails.
UtcCreateT ime Long 1569734892
The time when the DNS record was created.
The time is displayed in UT C.
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
ExamplesExamples
Sample requests
http(s)://[Endpoint]/? Action=QueryDomainByParam
&<Common request parameters>
Sample success responses
Direct Mail
API Reference··Manage domain nam
es
> Document Version: 20220402 36
JSON format
{
"PageNumber":1,
"TotalCount":2,
"PageSize":50,
"RequestId":"8C90CCD3-627C-4F87-AD8C-2F03146071EB",
"data":{
"domain":[
{
"MxAuthStatus":1,
"UtcCreateTime":1569734892,
"IcpStatus":1,
"SpfAuthStatus":1,
"DomainStatus":1,
"CreateTime":"2019-09-29T13:28Z",
"ConfirmStatus":1,
"DomainName":"vmeixme.com",
"DomainId":158923,
"CnameAuthStatus":1,
"DomainRecord":"6bd86901b9fe4618a046"
},
{
"MxAuthStatus":1,
"UtcCreateTime":1569731275,
"IcpStatus":1,
"SpfAuthStatus":1,
"DomainStatus":1,
"CreateTime":"2019-09-29T12:27Z",
"ConfirmStatus":1,
"DomainName":"abc.com",
"DomainId":158910,
"CnameAuthStatus":1,
"DomainRecord":"0c40d5f125af4e42892a"
}
]
}
}
Error codesError codes
For a list of error codes, visit the API Error Center.
API Reference··Manage domain nam
es
Direct Mail
37 > Document Version: 20220402
Verifies a reply-to address.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
Ticket String Yes t icket
The token that is included in the
specified URL of t he verification email.
AccessKeyId String No xxx
The AccessKey ID provided to you by
Alibaba Cloud.
Action String No
ApproveReplyMail
Address
The operation that you want to
perform. Set t he value to
ApproveReplyMailAddressApproveReplyMailAddress .
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
RequestId String
10A1AD70-E48E-
476D-98D9-
39BD92193837
The ID of the request.
ExamplesExamples
Sample requests
http(s)://[Endpoint]/? Action=ApproveReplyMailAddress
&<Common request parameters>
Sample success responses
XML format
7.Manage sender addresses7.Manage sender addresses
7.1. ApproveReplyMailAddress7.1. ApproveReplyMailAddress
Direct Mail
API Reference··Manage sender addr
esses
> Document Version: 20220402 38
<ApproveReplyMailAddressResponse>
<RequestId>10A1AD70-E48E-476D-98D9-39BD92193837</RequestId>
</ApproveReplyMailAddressResponse>
JSON format
{
"RequestId":"10A1AD70-E48E-476D-98D9-39BD92193837"
}
Error codesError codes
HT T PHT T P
st at usst at us
codecode
Error codeError code Error messageError message Descript ionDescript ion
400
InvalidMailAddressSe
ndT ype.Malformed
The specified mailAddress
sendType is wrongly formed.
The error message returned
because the specified email type
is invalid. Log on to the console
and select a valid email type.
400
InvalidMailAddressD
omain.Malformed
The specified mailAddress
domain does not exist .
The error message returned
because the format of t he
domain name is invalid. A
domain name must contain
digits, letters, underscores (_),
hyphens (-), and periods (.).
400
InvalidMailAddressSt
atus.Malformed
The specified mailAddress
status is wrongly formed.
The error message returned
because the status of the
sender address is invalid. Check
whether the sender address is
frozen.
For a list of error codes, visit the API Error Center.
Sends a verification email to the specified reply-to address.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
7.2. CheckReplyToMailAddress7.2. CheckReplyToMailAddress
API Reference··Manage sender addr
esses
Direct Mail
39 > Document Version: 20220402
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
MailAddressId Integer Yes 126545 The ID of the sender address.
AccessKeyId String No xxxx
The AccessKey ID provided to you by
Alibaba Cloud.
Action String No
CheckReplyToMail
Address
The operation that you want to
perform. Set t he value to
CheckReplyT o MailAddressCheckReplyT oMailAddress .
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
RequestId String
10A1AD70-E48E-
476D-98D9-
39BD92193837
The ID of the request.
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=CheckReplyToMailAddress
&MailAddressId=126545
&<Common request parameters>
Sample success responses
XML format
<CheckReplyToMailAddressResponse>
<RequestId>10A1AD70-E48E-476D-98D9-39BD92193837</RequestId>
</CheckReplyToMailAddressResponse>
JSON format
{
"RequestId":"10A1AD70-E48E-476D-98D9-39BD92193837"
}
Error codesError codes
Direct Mail
API Reference··Manage sender addr
esses
> Document Version: 20220402 40
HT T PHT T P
st at usst at us
codecode
Error codeError code Error messageError message Descript ionDescript ion
400
InvalidMailAddressSe
ndT ype.Malformed
The specified mailAddress
sendType is wrongly formed.
The error message returned
because the specified email type
is invalid. Log on to the console
and select a valid email type.
400
InvalidMailAddressD
omain.Malformed
The specified mailAddress
domain does not exist .
The error message returned
because the format of t he
domain name is invalid. A
domain name must contain
digits, letters, underscores (_),
hyphens (-), and periods (.).
400
InvalidMailAddressSt
atus.Malformed
The specified mailAddress
status is wrongly formed.
The error message returned
because the status of the
sender address is invalid. Check
whether the sender address is
frozen.
For a list of error codes, visit the API Error Center.
Creat es a sender address.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
AccountName String Yes
<Account
name> + @+
<domain name>
The sender address.
Sendtype String Yes batch
The email type. Valid values:
bat chbat ch: batch emails
t riggert rigger: triggered emails
AccessKeyId String No xxx
The AccessKey ID provided to you by
Alibaba Cloud.
7.3. CreateMailAddress7.3. CreateMailAddress
API Reference··Manage sender addr
esses
Direct Mail
41 > Document Version: 20220402
Action String No
CreateMailAddres
s
The operation that you want to
perform. Set t he value to
Creat eMailAddressCreat eMailAddress .
ReplyAddress String No reply@aliyun.com The reply-to address.
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
MailAddressId String xxx T he ID of the sender address.
RequestId String
95A7D497-F8DD-
4834-B81E-
C1783236E55F
The ID of the request.
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=CreateMailAddress
&Sendtype=batch
&<Common request parameters>
Sample success responses
XML format
<CreateMailAddressResponse>
<RequestId>95A7D497-F8DD-4834-B81E-C1783236E55F</RequestId>
<MailAddressId>xxxx</MailAddressId>
</CreateMailAddressResponse>
JSON format
{
"MailAddressId":"xxxx",
"RequestId":"95A7D497-F8DD-4834-B81E-C1783236E55F"
}
Error codesError codes
Direct Mail
API Reference··Manage sender addr
esses
> Document Version: 20220402 42
HT T PHT T P
st at usst at us
codecode
Error codeError code Error messageError message Descript ionDescript ion
400
InvalidMailAddressSe
ndT ype.Malformed
The specified mailAddress
sendType is wrongly formed.
The error message returned
because the specified email type
is invalid. Log on to the console
and select a valid email type.
400
InvalidMailAddressD
omain.Malformed
The specified mailAddress
domain does not exist .
The error message returned
because the format of t he
domain name is invalid. A
domain name must contain
digits, letters, underscores (_),
hyphens (-), and periods (.).
400
InvalidMailAddressSt
atus.Malformed
The specified mailAddress
status is wrongly formed.
The error message returned
because the status of the
sender address is invalid. Check
whether the sender address is
frozen.
For a list of error codes, visit the API Error Center.
Deletes a sender address.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
MailAddressId Integer Yes 23457 The ID of the sender address.
AccessKeyId String No xxxx
The AccessKey ID provided to you by
Alibaba Cloud.
Action String No
DeleteMailAddres
s
The operation that you want to
perform. Set t he value to
Delet eMailAddressDelet eMailAddress .
Response parametersResponse parameters
7.4. DeleteMailAddress7.4. DeleteMailAddress
API Reference··Manage sender addr
esses
Direct Mail
43 > Document Version: 20220402
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
RequestId String
10A1AD70-E48E-
476D-98D9-
39BD92193837
The ID of the request.
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=DeleteMailAddress
&MailAddressId=23457
&<Common request parameters>
Sample success responses
XML format
<DeleteMailAddressResponse>
<RequestId>10A1AD70-E48E-476D-98D9-39BD92193837</RequestId>
</DeleteMailAddressResponse>
JSON format
{
"RequestId":"10A1AD70-E48E-476D-98D9-39BD92193837"
}
Error codesError codes
HT T PHT T P
st at usst at us
codecode
Error codeError code Error messageError message Descript ionDescript ion
400
InvalidMailAddressSe
ndT ype.Malformed
The specified mailAddress
sendType is wrongly formed.
The error message returned
because the specified email type
is invalid. Log on to the console
and select a valid email type.
400
InvalidMailAddressD
omain.Malformed
The specified mailAddress
domain does not exist .
The error message returned
because the format of t he
domain name is invalid. A
domain name must contain
digits, letters, underscores (_),
hyphens (-), and periods (.).
400
InvalidMailAddressSt
atus.Malformed
The specified mailAddress
status is wrongly formed.
The error message returned
because the status of the
sender address is invalid. Check
whether the sender address is
frozen.
Direct Mail
API Reference··Manage sender addr
esses
> Document Version: 20220402 44
For a list of error codes, visit the API Error Center.
Sets the SMT P password.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
MailAddressId Integer Yes 1344565 The ID of the sender address.
AccessKeyId String No xxx
The AccessKey ID provided to you by
Alibaba Cloud.
Action String No
ModifyMailAddres
s
The operation that you want to
perform. Set t he value to
Modif yMailAddressModif yMailAddress .
Password String No pwd129WDCft9
The password. It must be 10 to 20
characters in lengt h and must contain
all the following types of characters:
uppercase letters, lowercase letters,
and digits.
ReplyAddress String No reply@aliyun.com The reply-to address.
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
RequestId String
10A1AD70-E48E-
476D-98D9-
39BD92193837
The ID of the request.
ExamplesExamples
Sample requests
7.5. ModifyMailAddress7.5. ModifyMailAddress
API Reference··Manage sender addr
esses
Direct Mail
45 > Document Version: 20220402
http(s)://dm.aliyuncs.com/? Action=ModifyMailAddress
&MailAddressId=1344565
&<Common request parameters>
Sample success responses
XML format
<ModifyMailAddressResponse>
<RequestId>10A1AD70-E48E-476D-98D9-39BD92193837</RequestId>
</ModifyMailAddressResponse>
JSON format
{
"RequestId":"10A1AD70-E48E-476D-98D9-39BD92193837"
}
Error codesError codes
HT T PHT T P
st at usst at us
codecode
Error codeError code Error messageError message Descript ionDescript ion
400
InvalidMailAddressSe
ndT ype.Malformed
The specified mailAddress
sendType is wrongly formed.
The error message returned
because the specified email type
is invalid. Log on to the console
and select a valid email type.
400
InvalidMailAddressD
omain.Malformed
The specified mailAddress
domain does not exist .
The error message returned
because the format of t he
domain name is invalid. A
domain name must contain
digits, letters, underscores (_),
hyphens (-), and periods (.).
400
InvalidMailAddressSt
atus.Malformed
The specified mailAddress
status is wrongly formed.
The error message returned
because the status of the
sender address is invalid. Check
whether the sender address is
frozen.
For a list of error codes, visit the API Error Center.
Direct Mail
API Reference··Manage sender addr
esses
> Document Version: 20220402 46
Creat es a recipient list.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
ReceiversAlias String Yes vme T he alias of the recipient list.
ReceiversName String Yes xme The name of the recipient list .
AccessKeyId String No xxx
The AccessKey ID provided to you by
Alibaba Cloud.
Action String No CreateReceiver
The operation that you want to
perform. Set t he value to
Creat eReceiverCreat eReceiver.
Desc String No
The description
of the recipient
list.
Description
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
ReceiverId String xxxx T he ID of the recipient list.
RequestId String
10A1AD70-E48E-
476D-98D9-
39BD92193837
The ID of the request.
ExamplesExamples
Sample requests
8.Manage recipients8.Manage recipients
8.1. CreateReceiver8.1. CreateReceiver
API Reference··Manage recipient s Direct Mail
47 > Document Version: 20220402
http(s)://dm.aliyuncs.com/? Action=CreateReceiver
&ReceiversAlias=vme
&ReceiversName=xme
&<Common request parameters>
Sample success responses
XML format
<CreateReceiverResponse>
<RequestId>10A1AD70-E48E-476D-98D9-39BD92193837</RequestId>
<ReceiverId>xxxx</ReceiverId>
</CreateReceiverResponse>
JSON format
{
"RequestId":"10A1AD70-E48E-476D-98D9-39BD92193837",
"ReceiverId":"xxxx"
}
Error codesError codes
HT T PHT T P
st at usst at us
codecode
Error codeError code Error messageError message Descript ionDescript ion
400
InvalidReceiverName
.Malformed
The specified receiver name is
wrongly formed.
The error message returned
because the format of t he
recipient's email address is
invalid. An email address must
contain an account name, an at
sign, and a domain name. T he
account name and domain name
must contain digits, letters,
underscores (_), hyphens (-), and
periods (.).
400
InvalidReceiverStatu
s.Malformed
The specified receivers status is
wrongly formed.
The error message returned
because the status of the
recipient is invalid. Check
whether the recipient has been
uploaded to the console.
For a list of error codes, visit the API Error Center.
Deletes a recipient.
DebuggingDebugging
8.2. DeleteReceiverDetail8.2. DeleteReceiverDetail
Direct Mail API Referenc·Manage recipient s
> Document Version: 20220402 48
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
ReceiverId String Yes 123534 T he ID of the recipient list .
AccessKeyId String No xxx
The AccessKey ID provided to you by
Alibaba Cloud.
Action String No
DeleteReceiverDe
tail
The operation that you want to
perform. Set t he value to
Delet eReceiverDet ailDelet eReceiverDet ail .
Email String No
<account
name> + @+
<domain name>
The email address of the recipient.
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
RequestId String
10A1AD70-E48E-
476D-98D9-
39BD92193837
The ID of the request.
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=DeleteReceiverDetail
&ReceiverId=123534
&<Common request parameters>
Sample success responses
XML format
<DeleteReceiverDetailResponse>
<RequestId>10A1AD70-E48E-476D-98D9-39BD92193837</RequestId>
</DeleteReceiverDetailResponse>
JSON format
API Reference··Manage recipient s Direct Mail
49 > Document Version: 20220402
{
"RequestId":"10A1AD70-E48E-476D-98D9-39BD92193837"
}
Error codesError codes
HT T PHT T P
st at usst at us
codecode
Error codeError code Error messageError message Descript ionDescript ion
400
InvalidReceiverName
.Malformed
The specified receiver name is
wrongly formed.
The error message returned
because the format of t he
recipient's email address is
invalid. An email address must
contain an account name, an at
sign, and a domain name. T he
account name and domain name
must contain digits, letters,
underscores (_), hyphens (-), and
periods (.).
400
InvalidReceiverStatu
s.Malformed
The specified receivers status is
wrongly formed.
The error message returned
because the status of the
recipient is invalid. Check
whether the recipient has been
uploaded to the console.
For a list of error codes, visit the API Error Center.
Deletes a recipient list.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
ReceiverId String Yes 1453 T he ID of t he recipient list.
AccessKeyId String No xxx
The AccessKey ID provided to you by
Alibaba Cloud.
8.3. DeleteReceiver8.3. DeleteReceiver
Direct Mail API Referenc·Manage recipient s
> Document Version: 20220402 50
Action String No DeleteReceiver
The operation that you want to
perform. Set t he value to
Delet eReceiverDelet eReceiver.
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
RequestId String
10A1AD70-E48E-
476D-98D9-
39BD92193837
The ID of the request.
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=DeleteReceiver
&ReceiverId=1453
&<Common request parameters>
Sample success responses
XML format
<DeleteReceiverResponse>
<RequestId>10A1AD70-E48E-476D-98D9-39BD92193837</RequestId>
</DeleteReceiverResponse>
JSON format
{
"RequestId":"10A1AD70-E48E-476D-98D9-39BD92193837"
}
Error codesError codes
HT T PHT T P
st at usst at us
codecode
Error codeError code Error messageError message Descript ionDescript ion
API Reference··Manage recipient s Direct Mail
51 > Document Version: 20220402
400
InvalidReceiverName
.Malformed
The specified receiver name is
wrongly formed.
The error message returned
because the format of t he
recipient's email address is
invalid. An email address must
contain an account name, an at
sign, and a domain name. T he
account name and domain name
must contain digits, letters,
underscores (_), hyphens (-), and
periods (.).
400
InvalidReceiverStatu
s.Malformed
The specified receivers status is
wrongly formed.
The error message returned
because the status of the
recipient is invalid. Check
whether the recipient has been
uploaded to the console.
HT T PHT T P
st at usst at us
codecode
Error codeError code Error messageError message Descript ionDescript ion
For a list of error codes, visit the API Error Center.
Direct Mail API Referenc·Manage recipient s
> Document Version: 20220402 52
Creat es a tag.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype RequiredRequired ExampleExample Descript ionDescript ion
TagName String Yes vme
The name of the
tag.
AccessKeyId String No xxx
The AccessKey ID
provided to you
by Alibaba Cloud.
Action String Yes CreateT ag
The operation
that you want to
perform. Set t he
value to
Creat eT agCreat eT ag .
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
RequestId String
10A1AD70-E48E-476D-
98D9-39BD92193837
The ID of the request.
TagId String xxxx The ID of the tag.
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=CreateTag
&TagName=vme
&<Common request parameters>
9.Manage tags9.Manage tags
9.1. CreateTag9.1. CreateTag
API Reference··Manage t ags Direct Mail
53 > Document Version: 20220402
Sample success responses
XML format
<CreateTagResponse>
<RequestId>10A1AD70-E48E-476D-98D9-39BD92193837</RequestId>
<TagId>xxxx</TagId>
</CreateTagResponse>
JSON format
{
"RequestId":"10A1AD70-E48E-476D-98D9-39BD92193837",
"TagId":"xxxx"
}
Error codesError codes
For a list of error codes, visit the API Error Center.
Deletes a tag.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
TagId Integer Yes 123 The ID of the tag.
AccessKeyId String No xxxx
The AccessKey ID provided to you by
Alibaba Cloud.
Action String No DeleteT ag
The operation that you want to
perform. Set t he value to Delet eT agDelet eT ag .
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
9.2. DeleteTag9.2. DeleteTag
Direct Mail API Referenc·Manage t ags
> Document Version: 20220402 54
RequestId String
10A1AD70-E48E-
476D-98D9-
39BD92193837
The ID of the request.
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=DeleteTag
&TagId=123
&<Common request parameters>
Sample success responses
XML format
<DeleteTagResponse>
<RequestId>10A1AD70-E48E-476D-98D9-39BD92193837</RequestId>
</DeleteTagResponse>
JSON format
{
"RequestId":"10A1AD70-E48E-476D-98D9-39BD92193837"
}
Error codesError codes
For a list of error codes, visit the API Error Center.
Modifies a tag.
DebuggingDebugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend
that you call this operat ion in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample
code of the operat ion for different SDKs.
Request parametersRequest parameters
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
TagId Integer Yes 123 The ID of the tag.
TagName String Yes vme T he name of the tag.
9.3. ModifyTag9.3. ModifyTag
API Reference··Manage t ags Direct Mail
55 > Document Version: 20220402
AccessKeyId String No xxxx
The AccessKey ID provided to you by
Alibaba Cloud.
Action String No ModifyTag
The operation that you want to
perform. Set t he value to Modif yT agModif yT ag.
Paramet erParamet er T ypeT ype
RequirRequir
eded
ExampleExample Descript ionDescript ion
Response parametersResponse parameters
Paramet erParamet er T ypeT ype ExampleExample Descript ionDescript ion
RequestId String
10A1AD70-E48E-
476D-98D9-
39BD92193837
The ID of the request.
ExamplesExamples
Sample requests
http(s)://dm.aliyuncs.com/? Action=ModifyTag
&TagId=123
&TagName=vme
&<Common request parameters>
Sample success responses
XML format
<ModifyTagResponse>
<RequestId>10A1AD70-E48E-476D-98D9-39BD92193837</RequestId>
</ModifyTagResponse>
JSON format
{
"RequestId":"10A1AD70-E48E-476D-98D9-39BD92193837"
}
Error codesError codes
For a list of error codes, visit the API Error Center.
Direct Mail API Referenc·Manage t ags
> Document Version: 20220402 56
Client errorsClient errors
For details, refer to the interface error codes:
SingleSendMail
BatchSendMail
Server errorsServer errors
Error codeError code Descript ionDescript ion HT T P st at us codeHT T P st at us code MeaningMeaning
ServiceUnavailable
The request has failed
due to a temporary
server failure.
503 Service is unavailable.
InternalError
The request processing
has failed due to an
unknown error,
exception or failure.
500 Internal error.
MissingParameter
The input parameter
<parameter name>
that is mandatory for
processing this request
is not supplied.
400
A required parameter is
missing.
Forbidden
User not authorized to
operate on the
specified resource.
400
You have no permission
to perform this
operation. Check
whether the RAM
subaccount has been
granted the permission
for the DirectMail
service.
10.Error codes10.Error codes
API Reference··Error codes Direct Mail
57 > Document Version: 20220402
Setting Smt p Password for Domain
Creat ing Domain
Get domain configuration
Query the list of domain
Verify domain
Setting Smtp Password for DomainSetting Smtp Password for Domain
DescriptionDescription
ModifyPWByDomain API is used for setting Smtp Password for Domain.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name,a system
required
paramet er.Value:Modify
PWByDomain.
DomainName String Required
domain,length 1 to 50,
including numbers or
capitals or lowercase
letters or.or -
Password String Required password
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Error codesError codes
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidDomainPassword.Malforme
d
400 (Bad Request)
The specified domain password
is wrongly formed.
11.New API11.New API
11.1. domain Operation11.1. domain Operation
Direct Mail API Reference··New API
> Document Version: 20220402 58
InvalidDomainPassword.equalcurr
ent
400 (Bad Request)
The new password cannot be t he
same as the old one.
InvalidDomainName.Malformed 400 (Bad Request)
The specified domain name is
wrongly formed.
InvalidDomain.NotFound 400 (Bad Request)
The specified domain is not
found.
InvalidDomainStatus.Malformed
400 (Bad Request)
The specified domain status is
wrongly formed.
InvalidDomainId.Malformed 400 (Bad Request)
The specified domain id is
wrongly formed.
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
Creating DomainCreating Domain
DescriptionDescription
Creat eDomain API is used for creating Domain.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name,a system
required
paramet er.Value:
CreateDomain.
DomainName String Required
Domain, length 1 to 50,
including numbers or
capitals or lowercase
letters or.or -
For other request parameters, see Public parameters.
Response parametersResponse parameters
API Reference··New API Direct Mail
59 > Document Version: 20220402
NameName T ypeT ype
domainId int
For more information about public response parameters, see Public parameters.
Error codesError codes
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidDomainName.Duplicate 400 (Bad Request)
The specified domain has already
existed.
InvalidDomainNumber.Malformed 400 (Bad Request)
The amount of domain exceeds
the limit.
InvalidDomainName.Malformed
400 (Bad Request)
The specified domain name is
wrongly formed.
InvalidDomainName.Conflict 400 (Bad Request)
The specified domain name is
already used by another user.
InvalidDomain.NotFound 400 (Bad Request)
The specified domain is not
found.
Get domain configurationGet domain configuration
DescriptionDescription
DescDomain API is used for querying domain configuration.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name,a system
required
paramet er.Value:DescD
omain.
DomainId Integer Required Domain id
For other request parameters, see Public parameters.
Direct Mail API Reference··New API
> Document Version: 20220402 60
Response parametersResponse parameters
NameName T ypeT ype Descript ionDescript ion
data data
datadata
NameName T ypeT ype Descript ionDescript ion
domainId int
domainName String domain
domainT ype String domain type
cnameRecord String cName record
cnameConfirmStatus int
cName confirm
status,Success:0;fail:1
spfAuthStatus int
spf verification
flag,Success:0;fail:1
mxAuthStatus int
mx verification
flag,Success:0;fail:1
creat eT ime Date
utcCreateT ime Long
cnameAuthStatus int track verification
icpStatus int
The status is construction puts a
record of the domain name,not
pass:0;Passed:1
API Reference··New API Direct Mail
61 > Document Version: 20220402
DomainStatus int
The status of the domain
name(0:Available,Passed;1:Unav
ailable,No
passed;2:Available,cname no
passed,icp no
passed;3:Available,icp no
passed;4: Available,cname no
passed)
NameName T ypeT ype Descript ionDescript ion
For more information about public response parameters, see Public parameters.
Error codesError codes
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidDomainId.Malformed 400 (Bad Request)
The specified domainId is not
exist.
Query the list of domainQuery the list of domain
DescriptionDescription
QueryDomainByParam API is used for querying the list of domain.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name,a system
required
paramet er.Value:Query
DomainByParam.
Keyword String Required
domain, length 1 to 50,
including numbers or
capitals or lowercase
letters or.or -
Status String Required 0:Verified;1:Failed
PageNo String Optional Offset Page No
Direct Mail API Reference··New API
> Document Version: 20220402 62
PageSize String Optional
Number of Items each
page
NameName T ypeT ype Required?Required? Descript ionDescript ion
For other request parameters, see Public parameters.
Response parametersResponse parameters
NameName T ypeT ype Descript ionDescript ion
data data
datadata
NameName T ypeT ype Descript ionDescript ion
data Array data record
data recorddata record
NameName T ypeT ype Descript ionDescript ion
domainId int
domainName String domain
domainT ype String domain type
cnameRecord String cName record
cnameConfirmStatus int
cName confirm
status,Success:0;fail:1
spfAuthStatus int
spf verification
flag,Success:0;fail:1
API Reference··New API Direct Mail
63 > Document Version: 20220402
mxAuthStatus int
mx verification
flag,Success:0;fail:1
creat eT ime Date
utcCreateT ime Long
cnameAuthStatus int track verification
icpStatus int
The status is construction puts a
record of the domain name,not
pass:0;Passed:1
DomainStatus int
The status of the domain
name(0:Available,Passed;1:Unav
ailable,No
passed;2:Available,cname no
passed,icp no
passed;3:Available,icp no
passed;4: Available,cname no
passed)
NameName T ypeT ype Descript ionDescript ion
For more information about public response parameters, see Public parameters.
Verify domainVerify domain
DescriptionDescription
CheckDomain API is used for verifying domain.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name,a system
required
paramet er.Value:Check
Domain.
DomainId Integer Required domain id
For other request parameters, see Public parameters.
Direct Mail API Reference··New API
> Document Version: 20220402 64
Response parametersResponse parameters
NameName T ypeT ype Descript ionDescript ion
DomainStatus int
The status of the domain
name(0:Available,Passed;1:Unav
ailable,No
passed;2:Available,cname no
passed,icp no
passed;3:Available,icp no
passed;4: Available,cname no
passed)
For more information about public response parameters, see Public parameters.
Error codesError codes
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidDomainId.Malformed 400 (Bad Request)
The specified domainId is not
exist.
CheckDomain.Failed 400 (Bad Request)
The specified domain was
checked failed.
InvalidDomainName.DuplicateT LD 400 (Bad Request)
The specified domain of top-
level domain name already exist s.
Creat e a Send Mail Address
Get t he list of sending addresses
Setting Smt p Password for Send Address
Delete Send Address
Send mail when verifying the return address
Verify the return address
Setting Notification Address for Sending Address-Not available now
Get t he notification address of the sending address-Not available now
Create a Send Mail AddressCreate a Send Mail Address
DescriptionDescription
Creat eMailAddress API is used for creating a Send Mail Address.
11.2. send mail operation11.2. send mail operation
API Reference··New API Direct Mail
65 > Document Version: 20220402
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
CreateMailAddress.
AccountName String Required Sending Address
ReplyAddress String Optional ReplyTo mail address
Sendtype String Required
Types of mails:batch or
trigger
For other request parameters, see Public parameters.
Response parametersResponse parameters
NameName T ypeT ype Descript ionDescript ion
mailAddressId int Sending mail address id
For more information about public response parameters, see Public parameters.
Error codesError codes
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidMailAddressName.Malform
ed
400 (Bad Request)
The specified mailAddress
accountName is wrongly formed.
InvalidMailAddressNumber.Malfor
med
400 (Bad Request)
The amount of mailaddress
exceeds the limit.
Forbidden 400 (Bad Request)
The operator has no permission
on the specified resource.
Direct Mail API Reference··New API
> Document Version: 20220402 66
InvalidMailAddressDomain.Malfor
med
400 (Bad Request)
The specified mailAddress
domain does not exist .
InvalidMailAddressDomainStatus.
Malformed
400 (Bad Request)
The specified mailAddress
domain status is wrongly
formed.
InvalidMailAddressName.Duplicat
e
400 (Bad Request)
The specified mailAddress
accountName has already
existed.
InvalidMailAddressNumber.Malfor
med
400 (Bad Request)
The amount of mailaddress
exceeds the limit.
InvalidMailAddressName.Malform
ed
400 (Bad Request)
The specified mailAddress
accountName is wrongly formed.
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
Get the list of sending addressesGet the list of sending addresses
DescriptionDescription
QueryMailAddressByParam API is used for querying the list of sending addresses.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
QueryMailAddressByPara
m.
KeyWord String Required
mail address,Length 1
to 60, numerals or
upper or lower case
letters or . or - or @
Sendtype String Optional
Types of mails:batch or
trigger
PageNo String Optional Offset Page No
API Reference··New API Direct Mail
67 > Document Version: 20220402
PageSize String Optional
Number of Items each
page
NameName T ypeT ype Required?Required? Descript ionDescript ion
For other request parameters, see Public parameters.
Response parametersResponse parameters
NameName T ypeT ype Descript ionDescript ion
data data
datadata
NameName T ypeT ype Descript ionDescript ion
data Array data record
data recorddata record
NameName T ypeT ype Descript ionDescript ion
mailAddressId
int
Sending mail address id
accountName String Sending mail address
replyAddress String ReplyTo mail address
sendtype String Types of mails:batch or trigger
accountStatus int
Account status, freeze: 1,
normal: 0
replySt atus int ReplyTo mail address status
Direct Mail API Reference··New API
> Document Version: 20220402 68
creat eT ime Date
dailyCount int Daily quota limit
monthCount int
Monthly quota limit
dailyReqCount int Request num in the current day
monthReqCount int
Request num in the current
month
domainStatus int
Domain status:Success: 0;
Failure: 1
NameName T ypeT ype Descript ionDescript ion
For more information about public response parameters, see Public parameters.
Setting Smtp Password for Send AddressSetting Smtp Password for Send Address
DescriptionDescription
ModifyMailAddress API is used for sett ing Smtp Password for Send Address
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
ModifyMailAddress.
MailAddressId Integer
Required
Sending mail address id
Password String Required Password
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Delete Send AddressDelete Send Address
API Reference··New API Direct Mail
69 > Document Version: 20220402
DescriptionDescription
DeleteMailAddress API is used for deleting Send Address.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
QueryMailAddressByPara
m.
MailAddressId Integer Required Sending mail address id
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Send mail when verifying the return addressSend mail when verifying the return address
DescriptionDescription
CheckReplyToMailAddress API is used for sending mail when verifying the return address.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
CheckReplyToMailAddre
ss.
MailAddressId Integer Required Sending mail address id
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Verify the return addressVerify the return address
DescriptionDescription
ApproveReplyMailAddress API is used for verifying the return address.
Direct Mail API Reference··New API
> Document Version: 20220402 70
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
ApproveReplyMailAddre
ss.
Ticket String Required address ticket
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Setting Notification Address for Sending Address-Not available nowSetting Notification Address for Sending Address-Not available now
DescriptionDescription
UpdateMailAddressMsgCallBackUrl API is used for sett ing Notification Address for Sending Address
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
UpdateMailAddressMsg
CallBackUrl.
MailFrom String Required Sending mail address
NotifyUrl String Required
Notification URL; http
web hook or mns region
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Error codesError codes
API Reference··New API Direct Mail
71 > Document Version: 20220402
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidMailAddressName.Malform
ed
400 (Bad Request)
The specified mailAddress
accountName is wrongly formed.
InvalidNotifyUrl.Malformed 400 (Bad Request)
The specified notifyUrl is wrongly
formed.
Get the notification address of the sending address-Not availableGet the notification address of the sending address-Not available
nownow
DescriptionDescription
GetMailAddressMsgCallBackUrl API is used for gett ing the not ification address of the sending address
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
GetMailAddressMsgCallB
ackUrl.
MailFrom String Required Sending mail address
For other request parameters, see Public parameters.
Response parametersResponse parameters
NameName T ypeT ype Descript ionDescript ion
notifyUrlStatus Integer
Notify address status; 0 closes, 1
opens
notifyUrl String Notification address
For more information about public response parameters, see Public parameters.
Error codesError codes
Direct Mail API Reference··New API
> Document Version: 20220402 72
Error codeError code
HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidMailAddressName.Malform
ed
400 (Bad Request)
The specified mailAddress
accountName is wrongly formed.
Creat e receiver list
Delete receiver list
Delete a single receiver
Creat e a single receiver
Query for details of a receiver list
Query the receiver list
Create receiver listCreate receiver list
DescriptionDescription
Creat eReceiver API is used for creating a receiver list.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value: CreateReceiver.
ReceiversName String Required Receiver list name
ReceiversAlias String Required Receiver list alias
Desc String Required Description
For other request parameters, see Public parameters.
Response parametersResponse parameters
NameName T ypeT ype Descript ionDescript ion
receiverId String Receiver ID
11.3. receiver operation11.3. receiver operation
API Reference··New API Direct Mail
73 > Document Version: 20220402
For more information about public response parameters, see Public parameters.
Delete receiver listDelete receiver list
DescriptionDescription
DeleteReceiver API is used for deleting a receiver list.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value: DeleteReceiver.
ReceiverId String Required Receiver list id
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Delete a single receiverDelete a single receiver
DescriptionDescription
DeleteReceiverDetail API is used for delete a single receiver.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
DeleteReceiverDetail.
ReceiverId
String
Required
Receiver list id
Email String Required Receiver address
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Direct Mail API Reference··New API
> Document Version: 20220402 74
Create a single receiverCreate a single receiver
DescriptionDescription
SaveReceiverDetail API is used for creating a single receiver.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
SaveReceiverDet ail.
ReceiverId String Required Receiver list id
Detail String Required
Content,Limit 500
pieces of dat a,Example:
[{"b":"birthday","e":"xxx
@alibabainc.com","g":"
gender","m":"
mobile","n":"nickname",
"u":"name"}]
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Query for details of a receiver listQuery for details of a receiver list
DescriptionDescription
QueryReceiverDetail API is used for querying for details of a receiver list.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
QueryReceiverDetail.
ReceiverId String Required Receiver list id
API Reference··New API Direct Mail
75 > Document Version: 20220402
KeyWord String Optional
The query keywords is
email address and the
length 0-50,
Example:xxx@t e.com
PageSize Integer Optional
Number of Items each
page
NextStart Integer Optional Next start
NameName T ypeT ype Required?Required? Descript ionDescript ion
For other request parameters, see Public parameters.
Response parametersResponse parameters
NameName T ypeT ype Descript ionDescript ion
data data
datadata
NameName T ypeT ype Descript ionDescript ion
DetailList List Detail list record
NextStart Integer Next start
DetailListDetailList
NameName T ypeT ype Descript ionDescript ion
email String Receiver address
data String content
creat eT ime String create time
Direct Mail API Reference··New API
> Document Version: 20220402 76
utcCreateT ime Long time stamp
NameName T ypeT ype Descript ionDescript ion
For more information about public response parameters, see Public parameters.
Query the receiver listQuery the receiver list
DescriptionDescription
QueryReceiverByParam API is used for query the receiver list.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String
Required
API name, a system
required parameter.
Value:
QueryReceiverByParam.
PageSize Integer Optional
Number of Items each
page
For other request parameters, see Public parameters.
Response parametersResponse parameters
NameName T ypeT ype Descript ionDescript ion
data data
datadata
NameName T ypeT ype Descript ionDescript ion
total Intege total
data List data record
data recorddata record
API Reference··New API Direct Mail
77 > Document Version: 20220402
NameName T ypeT ype
Descript ionDescript ion
receiverId String Receiver ID
receiversName String Receiver list Name
count int T he count of receiver address
receiversAlias String Receiver list alias
desc String Description
receiversStatus int
status,uploading:0 or
completed:1)
creat eT ime String create time
utcCreateT ime Long time stamp
For more information about public response parameters, see Public parameters.
Creat e a Tag
Delete Tag
Get Tags
Modify Tag
Create a TagCreate a Tag
DescriptionDescription
Creat eTag API is used for creating a tag.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
11.4. tag operation11.4. tag operation
Direct Mail API Reference··New API
> Document Version: 20220402 78
Action String Required
API name, a system
required parameter.
Value: CreateT ag.
TagName String Required T ag name
NameName T ypeT ype Required?Required? Descript ionDescript ion
For other request parameters, see Public parameters.
Response parametersResponse parameters
NameName T ypeT ype Descript ionDescript ion
TagId int T ag id
For more information about public response parameters, see Public parameters.
Error codesError codes
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidT agNumber.Malformed 400 (Bad Request)
The number of tags exceeded
the quota.
InvalidT agName.Malformed 400 (Bad Request)
The specified tag name is
wrongly formed.
InvalidT agName.Duplicate 400 (Bad Request)
The specified tag name already
exists.
InternalError 400 (Bad Request) Unknown error.
Delete TagDelete Tag
DescriptionDescription
DeleteTag API is used for deleting a tag.
Request parametersRequest parameters
API Reference··New API Direct Mail
79 > Document Version: 20220402
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value: DeleteT ag.
TagId String
Required
Tag id
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Error codesError codes
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidT agId.Malformed 400 (Bad Request) The specified tag id is not exist s.
Get TagsGet Tags
DescriptionDescription
QueryTagByParam API is used for querying tags.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
Action String Required
API name, a system
required parameter.
Value:
QueryTagByParam.
KeyWord
String
Optional
Tag name, length 1-50,
Example:1aT ag
For other request parameters, see Public parameters.
Response parametersResponse parameters
Direct Mail API Reference··New API
> Document Version: 20220402 80
NameName T ypeT ype Descript ionDescript ion
pageNumber Int Number of pages
pageSize Int
Maximum number of T ags on a
page
totalCount Int total number of Tags
data Array data
datadata
NameName T ypeT ype Descript ionDescript ion
tagName String Tag name
TagId int T ag id
For more information about public response parameters, see Public parameters.
Error codesError codes
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidKeyword.Malformed 400 (Bad Request)
The specified param is wrongly
formed.
Modify TagModify Tag
DescriptionDescription
ModifyTag API is used for modifying a tag.
Request parametersRequest parameters
NameName T ypeT ype Required?Required? Descript ionDescript ion
API Reference··New API Direct Mail
81 > Document Version: 20220402
Action String Required
API name, a system
required parameter.
Value: ModifyTag.
TagId Integer Required T ag id
TagName String Required T ag name
NameName T ypeT ype Required?Required? Descript ionDescript ion
For other request parameters, see Public parameters.
Response parametersResponse parameters
For more information about public response parameters, see Public parameters.
Error codesError codes
Error codeError code HT T P st at us codeHT T P st at us code MeaningMeaning
InvalidT ag.Not Found 400 (Bad Request) T he specified tag was not found.
InvalidT agId.Malformed 400 (Bad Request) The specified tag id is not exist s.
InvalidT agNumber.Malformed 400 (Bad Request)
The number of tags exceeded
the quota.
InvalidT agName.Malformed 400 (Bad Request)
The specified tag name is
wrongly formed.
InvalidT agName.Duplicate 400 (Bad Request)
The specified tag name already
exists.
InternalError 400 (Bad Request) Unknown error.
Direct Mail API Reference··New API
> Document Version: 20220402 82