curl "https://api.iban.com/clients/api/v4/iban/" \
-X POST \
-d format=json \
-d api_key=[YOUR_API_KEY] \
-d iban=DE46500700100927353010
$curl = curl_init();
$post = [
'format' => 'json',
'api_key' => '[YOUR_API_KEY]',
'iban' => 'DE46500700100927353010',
];
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.iban.com/clients/api/v4/iban/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
));
$output = curl_exec($curl);
$result = json_decode($output);
print_r($result);
curl_close($curl);
?>
require 'net/http'
uri = URI('https://api.iban.com/clients/api/v4/iban/')
res = Net::HTTP.post_form(uri, "format" => "json", "api_key" => "[YOUR_API_KEY]","iban" => "DE46500700100927353010")
puts res.body
import requests
post_data = {'format':'json', 'api_key':'[YOUR_API_KEY]','iban':'DE46500700100927353010'}
response = requests.post('https://api.iban.com/clients/api/v4/iban/',post_data)
print(response.text)
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $server_endpoint = "https://api.iban.com/clients/api/v4/iban/";
my $format = 'json';
my $api_key = '[YOUR_API_KEY]';
my $iban = 'DE02100500000024290661';
my $req = HTTP::Request->new( POST => $server_endpoint );
$req->content_type('application/x-www-form-urlencoded');
my $post_data = 'format=' . $format . '&api_key=' . $api_key . '&iban=' . $iban;
$req->content($post_data);
my $resp = $ua->request($req);
if ( $resp->is_success ) {
my $message = $resp->decoded_content;
print $message;
}
JAVA
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import org.json.simple.JSONObject;
import org.json.simple.JSONArray;
import org.json.simple.parser.ParseException;
import org.json.simple.parser.JSONParser;
public class ibanapi {
private final String USER_AGENT = "API Client/1.0";
public static void main(String[] args) throws Exception {
ibanapi http = new ibanapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "https://api.iban.com/clients/api/v4/iban/";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "api_key=[YOUR_API_KEY]&format=json&iban=DE02100500000024290661";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
.NET
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("https://api.iban.com/clients/api/v4/iban/");
var postData = "api_key=[YOUR_API_KEY]";
postData += "&format=json";
postData += "&iban=DE02100500000024290661";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
NODE
var request = require('request');
var headers = {
'User-Agent': 'IBAN API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'https://api.iban.com/clients/api/v4/iban/',
method: 'POST',
headers: headers,
form: {'api_key': '[YOUR_API_KEY]', 'format': 'json', 'iban': 'GB04BARC20474473160944'}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
var data = JSON.parse(body);
console.log(data.errors);
console.log("Bank Name: " + data.bank_data.bank);
console.log("Bank BIC: " + data.bank_data.bic);
console.log("Bank City: " + data.bank_data.city);
console.log("Bank Address: " + data.bank_data.address);
console.log("Bank Zip: " + data.bank_data.zip);
console.log("Bank Phone: " + data.bank_data.phone);
console.log("Bank FAX: " + data.bank_data.fax);
console.log("Bank www: " + data.bank_data.www);
console.log("Bank email: " + data.bank_data.email);
console.log("Bank Country Name: " + data.bank_data.country);
console.log("Bank Country Code: " + data.bank_data.country_iso);
console.log("Domestic Account Number: " + data.bank_data.account);
}
})