DocumentationGet Credit Balance

Get Credit Balance


This API will disclose to you what number of credits you have left for you. It's basic, quick and simple to utilize.

Here are a couple of situations that organizations will utilize this API for.


1. You utilize our API to approve messages and you have to check inside a specific time span when your credit adjust is too low, so you can make an installment.

2. You need to track what number of email approval credits you're utilizing per your characterized time period to create valuable measurable data.

3. You need to computerize and incorporate data into your application dashboard that demonstrates to you your at present residual credit adjust.


Below, you will find the instructions on how to use our API.

This API will tell you how many credits you have left on your account.

  • PHP
  • JAVA
  • PYTHON
  • C#
  • VB.NET

<?php
//set the api key and email to be validated
$apiKey = 'Your Secret Key';
$emailToValidate = 'example@example.com';

// use curl to make the request
$url = 'https://yobounce.com/api/get-credit-balance.php?apikey='.$apiKey;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );    
$response = curl_exec($ch);
curl_close($ch);
?>

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
 
public class MyClass {
 
    public static void main(String[] args){
 
        String key = "Your Secret Key";
        String targetURL = "https://yobounce.com/api/get-credit-balance.php?apikey="+key;
 
        HttpURLConnection connection = null;
        final String USER_AGENT = "Mozilla/5.0";
 
        try {
            URL url = new URL(targetURL);
            connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.addRequestProperty("User-Agent", USER_AGENT);
 
 
            connection.setUseCaches(false);
            connection.setDoOutput(true);
 
            BufferedReader in = new BufferedReader(
                     new InputStreamReader(connection.getInputStream()));
            String inputLine;
            StringBuffer response = new StringBuffer();
 
            while ((inputLine = in.readLine()) != null) {
                 response.append(inputLine);
            }
            in.close();
 
            //print result
            System.out.println(response.toString());
 
        } catch (Exception e) {
             e.printStackTrace();
        } finally {
            if (connection != null) {
                 connection.disconnect();
            }
        }
 
    }
 }		

import requests
import json
 
target_url = "https://yobounce.com/api/get-credit-balance.php?apikey="
secret_key = "Your Secret Key"
 
api_response = requests.get("%s%s" % (target_url, secret_key))
data = json.loads(api_response.content)
 
# prints the number of credits
print data["Credits"]

try {
  string apiKey = "Your Secret Key";
  string apiURL = "https://yobounce.com/api/get-credit-balance.php?apikey=" + apiKey; 
 
  HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiURL);
  request.Timeout = 150000;
  request.Method = "GET";
 
  using (WebResponse response = request.GetResponse()) {
     response.GetResponseStream().ReadTimeout = 20000;
     using (StreamReader ostream = new StreamReader(response.GetResponseStream())) {
     responseString = ostream.ReadToEnd();
     }
  }
  } catch (exception ex) {
  /Catch Exception - All errors will be shown here - if there are issues with the API
 }>>

Try
    Dim apiKey = "Your Secret Key"
    Dim apiURL = "https://yobounce.com/api/get-credit-balance.php?apikey=" & apiKey
 
    Dim request As HttpWebRequest = DirectCast(WebRequest.Create(apiURL), HttpWebRequest)
    request.Timeout = 150000
    request.Method = "GET"
 
    Using response As WebResponse = request.GetResponse()
        response.GetResponseStream().ReadTimeout = 20000
        Using ostream As New StreamReader(response.GetResponseStream())
            responseString = ostream.ReadToEnd()
        End Using
    End Using
Catch ex as exception
'Catch Exception - All errors will be shown here - if there are issues with the API
End Try

Successful response sample from the API.

  • Json

{
"credits":2345868
}

Failure response


{
"error":"Invalid API Key"
}