# 转信路由
使用收信路由可将“回复邮件”的消息推送至指定URL/邮箱
你可以使用 API 对收信路由进行查询, 添加, 删除
# 查询 ( 批量 )
返回收信路由的列表信息
URL
https://api2.sendcloud.net/api/route/list
1
HTTP请求方式
post get
1
参数说明
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
apiUser | string | 是 | API_USER |
apiKey | string | 是 | API_KEY |
domain | string | 否 | 域名 |
start | int | 否 | 查询起始位置, 取值区间 [0-], 默认为 0 |
limit | int | 否 | 查询个数, 取值区间 [0-100], 默认为 100 |
请求示例
https://api2.sendcloud.net/api/route/list?apiUser=***&apiKey=***&domain=post.sc.com&start=0&limit=10
1
返回值说明
参数 | 说明 |
---|---|
id | 路由ID |
domain | 域名 |
expression | 收信路由 |
action | URL/邮箱 |
apiUserRoute | action为邮箱时不为空 |
返回值示例
{
"info": {
"dataList": [
{
"id": 1,
"domain": "post.sc.com",
"expression": "*@post.sc.com",
"action": "http://requestb.in/13kup3a1"
},
{
"id": 2,
"domain": "notice.sc.com",
"expression": "*@notice.sc.com",
"action": "admin@notice.sc.com",
"apiUserRoute": "sctest"
}
],
"total": 2,
"count": 2
},
"statusCode": 200,
"message": "请求成功",
"result": true
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 查询
URL
https://api2.sendcloud.net/api/route/get
1
HTTP请求方式
post get
1
参数说明
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
apiUser | string | 是 | API_USER |
apiKey | string | 是 | API_KEY |
routeId | int | 是 | 路由ID |
请求示例
https://api2.sendcloud.net/api/route/get?apiUser=***&apiKey=***&routeId=1
1
**返回值说明 **
参数 | 说明 |
---|---|
id | 路由ID |
domain | 域名 |
expression | 收信路由 |
action | URL/邮箱 |
apiUserRoute | action为邮箱时不为空 |
{
"info": {
"data": {
"id": 1,
"domain": "post.sc.com",
"expression": "*@post.sc.com",
"action": "admin@post.sc.com",
"apiUserRoute": "sctest"
}
},
"statusCode": 200,
"message": "请求成功",
"result": true
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# 添加
URL
https://api2.sendcloud.net/api/route/add
1
HTTP请求方式
post get
1
参数说明
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
apiUser | string | 是 | API_USER |
apiKey | string | 是 | API_KEY |
expression | string | 是 | 收信路由。格式为“正则表达式@域名”;也可以为具体的邮箱。域名/邮箱域名需是已验证或可使用的发信域名 |
action | string | 是 | URL/邮箱 |
apiUserRoute | string | * | action为邮箱时,此参数必填 |
请求示例
https://api2.sendcloud.net/api/route/add?apiUser=***&apiKey=***&expression=*@post.sc.com&action=admin@post.sc.com&apiUserRoute=sctest
1
返回值说明
参数 | 说明 |
---|---|
id | 路由ID |
domain | 域名 |
expression | 收信路由 |
action | URL/邮箱 |
apiUserRoute | 转信到邮箱时,将使用此API_USER进行转信发送 |
返回值示例
{
"info": {
"data": {
"id": 1,
"domain": "post.sc.com",
"expression": "*@post.sc.com",
"action": "admin@post.sc.com",
"apiUserRoute": "sctest"
}
},
"statusCode": 200,
"message": "请求成功",
"result": true
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# 修改
URL
https://api2.sendcloud.net/api/route/update
1
HTTP请求方式
post get
1
参数说明
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
apiUser | string | 是 | API_USER |
apiKey | string | 是 | API_KEY |
routeId | int | 是 | 路由ID |
expression | string | 是 | 收信路由 |
action | string | 是 | URL/邮箱 |
apiUserRoute | string | * | action为邮箱时,此参数必填 |
请求示例
https://api2.sendcloud.net/api/route/update?apiUser=***&apiKey=***&routeId=1&expression=*@post.sc.com&action=http://requestb.in/13kup3a1
1
返回值说明
参数 | 说明 |
---|---|
count | 更新个数 |
返回值示例
{
"statusCode": 200,
"info": {
"count": 1
},
"message": "请求成功",
"result": true
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 删除
URL
https://api2.sendcloud.net/api/route/delete
1
HTTP请求方式
post get
1
参数说明
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
apiUser | string | 是 | API_USER |
apiKey | string | 是 | API_KEY |
routeId | int | 是 | 路由ID |
请求示例
https://api2.sendcloud.net/api/route/delete?apiUser=***&apiKey=***&routeId=1
1
返回值说明
参数 | 说明 |
---|---|
count | 成功删除的个数 |
返回值示例
{
"statusCode": 200,
"info": {
"count": 1
},
"message": "请求成功",
"result": true
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8