SMS balance inquiry API

Last updated:2021-12-15
Expand all
SMS balance inquiry API
  • Support querying developer account balance
  • Supports querying application balance

Account balance inquiry API

Function description

  • Query the account balance. The account balance refers to the SMS balance that is not allocated to an application and belongs to the account.

Calling address

HTTP verify

use HTTP Basic Authentication way to do access authorization. This whole API Requests can be made using the common HTTP Tools to complete, such as:curl, browser plug-ins, etc.;

HTTP Header(Header) Add a field (Key/Valueright):

Authorization: Basic base64_auth_string
          Authorization: Basic base64_auth_string

        
This code block is shown in the floating window

in base64_auth_string The generation algorithm is:base64(devKey:apiDevSecret), that is: right devKey Add a colon, add API DevSecret Assemble the string and then do base64 Convert.devKey、apiDevSecret It can be viewed in the console personal information.

Request example

curl --insecure -X GET -v https://api.sms.jpush.cn/v1/accounts/dev -H "Content-Type: application/json" -u "7e503edcb0cb725e331b0311:7289516381dcdf1113730f2b"
          curl --insecure -X GET -v https://api.sms.jpush.cn/v1/accounts/dev -H "Content-Type: application/json" -u "7e503edcb0cb725e331b0311:7289516381dcdf1113730f2b"

        
This code block is shown in the floating window

Return example

Sent successfully
{ "dev_balance": 9, "dev_voice": 702, "dev_industry": 121981, "dev_market": 11683 }
          { "dev_balance": 9,  "dev_voice": 702, "dev_industry": 121981, "dev_market": 11683 }

        
This code block is shown in the floating window

Response Params

  • dev_balance All types of SMS balance
  • dev_voice Voice message balance
  • dev_industry Industry SMS margin
  • dev_market Marketing SMS margin
  • If field value returns null That is the unallocated balance
Sending failed
{ "error": { "code": *****, "message": "*****" } }
          {
  "error": {
    "code": *****,
    "message": "*****"
  }
}

        
This code block is shown in the floating window

Application balance query API

Function description

  • Query the application balance, which refers to the SMS balance allocated to an application for independent use.

Calling address

HTTP verify

use HTTP Basic Authentication way to do access authorization. This whole API Requests can be made using the common HTTP Tools to complete, such as:curl, browser plug-ins, etc.;

HTTP Header(Header) Add a field (Key/Valueright):

Authorization: Basic base64_auth_string
          Authorization: Basic base64_auth_string

        
This code block is shown in the floating window

in base64_auth_string The generation algorithm is:base64(appKey:masterSecret), that is: right appKey Add a colon, add masterSecret Assemble the string and then do base64 Convert.appKey、masterSecret This can be viewed in the console application settings.

Request example

curl --insecure -X GET -v https://api.sms.jpush.cn/v1/accounts/app -H "Content-Type: application/json" -u "4c6921c9b20b2fd9bcd8ca3d:5b3e2979c8a48b84cebeaaf4"
          curl --insecure -X GET -v https://api.sms.jpush.cn/v1/accounts/app -H "Content-Type: application/json" -u "4c6921c9b20b2fd9bcd8ca3d:5b3e2979c8a48b84cebeaaf4"

        
This code block is shown in the floating window

Return example

Sent successfully
{ "app_balance": 1, "app_voice": 22, "app_industry": 44, "app_market": 14 }
          { "app_balance": 1, "app_voice": 22, "app_industry": 44, "app_market": 14 }

        
This code block is shown in the floating window

Response Params

  • app_balance All types of SMS balance
  • app_voice Voice message balance
  • app_industry Industry SMS margin
  • app_market Marketing SMS margin
  • If field value returns null That is the unallocated balance
Sending failed
{ "error": { "code": *****, "message": "*****" } }
          {
  "error": {
    "code": *****,
    "message": "*****"
  }
}

        
This code block is shown in the floating window

return code

Click to view return code description

Was this document helpful?

Copyright 2011-2026, jiguang.cn, All Rights Reserved. 粤ICP备12056275号-13 Shenzhen Hexun Huagu Information Technology Co., Ltd.

Open in Docs Center