Get Balance
Local Mail Balance API allows you to render the total available balance, You can utilize the Balance API to integrate this data in one of your application or feed to dashboards, or send notifications
get
https://api.localmail.io
/v1/accounts/balance
Account Balance

Code Samples

CURL
PHP
GO
NODE.JS
PYTHON
RUBY
JAVA
SWIFT
C#
curl --location --request GET 'https://api.localmail.io/v1/accounts/balance' \
--header 'sid: {sid}' \
--header 'accesskey: {accesskey}'
<?php
$sid = "enter your SID token";
$accesskey = "enter your Accesskey token";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.localmail.io/v1/accounts/balance',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'sid: $sid',
'accesskey: $accesskey'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.localmail.io/v1/accounts/balance"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("sid", "{sid}")
req.Header.Add("accesskey", "{apikey}")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.localmail.io/v1/accounts/balance',
'headers': {
'sid': '{sid}',
'accesskey': '{accesskey}'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "https://api.localmail.io/v1/accounts/balance"
payload={}
headers = {
'sid': '{sid}',
'accesskey': '{accesskey}'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "net/http"
url = URI("https://api.localmail.io/v1/accounts/balance")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["sid"] = "{sid}"
request["accesskey"] = "{accesskey}"
response = https.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.localmail.io/v1/accounts/balance")
.method("GET", null)
.addHeader("sid", "{sid}")
.addHeader("accesskey", "{accesskey}")
.build();
Response response = client.newCall(request).execute();
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
var request = URLRequest(url: URL(string: "https://api.localmail.io/v1/accounts/balance")!,timeoutInterval: Double.infinity)
request.addValue("{sid}", forHTTPHeaderField: "sid")
request.addValue("{apikey}", forHTTPHeaderField: "accesskey")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
var client = new RestClient("https://api.localmail.io/v1/accounts/balance");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("sid", "{sid}");
request.AddHeader("accesskey", "{accesskey}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Copy link
On this page
get
Account Balance