SY-P01-1.0.001
API: mail/balancelog - 郵件余額日志查詢
概覽
mail/balancelog
是 SUBMAIL 的郵件余額變更記錄查詢 API。
使用 mail/balancelog
可以實(shí)時(shí)獲取您賬戶的郵件余額變更記錄。
URL
https://api-v4.mysubmail.com/mail/balancelog
支持格式
格式 | URL |
---|
json | https://api-v4.mysubmail.com/balance/mail/balancelog.json (默認(rèn)) |
http 請(qǐng)求方式
請(qǐng)求方式 | content-type設(shè)置 |
---|
http post | multipart/form-data、x-www-form-urlencoded、application/json |
是否需要授權(quán)
是
balance/mail POST 方法 請(qǐng)求參數(shù)
參數(shù) | 類型 | 必需/可選 | 默認(rèn) | 描述 |
---|
appid | string | 必需 | 無 | 在 SUBMAIL 應(yīng)用集成中創(chuàng)建的郵件應(yīng)用ID |
timestamp | UNIX 時(shí)間戳 | 可選 | 無 | 參閱 API 授權(quán)與驗(yàn)證機(jī)制 > Timestamp UNIX 時(shí)間戳 |
sign_type | string | 可選 | normal | API 授權(quán)模式( md5 or sha1 or normal )參閱 API 授權(quán)與驗(yàn)證機(jī)制 > 授權(quán)和驗(yàn)證方式 |
signature | string | 必需 | 無 | 應(yīng)用密匙 _或 _數(shù)字簽名參閱 API 授權(quán)與驗(yàn)證機(jī)制 > 授權(quán)和驗(yàn)證方式 |
start_date | UNIX 時(shí)間戳 | 可選 | 1天前 | 開始時(shí)間,unix時(shí)間戳,精確到秒 eg:1640100000 |
end_date | UNIX 時(shí)間戳 | 可選 | 當(dāng)前時(shí)間 | 結(jié)束時(shí)間,unix時(shí)間戳,精確到秒 eg:1640100000 |
代碼示例
發(fā)送 CURL
curl -d "appid=your_appid&signature=your_appkey" http://api-v4.mysubmail.com/mail/balancelog
返回
{
"data": [
{
"datetime": "2024-08-05 14:04:15", //余額變更時(shí)間
"mail_add_credits": "20112", //余額變更數(shù)量
"mail_after_credits": "128140", //余額變更后賬戶余額
"mail_before_credits": "108028", //余額變更前賬戶余額
"message": "贈(zèng)送/補(bǔ)發(fā)" //描述
}
],
"status": "success"
}
返回值
請(qǐng)求失敗
{
"status":"error",
"code":"1xx",
"msg":"error message"
}
錯(cuò)誤代碼