Check Your Balance

Check Your Balance - Basic Usage

PHP GET

    <?php
        $key = "ewjd824g"; //Account key. Get it from account settings
        $secret = "wwe89rh3qb083r7h30b0d0u8rh033jf39h8r0f3"; //Account secret. Get it from account settings
        
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "https://api.smsjuice.com/balance/{$key}/{$secret}");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
        curl_setopt($ch, CURLOPT_HEADER, FALSE);
        $response = curl_exec($ch);
        curl_close($ch);

        var_dump($response);            

PHP SDK

<?php
   /**
    * Check Account Balance
    */
        
    $balance = TextMessagingService::getBalance($key,$secret);
   ?>

Parameters

Parameter Description Required
key account authentication key
secret account authentication secret

Response

 {
     "balance":154.35
 }        

Success Response Codes

Success Response Description
balance The amount of money left on your account.

Errors

    {
      "query": "failed",
      "error": "invalid_credentials"
    }       

Error Response Codes

Error Response Description
invalid_credentials Invalid API key and/or secret