Check account balance


Intro

This endpoint allows you to check your current account balance.

Method Endpoint
POST https://messaging.bulkitsms.com/api/services/checkbalance

Headers

Header Description Value
Content-Type The Content-Type representation header is used to indicate the original media type of the resource (prior to any content encoding applied for sending). application/json

Parameters

To check your account balance, you are required to pass in the 2 parameter listed below.

A failed request will receive appropriate and descriptive responses; and these can guide you in adding what's missing.

Parameter Description Sample value
apikey This is a unique identifier for your client account. aesfdgb5trdfd
apisecret This is the token that is used for validation. It is generated from your "client account" section on the portal. Safeguard this key and keep it secret. esrg34werstes4rsed4df4edd
NOTE: To get your apikey and apisecret, follow the instructions under "Getting started".

JSON Request Payload

Expected JSON payload.

	
	{
		"apikey":"{{apikey}}",
		"apisecret":"{{apisecret}}"
	}
	

Response

Sample success response.

	
		{
            "response-code": 200,
            "credit": "4909.00",
            "clientId": "1543323"
        }
	

Examples.

Curl

    
curl --location --request POST 'https://messaging.bulkitsms.com/api/services/checkbalance' \
--header 'Content-Type: application/json' \
--data-raw '{
	"apikey":"uniqueIdentifer",
	"apisecret":"someSecretThatOnlyYouKnow"
}'

Golang

    
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "log"
    "net/http"
)

func main() {
	apikey := "uniqueIdentifer"
	apisecret := "someSecretThatOnlyYouKnow"

    values := map[string]string{
		"apikey": apikey,
		"apisecret": apisecret,
	}
    json_data, err := json.Marshal(values)

    if err != nil {
        log.Fatal(err)
    }

    resp, err := http.Post(
		"https://messaging.bulkitsms.com/api/services/checkbalance", 
		"application/json",
        bytes.NewBuffer(json_data),
	)

    if err != nil {
        log.Fatal(err)
    }

    var res map[string]interface{}

    json.NewDecoder(resp.Body).Decode(&res)

    fmt.Println(res)
}

Php 7.0+

    
<?php
	$url = 'https://messaging.bulkitsms.com/api/services/checkbalance/';
	$apiKey = 'uniqueIdentifer';
	$apiSecret = 'someSecretThatOnlyYouKnow';

	$curl = curl_init();
	curl_setopt($curl, CURLOPT_URL, $url);
	curl_setopt($curl, CURLOPT_HTTPHEADER, array(
			'Content-Type:application/json'
		)
	); //setting the header

	$curl_post_data = array(
		//Fill in the request parameters with valid values
		'apikey' => $apiKey,
		'apisecret' => $apiSecret,
	);

	$data_string = json_encode($curl_post_data);// json encode the data

	curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($curl, CURLOPT_POST, true);
	curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);

	$bulkit_response = curl_exec($curl);
	print_r($bulkit_response);
?>