请求接口
子账户查询
URL
https://mis.sendcloud.net/api/subAccount/list
返回数据格式
JSON
HTTP请求方式
GET POST
参数说明
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
| appId | string | 是 | APP_ID |
| username | string | 否 | 子账户名 |
| startNo | int | 否 | 查询起始位置, 取值区间 [0-], 默认为 0 |
| pageSize | int | 否 | 查询个数, 取值区间 [0-200], 默认为 10 |
| signature | string | 是 | 数字签名, 合法性验证,详情见API签名验证机制 |
| timestamp | string | 否 | UNIX时间戳,详情见API时间戳验证机制 |
请求示例
curl -X POST "https://mis.sendcloud.net/api/subAccount/list" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "appId=YOUR_APP_ID" \
--data-urlencode "username=USER_NAME" \
--data-urlencode "startNo=0" \
--data-urlencode "pageSize=10" \
--data-urlencode "signature=YOUR_SIGNATURE"
返回值说明
| 参数 | 说明 |
|---|---|
| freeze | 冻结子账户数 |
| available | 可用子账户数 |
| total | 总子账户数 |
| count | 当前页返回的子账户数 |
| list | |
| └username | 子账户名 |
| └phone | 子账户的手机号 |
| └userType | 子账户类型 0 SendCloud ,1 iFaxin |
| └status | 1 正常,-1 冻结 |
| └balance | 子账户余额 |
| └quota | 当天请求额度 |
| └todayUsedQuota | 当天已使用的额度 |
返回示例
{
"message": "请求成功",
"result": true,
"info": {
"total": 3,
"freeze": 0,
"available": 3,
"count": 3,
"list": [
{
"phone": "15172212992",
"balance": 0.00,
"userType": 0,
"username": "wangbowen123",
"quota": 2500,
"todayUsedQuota": 2,
"status": 1
},
{
"phone": "184040713",
"balance": 521.00,
"userType": 0,
"username": "yuanabao_test_27",
"quota": 2500,
"todayUsedQuota": 2,
"status": 1
},
{
"phone": "13307766289",
"balance": 1020.00,
"userType": 1,
"username": "GuokaiNew",
"quota": 2500,
"todayUsedQuota": 2,
"status": 1
}
]
},
"statusCode": 200
}
子账户创建
URL
https://mis.sendcloud.net/api/subAccount/create
返回数据格式
JSON
HTTP请求方式
POST
参数说明
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
| appId | string | 是 | APP_ID |
| username | string | 是 | 子账户名 |
| userType | int | 是 | 子账户类型 0 SendCloud,1iFaxin |
| phone | string | 否 | 手机号 |
| companyName | string | 是 | 公司名称 |
| companyUrl | string | 是 | 公司网址 |
| pwd | string | 是 | 密码 |
| signature | string | 是 | 数字签名,合法性验证,详情见API 验证机制 |
| timestamp | string | 否 | UNIX时间戳,详情见API时间戳验证机制 |
请求示例
curl -X POST "https://mis.sendcloud.net/api/subAccount/create"
--header "Content-Type: application/x-www-form-urlencoded"
--data-urlencode "appId=YOUR_APP_ID" \
--data-urlencode "username=sdfwevsdf" \
--data-urlencode "userType=0" \
--data-urlencode "companyName=公司" \
--data-urlencode "companyUrl=https://www.baidu.com" \
--data-urlencode "pwd=321Abc" \
--data-urlencode "signature=YOUR_SIGNATURE"
返回值说明
| 参数 | 说明 | 备注 |
|---|---|---|
| apiUser | 子账号API_USER | 仅SendCloud账户返回 |
| apiKey | 子账号API_KEY | 仅SendCloud账户返回 |
返回示例
{
"message": "请求成功",
"result": true,
"info": {
"apiUser": "cyber_test_P0j6KR",
"apiKey": "EQpxQFAwqFgxXZsF"
},
"statusCode": 200
}
子账户分账
URL
https://mis.sendcloud.net/api/subAccount/transferIn
返回数据格式
JSON
HTTP请求方式
POST
参数说明
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
| appId | string | 是 | APP_ID |
| money | string | 是 | 分账金额(格式形如 100.00, 105,对应数量大小限制 1.00 ~ 10000.00) |
| username | string | 是 | 子账户名 |
| signature | string | 是 | 数字签名,合法性验证,详情见API 验证机制 |
| timestamp | string | 否 | UNIX时间戳,详情见API时间戳验证机制 |
请求示例
curl -X POST "https://mis.sendcloud.net/api/subAccount/transferIn"
--header "Content-Type: application/x-www-form-urlencoded"
--data-urlencode "appId=YOUR_APP_ID" \
--data-urlencode "username=adf54654" \
--data-urlencode "money=654.00" \
--data-urlencode "signature=YOUR_SIGNATURE"
接口返回码
| API返回码 | 含义 |
|---|---|
| 200 | 请求成功 |
| 400 | 请求失败 |
| 401 | AppId不能为空 |
| 402 | 找不到该appId |
| 403 | 签名参数错误 |
| 404 | 签名错误 |
| 405 | 邮箱不能为空且确保格式正确 |
| 406 | 手机号不能为空且保证格式正确 |
| 407 | 用户名不能为空 |
| 408 | 公司名称不能为空 |
| 409 | 公司网址不能为空 |
| 410 | 密码不能为空 |
| 413 | 密码设置不符合规则 |
| 414 | 公司网址无效 |
| 415 | 账户类型错误 |
| 416 | 余额为负,请充值后再来 |
| 417 | 关联子账户超出限制 |
| 418 | 用户名已存在 |
| 419 | 手机号已存在 |
| 420 | 余额不足分账失败 |
| 421 | 分账金额错误 |
| 422 | 分账金额不正确 |
| 423 | 找不到该用户名 |
| 424 | 查询条数限制 |
| 425 | 时间戳无效 |
| 426 | 用户名格式不正确 |
| 101 | 保存失败 |
| 102 | 更新失败 |
| 103 | 删除失败 |
| 104 | 分账失败 |
子账户额度调整
URL
https://mis.sendcloud.net/api/subAccount/quota
返回数据格式
JSON
HTTP请求方式
POST
参数说明
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
| appId | string | 是 | APP_ID |
| username | string | 是 | 子账户名 |
| quota | int | 是 | 当天请求量额度 |
| signature | string | 是 | 数字签名, 合法性验证,详情见API签名验证机制 |
| timestamp | string | 否 | UNIX时间戳,详情见API时间戳验证机制 |
请求示例
curl -X POST "https://mis.sendcloud.net/api/subAccount/quota" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "appId=YOUR_APP_ID" \
--data-urlencode "username=USER_NAME" \
--data-urlencode "quota=2500" \
--data-urlencode "signature=YOUR_SIGNATURE"
返回值说明
| 参数 | 说明 |
|---|---|
| username | 子账户名 |
| quota | 调整后的当天请求额度 |
| todayUsedQuota | 当天已请求量 |
返回示例
{
"message": "请求成功",
"result": true,
"info": {
"username": "wangbowen123",
"quota": 2500,
"todayUsedQuota": 2
},
"statusCode": 200
}
子账户账单数据
URL
https://mis.sendcloud.net/api/subAccount/bill
返回数据格式
JSON
HTTP请求方式
GET POST
参数说明
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
| appId | string | 是 | APP_ID |
| startMonth | string | 是 | 开始月份,格式为 yyyyMM |
| endMonth | string | 是 | 结束月份,格式为 yyyyMM |
| startNo | int | 否 | 查询起始位置,取值区间 [0-],默认为 0 |
| pageSize | int | 否 | 查询子账户单页个数,取值区间 [0-200],默认为 10 |
| username | string | 否 | 子账户名,精准查询 |
| signature | string | 是 | 数字签名,合法性验证,详情见API 验证机制 |
| timestamp | string | 否 | UNIX时间戳,详情见API时间戳验证机制 |
说明:
1.子账户为 SendCloud, iFaxin 时,账单返回的机制略有不同,与页面一致。
例如,当前时间为2023年4月7日,需要查询2023年3月至4月的子账户账单数据, 子账户为 SendCloud 时,返回的数据为3月账单 子账户为 iFaxin 时,返回的数据为3月账单和4月1日~4月7日的账单。
请求示例
curl -X POST "https://mis.sendcloud.net/api/subAccount/bill"
--header "Content-Type: application/x-www-form-urlencoded"
--data-urlencode "appId=YOUR_APP_ID" \
--data-urlencode "startNo=0" \
--data-urlencode "pageSize=10" \
--data-urlencode "startMonth=202301" \
--data-urlencode "endMonth=202304" \
--data-urlencode "signature=YOUR_SIGNATURE"
返回值说明
| 参数 | 说明 |
|---|---|
| total | 总子账户数 |
| count | 当前页返回的子账户数 |
| list | |
| └username | 子账户名称 |
| └userType | 子账户类型 0 SendCloud,1 iFaxin |
| └billData | 账单数据 |
| └date | 账单日期 |
| └totalMoney | 账单日期内总金额 |
| └consumeOrders | 消费项目 |
| └orderType | 消费项目类型,见下表 |
| └desc | 消费项目描述 |
| └remark | 计费数量 |
| └component | 计费数量单位 |
| └orderMoney | 消费项目金额 |
返回示例
{
"message": "请求成功",
"result": true,
"statusCode": 200,
"info": {
"total": 100,
"count": 10,
"list": [
{
"username": "sendcloud62",
"userType": 0,
"billData": [
{
"date": "2023-04",
"totalMoney": 25991.09,
"consumeOrders": [
{
"orderType": 2,
"desc": "邮件费用",
"remark": 256465,
"component": "封",
"orderMoney": 14439.69
},
{
"orderType": 3,
"desc": "IP费用",
"remark": 28,
"component": "个",
"orderMoney": 2099.98
}
]
},
{
"date": "2023-03",
"totalMoney": 25991.98,
"consumeOrders": [
{
"orderType": 2,
"desc": "邮件费用",
"remark": 256465,
"component": "封",
"orderMoney": 14439.6
},
{
"orderType": 3,
"desc": "IP费用",
"remark": 28,
"component": "个",
"orderMoney": 2099
}
]
}
]
},
{
"username": "sendcloud63",
"userType": 0,
"billData": [
{
"date": "2023-04",
"totalMoney": 25991.09,
"consumeOrders": [
{
"orderType": 2,
"desc": "邮件费用",
"remark": 256465,
"component": "封",
"orderMoney": 14439.69
},
{
"orderType": 3,
"desc": "IP费用",
"remark": 28,
"component": "个",
"orderMoney": 2099.98
}
]
},
{
"date": "2023-03",
"totalMoney": 25991.98,
"consumeOrders": [
{
"orderType": 2,
"desc": "邮件费用",
"remark": 256465,
"component": "封",
"orderMoney": 14439.6
},
{
"orderType": 3,
"desc": "IP费用",
"remark": 28,
"component": "个",
"orderMoney": 2099
}
]
}
]
}
]
}
}
子账户账单明细数据
URL
https://mis.sendcloud.net/api/subAccount/billDetail
返回数据格式
JSON
HTTP请求方式
GET POST
参数说明
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
| appId | string | 是 | APP_ID |
| startMonth | string | 是 | 开始日期,格式为 yyyyMM |
| endMonth | string | 是 | 结束日期,格式为 yyyyMM |
| startNo | int | 否 | 查询起始位置,取值区间 [0-],默认为 0 |
| pageSize | int | 否 | 查询子账户单页个数,取值区间 [0-200],默认为 10 |
| username | string | 否 | 子账户名,精准查询 |
| signature | string | 是 | 数字签名,合法性验证,详情见API 验证机制 |
| timestamp | string | 否 | UNIX时间戳,详情见API时间戳验证机制 |
请求示例
curl -X POST "https://mis.sendcloud.net/api/subAccount/billDetail"
--header "Content-Type: application/x-www-form-urlencoded"
--data-urlencode "appId=YOUR_APP_ID" \
--data-urlencode "startNo=0" \
--data-urlencode "pageSize=10" \
--data-urlencode "startMonth=202301" \
--data-urlencode "endMonth=202304" \
--data-urlencode "signature=YOUR_SIGNATURE"
返回值说明
| 参数 | 说明 |
|---|---|
| total | 总子账户数 |
| count | 当前页返回的子账户数 |
| list | |
| └username | 子账户名称 |
| └userType | 子账户类型 0 SendCloud,1 iFaxin |
| └billDetail | 账单数据 |
| └date | 账单日期 |
| └orderType | 消费项目类型,见下表 |
| └desc | 消费项目描述 |
| └remark | 消费项目计费数量 |
| └component | 计费数量单位 |
| └orderMoney | 消费项目金额 |
| └info | |
| └level | 梯度级别 |
| └price | 单价 |
| └unit | 单价对应单位数量 |
| └minValue | 阶梯梯度最小值 |
| └maxValue | 阶梯梯度最大值 |
| └count | 计费数量 |
| └money | 消费金额 |
| └countryId | 国家ID |
| └countryName | 国家名称 |
| └IP | IP |
| └type | IP类型 |
| └lastMonthAmount | 上月已扣计费数量 |
| └lastMonthMoney | 上月已扣消费金额 |
| └totalEmailDataCount | 上月总邮件流量(M) |
| └freeEmailDataCount | 上月免费邮件流量(M) |
| └payEmailDataCount | 计费邮件流量(M) |
说明:
1.
infoObject 里的字段格式,会由于 orderType 的不同而有所区别,返回示例已经将全部的字段格式做了列举,具体参见返回示例。2.不支持查询爱发信账户账单明细数据。
返回示例
{
"result": true,
"statusCode": 200,
"message": "请求成功",
"info": {
"total": 16,
"count": 16,
"list": [{
"username": "ctse",
"userType": 0,
"billDetail": []
},
{
"username": "sendcloud3",
"userType": 0,
"billDetail": [{
"date": "2023-02",
"orderType": 1,
"desc": "邮件费用",
"remark": 299155,
"component": "封",
"orderMoney": 1999.0,
"info": [{
"unit": 0,
"minValue": 0,
"money": 799.0,
"level": 0,
"price": 799.0,
"maxValue": 100000,
"count": 100000
}, {
"unit": 1000,
"minValue": 100000,
"money": 1200.0,
"level": 1,
"price": 6.0,
"maxValue": 10000000,
"count": 199155
}]
}, {
"date": "2023-02",
"orderType": 12,
"desc": "国际短信费用",
"remark": 5600,
"component": "条",
"orderMoney": 2755.4,
"info": [{
"money": 1099.9,
"price": 0.34,
"count": 3235,
"countryName": "马来西亚",
"countryId": 170
}, {
"money": 1655.5,
"price": 0.7,
"count": 2365,
"countryName": "越南",
"countryId": 208
}]
}, {
"date": "2023-02",
"orderType": 10,
"desc": "短信费用",
"remark": 126061,
"component": "条",
"orderMoney": 5042.44,
"info": {
"unit": 1,
"minValue": 0,
"money": 1372.338,
"level": 0,
"price": 0.033,
"maxValue": 100000000,
"count": 41586
}
}, {
"date": "2023-02",
"orderType": 6,
"desc": "上月邮件补扣",
"remark": 5486,
"component": "封",
"orderMoney": 25,
"info": {
"lastMonthMoney": 290466,
"lastMonthAmount": 1854.00,
"list":
[{
"level": 0,
"price": 1399.00,
"unit": 0,
"minValue": 0,
"maxValue": 200000,
"count": 200000,
"money": 1399.00
},
{
"level": 0,
"price": 5.00,
"unit": 1000,
"minValue": 200000,
"maxValue": 100000000,
"count": 95952,
"money": 480.00
}]
}
},
{
"date": "2023-03",
"orderType": 33,
"desc": "国际短信补扣",
"remark": 23,
"component": "条",
"orderMoney": 10.29,
"info": {
"lastMonthMoney": 26.28,
"lastMonthAmount": 107,
"list": [
{
"money": 20.90,
"price": 0.207,
"count": 101,
"countryName": "美国",
"countryId": 1
}, {
"money": 15.66,
"price": 0.54,
"count": 29,
"countryName": "其它国家",
"countryId": 213
}]
}
}, {
"date": "2023-03",
"orderType": 2,
"desc": "IP费用",
"remark": 0,
"component": "个",
"orderMoney": 2000.0,
"info": [{
"money": 500.0,
"price": 500.0,
"ip": "192.168.0.65",
"type": "国内"
}, {
"money": 500.0,
"price": 500.0,
"ip": "192.168.0.149",
"type": "国内"
}]
},
{
"date": "2023-03",
"orderType": 30,
"desc": "邮件流量费用",
"remark": 0,
"component": "MB",
"orderMoney": 135.89,
"info": {
"payEmailDataCount": 67947.42,
"money": 135.89,
"price": 0.002,
"totalEmailDataCount": 68913.63,
"freeEmailDataCount": 966.22
}
}]
}]
}
}
消费项目状态码及描述
| orderType | desc |
|---|---|
| 1 | 邮件费用 |
| 2 | IP费用 |
| 3 | 虚拟扣费 |
| 4 | 邮寄费用 |
| 5 | 邮件补扣 |
| 6 | 邮件返账(金额为负数) |
| 10 | 短信费用 |
| 11 | 彩信费用 |
| 12 | 国际短信费用 |
| 13 | 语音费用 |
| 14 | 短信补扣 |
| 15 | 人工补扣 |
| 16 | 网易通费用 |
| 17 | 新浪通费用 |
| 20 | 海外通费用 |
| 21 | S+邮件内容 |
| 22 | S+邮件日志 |
| 25 | 短信通知费用 |
| 28 | 脱敏存储费用 |
| 29 | 网易通固定IP费用 |
| 30 | 邮件流量费用 |
| 32 | 彩信补扣 |
| 33 | 国际短信补扣 |
| 34 | 语音补扣 |
| 35 | 地址分级费用 |
| 36 | 短信短链接费用 |
| 37 | 短信返账(金额为负数) |
| 38 | 短信任务功能费用 |
| 39 | S+短信内容 |
| 40 | 工作流邮件费用 |
| 48 | 短信增量包使用 |
| 49 | 邮件增量包使用 |
| 50 | 购买短信增量包 |
| 51 | 购买邮件增量包 |
| 54 | 影信费用 |
| 55 | 影信补扣 |
| 56 | 短信增量包补扣 |
| 57 | 邮件增量包补扣 |
| 58 | 网易年审代缴 |