Domain

User must configure the mail domain to send emails by SendCloud.

You can query, add or modify the domain.


Query (Batch Query)

Query domain through this interface.

URL

https://api.sendcloud.net/apiv2/domain/list

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
apiUser string yes API_USER
apiKey string yes API_KEY
name string no domain name, multiple names are separated by semicolons
type int no domain type: 0 (testing domain), 1(common domain)
verify string no domain verification value; for example, verify=1, query the domain with verification value of 1; verify is ">22", query the domain with verification value greater than or equal to 22; verify is "<12", query the domain with verification value less than or equal to 12

Note

Domain verification value is the value returned when SendCloud verify domain configuration.Users are required to configure domains following the guide in delivery settings -> domain. Here is a list of ways to calculate whether configuration items have been verified with the returned value:

type calculation method description
dkim ret & 1 == 1 dkim configuration verified
spf ret & 2 == 2 spf configuration verified
mx ret & 4 == 4 mx configuration verified
dmarc verify & 32 ==32 dmarc configuration verified

Example:

ret = 0  | no configuration items verified
ret = 3  | dkim, spf configuration verified
verify = 7 | dkim, spf, mx configuration verified
verify = 38 | spf, dmarc, mx configuration verified
verify = 39 | dkim, spf, mx, dmarc configuration verified

Request Example

https://api.sendcloud.net/apiv2/domain/get?apiUser=***&apiKey=***&name=ifaxin.com

Returned value description

Parameter Description
name domain name
type domain type
verify verification value
spf.domain host record of SPF
spf.value configuration value of SPF
dkim.domain host record of DKIM
dkim.value configuration value of DKIM
dmarc.domain host record of Dmarc
dmarc.value configuration value of Dmarc
mx.domain host record of MX
mx.value configuration value of MX
gmtCreated time of domain creation
ipType 0 share;1 independent
gmtUpdated time of domain modification

返回值示例

{
  "result": true,
  "statusCode": 200,
  "message": "请求成功",
  "info": {
    "dataList": [
      {
        "name": "***",
        "type": "普通",
        "verify": 30,
        "spf.domain": "***",
        "spf.value": "v=spf1 include:spf.sendcloud.org -all",
        "dkim.domain": "***",
        "dkim.value": "k=rsa;p=***",
        "cname.domain": "***",
        "cname.value": "***",
        "mx.domain": "***",
        "mx.value": "***",
        "gmtCreated": "2014-11-01 22:41:52",
        "gmtUpdated": "2015-09-25 10:56:06"
      }
    ],
    "count": 1
  }
}

Add

Add domains through this interface

URL

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

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
apiUser string yes API_USER
apiKey string yes API_KEY
name string yes domain name

Note

1.Domain name cannot contain `sendcloud`, `ifaxin`
2.Domain name cannot be longer than 250 characters
3.Each user can add up to  5 domains

Request Example

https://api.sendcloud.net/apiv2/domain/add?apiUser=***&apiKey=***&name=mail.liubida.cn

Returned value description

Return to eligible domain information.

Parameter Description
name domain name
type domain type
verify verification value
spf.domain host record of SPF
spf.value configuration value of SPF
dkim.domain host record of DKIM
dkim.value configuration value of DKIM
cname.domain host record of CNAME
cname.value configuration value of CNAME
mx.domain host record of MX
mx.value configuration value of MX
gmtCreated time of domain creation
gmtUpdated time of domain modification

Returned value example

{
    statusCode: 200,
    info: {
        data: {
            "name": "***",
            "type": "普通",
            "verify": 0,
            "spf.domain": "***",
            "spf.value": "v=spf1 include:spf.sendcloud.org -all",
            "dkim.domain": "***",
            "dkim.value": "k=rsa;p=***",
            "cname.domain": "***",
            "cname.value": "***",
            "mx.domain": "***",
            "mx.value": "***",
            "gmtCreated": "2014-11-01 22:41:52",
            "gmtUpdated": "2015-09-25 10:56:06"
        }
    },
    message: "请求成功",
    result: true
}

Modify

Modify domains through this interface

URL

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

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
apiUser string yes API_USER
apiKey string yes API_KEY
name string yes domain name
newName string yes new name of domain

Note

Domains with verified configuration cannot be modified

Request Example

https://api.sendcloud.net/apiv2/domain/update?apiUser=***&apiKey=***&name=mail.liubida.cn&name=email.liubida.cn

Returned value description

Return to eligible domain information

Parameter Description
name domain name
type domain type
verify verification value
spf.domain host record of SPF
spf.value configuration value of SPF
dkim.domain host record of DKIM
dkim.value configuration value of DKIM
dmarc.domain host record of CNAME
dmarc.value configuration value of CNAME
mx.domain host record of MX
mx.value configuration value of MX
gmtCreated time of domain creation
gmtUpdated time of domain modification

Returned value example

{
    statusCode: 200,
    info: {
        data: {
            "name": "***",
            "type": "普通",
            "verify": 30,
            "spf.domain": "***",
            "spf.value": "v=spf1 include:spf.sendcloud.org -all",
            "dkim.domain": "***",
            "dkim.value": "k=rsa;p=***",
            "dmarc.domain": "***",
            "dmarc.value": "***",
            "mx.domain": "***",
            "mx.value": "***",
            "gmtCreated": "2014-11-01 22:41:52",
            "gmtUpdated": "2015-09-25 10:56:06"
        }
    },
    message: "请求成功",
    result: true
}