Get access token
curl --request POST \
--url https://api.opencard.io/oauth/token \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "client_credentials",
"client_id": "your-client-id",
"client_secret": "your-secret",
"scope": "organizations-write webhooks-write card-holders-write"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'client_credentials',
client_id: 'your-client-id',
client_secret: 'your-secret',
scope: 'organizations-write webhooks-write card-holders-write'
})
};
fetch('https://api.opencard.io/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.opencard.io/oauth/token"
payload = {
"grant_type": "client_credentials",
"client_id": "your-client-id",
"client_secret": "your-secret",
"scope": "organizations-write webhooks-write card-holders-write"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opencard.io/oauth/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 => json_encode([
'grant_type' => 'client_credentials',
'client_id' => 'your-client-id',
'client_secret' => 'your-secret',
'scope' => 'organizations-write webhooks-write card-holders-write'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"token_type": "Bearer",
"expires_in": 31536000,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."
}OAuth
Get access token
POST
/
oauth
/
token
Get access token
curl --request POST \
--url https://api.opencard.io/oauth/token \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "client_credentials",
"client_id": "your-client-id",
"client_secret": "your-secret",
"scope": "organizations-write webhooks-write card-holders-write"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'client_credentials',
client_id: 'your-client-id',
client_secret: 'your-secret',
scope: 'organizations-write webhooks-write card-holders-write'
})
};
fetch('https://api.opencard.io/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.opencard.io/oauth/token"
payload = {
"grant_type": "client_credentials",
"client_id": "your-client-id",
"client_secret": "your-secret",
"scope": "organizations-write webhooks-write card-holders-write"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opencard.io/oauth/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 => json_encode([
'grant_type' => 'client_credentials',
'client_id' => 'your-client-id',
'client_secret' => 'your-secret',
'scope' => 'organizations-write webhooks-write card-holders-write'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"token_type": "Bearer",
"expires_in": 31536000,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."
}
