VOICE API
Get Balance function
To retrieve the current balance on the account.
To send a message the request must be submitted one of the following URLs:
HTTP (non-SSL)
1 | http://go4clients.com:3011/TelintelSms/api/getbalance |
HTTPS (SSL) *recommended*
1 | https://go4clients.com:8443/TelintelSms/api/getbalance |
6.1 HTTP Methods
All requests should be submitted through the HTTP GET Method.
6.2 Authentication Information
All requests require API Key and API Secret authentication credentials. Account Administrators can login to view their account API Key and API Secret in the “My Profile > Settings” section.
To authenticate a request, please use one of the following options:
The account’s Api key username (key), a 32 character random generated string.
1 | "Apikey": "5bf54d157a214f748eede4e4131b874d" |
The account’s API password (secret). It’s a numeric random string with a random length between 10 and 15 characters.
1 | "Apisecret" : "712968662797" |
6.3 Request Parameters
This method has no inbound parameters.
6.4.1 Examples using GET Method
PHP example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <?php $url="https://go4clients.com:8443/TelintelSms/api/getbalance”; // use key 'http' even if you send the request to https://... $options = array( 'http' => array( 'header' => "Content-type: application/json\r\n". "Apikey: [YOUR_API_KEY]\r\n". "Apisecret: [YOUR_API_SECRET]\r\n", 'method' => 'GET' ), ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); var_dump($result); ?> |
Java example (with Apache HTTPClient)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | try{ String url = "http://portal2.telintelsms.com:3011/TelintelSms/api/getbalance”; HttpClient httpClient = HttpClientBuilder.create().build();; HttpGet getRequest = new HttpGet(url); getRequest.addHeader("Content-type", "application/json"); getRequest.addHeader("Apikey", "[YOUR_API_KEY]"); getRequest.addHeader("Apisecret", "[YOUR_API_SECRET]"); HttpResponse response = httpClient.execute(getRequest); Response response = objMap.readValue(response.getEntity(), Response.class); }catch(Exception e){ //Capture the possible exceptions }finally{ if(getRequest != null){ getRequest.releaseConnection(); } } |
6.5 Response Parameters
An ENUM that represents the return code for the response. Please reference Response Codes table in Annex A.
Remaining account balance.
An ENUM that represents the return code for the response. Please reference Response Codes table in Annex A.
An integer representing the return code of the response / error. Please reference Response Codes table in Annex A.