How can I Check how many API or SMS Credits an ASM account has Remaining?

Document ID : KB000044525
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction:
     Each App Synthetic Monitor Subscription provides a number of API calls that can be made per day and SMS alert messages that can be sent per month as specified here: https://asm.ca.com/en/plans.php

 

Question:
     How can I check how many API or SMS credits an ASM account has remaining?

 

Answer:
     The number of remaining SMS and API credits an account has available can be checked using a free API call acct_credits: https://api.asm.ca.com/1.6/acct_credits?doc

To check for your account....

1- Login into the ASM API by making a call to acct_login: https://api.asm.ca.com/1.6/acct_login?doc
2- Enter your ASM Account Name (an email address), your API password, and click "exec" as shown below
Acct_Login.png
3- Assuming your credentials are correct, you will receive a session id reffered to as an "nkey". Copy this value for use in the subsequent command.
 

     <?xml version="1.0" encoding="UTF-8" ?>
     - <watchmouse version="8.4.0.6/8.4.0.6">
          <code>0</code>
          <info>token/new session</info>
          <elapsed>182.3711</elapsed>
         - <result>
             <nkey>_____________</nkey>
             <uid>104028</uid>
             <country>us</country>
             <lang>en</lang>
           </result>
       </watchmouse>
4- To check the number of credits available to your ASM account, use the command acct_credits: https://api.asm.ca.com/1.6/acct_credits?doc
5- Enter your nKey and click "Exec" as shown below: 


Acct_credits.png

Results will display in the following format where "available" is the number of API credits you have remaining.

      <?xml version="1.0" encoding="UTF-8" ?>
      - <watchmouse version="8.4.0.6/8.4.0.6">
          <code>0</code>
          <info>account credits</info>
          <elapsed>36.0811</elapsed>
            - <result>
                - <credits>
                     - <credit>
                         <type>sms</type>
                         <amount>9999.00</amount>
                         <credit_limit>0.00</credit_limit>
                         <available>9999.00</available>
                       </credit>
                     - <credit>
                          <type>api</type>
                          <amount>98964.00</amount>
                          <credit_limit>0.00</credit_limit>
                          <available>98964.00</available>
                        </credit>
                     - <credit>
                          <type>check</type>
                          <amount>43920.00</amount>
                          <credit_limit>0.00</credit_limit>
                          <available>43920.00</available> 
                      </credit>
                </credits>
          </result>
     </watchmouse>
 
     Please note that "check" credits refer to the number of manual checks that can be run under the Tools section of the ASM UI. For example: https://asm.ca.com/en/checkit.php consumes 1 credit for each checkpoint that returns a result. When running these commands as a subaccount, the results returned will be a subset of the credits available to the master ASM account associated with that subaccount. 

 

Additional Information:
     A full list of API commands can be found here: https://api.asm.ca.com/1.6/index.php . As always, please contact CA Technologies Support if you have further questions.