Get Access Token
curl --request POST \
--url https://api.ibantrack.com/api-v1/oauth2/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=YOUR_CLIENT_ID \
--data client_secret=YOUR_CLIENT_SECRETimport requests
url = "https://api.ibantrack.com/api-v1/oauth2/token"
payload = {
"grant_type": "client_credentials",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: 'client_credentials',
client_id: 'YOUR_CLIENT_ID',
client_secret: 'YOUR_CLIENT_SECRET'
})
};
fetch('https://api.ibantrack.com/api-v1/oauth2/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ibantrack.com/api-v1/oauth2/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ibantrack.com/api-v1/oauth2/token"
payload := strings.NewReader("grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ibantrack.com/api-v1/oauth2/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ibantrack.com/api-v1/oauth2/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJIUzI1NiItOvR5cCI6IkpXVCJ9....",
"token_type": "Bearer",
"expires_in": 3600
}Authentication
Get Access Token
Obtain an OAuth 2.0 access token to authenticate your API requests.
POST
/
oauth2
/
token
Get Access Token
curl --request POST \
--url https://api.ibantrack.com/api-v1/oauth2/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=YOUR_CLIENT_ID \
--data client_secret=YOUR_CLIENT_SECRETimport requests
url = "https://api.ibantrack.com/api-v1/oauth2/token"
payload = {
"grant_type": "client_credentials",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: 'client_credentials',
client_id: 'YOUR_CLIENT_ID',
client_secret: 'YOUR_CLIENT_SECRET'
})
};
fetch('https://api.ibantrack.com/api-v1/oauth2/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ibantrack.com/api-v1/oauth2/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ibantrack.com/api-v1/oauth2/token"
payload := strings.NewReader("grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ibantrack.com/api-v1/oauth2/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ibantrack.com/api-v1/oauth2/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJIUzI1NiItOvR5cCI6IkpXVCJ9....",
"token_type": "Bearer",
"expires_in": 3600
}Authentication
The Ibantrack API uses the OAuth 2.0 Client Credentials flow where you exchange yourclient_id and client_secret for a temporary access_token.
Security Best Practices
Keep your credentials secret. Your Client ID and Client Secret have the power to perform financial verifications and incur costs. Never share them in client-side code, public repositories, or mobile applications.
Request Details
This specific endpoint requires the request body to be formatted asapplication/x-www-form-urlencoded.
Required Parameters
| Parameter | Value | Description |
|---|---|---|
grant_type | client_credentials | Must be exactly this value. |
client_id | YOUR_CLIENT_ID | Provided in your Ibantrack Dashboard. |
client_secret | YOUR_CLIENT_SECRET | Provided in your Ibantrack Dashboard. |
Token Lifecycle
- Expiration: Tokens are valid for 3600 seconds (1 hour).
- Caching: We strongly recommend caching the token and reusing it until it expires. Requesting a new token for every single verification will trigger rate limits on the authentication server.
Using the token
Once you have received theaccess_token, you must include it in the header of all subsequent API calls:
Authorization: Bearer YOUR_ACCESS_TOKEN
Body
application/x-www-form-urlencoded