Get User Data
curl --request GET \
--url https://api.zbdpay.com/v1/oauth2/user \
--header 'apikey: <apikey>' \
--header 'usertoken: <usertoken>'import requests
url = "https://api.zbdpay.com/v1/oauth2/user"
headers = {
"usertoken": "<usertoken>",
"apikey": "<apikey>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {usertoken: '<usertoken>', apikey: '<apikey>'}};
fetch('https://api.zbdpay.com/v1/oauth2/user', 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.zbdpay.com/v1/oauth2/user",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <apikey>",
"usertoken: <usertoken>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zbdpay.com/v1/oauth2/user"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("usertoken", "<usertoken>")
req.Header.Add("apikey", "<apikey>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zbdpay.com/v1/oauth2/user")
.header("usertoken", "<usertoken>")
.header("apikey", "<apikey>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zbdpay.com/v1/oauth2/user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["usertoken"] = '<usertoken>'
request["apikey"] = '<apikey>'
response = http.request(request)
puts response.read_bodyLogin with ZBD
Get User Data
Fetch user-related information about a logged-in ZBD User.
GET
/
v1
/
oauth2
/
user
Get User Data
curl --request GET \
--url https://api.zbdpay.com/v1/oauth2/user \
--header 'apikey: <apikey>' \
--header 'usertoken: <usertoken>'import requests
url = "https://api.zbdpay.com/v1/oauth2/user"
headers = {
"usertoken": "<usertoken>",
"apikey": "<apikey>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {usertoken: '<usertoken>', apikey: '<apikey>'}};
fetch('https://api.zbdpay.com/v1/oauth2/user', 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.zbdpay.com/v1/oauth2/user",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <apikey>",
"usertoken: <usertoken>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zbdpay.com/v1/oauth2/user"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("usertoken", "<usertoken>")
req.Header.Add("apikey", "<apikey>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zbdpay.com/v1/oauth2/user")
.header("usertoken", "<usertoken>")
.header("apikey", "<apikey>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zbdpay.com/v1/oauth2/user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["usertoken"] = '<usertoken>'
request["apikey"] = '<apikey>'
response = http.request(request)
puts response.read_bodyDescription
You can use this API endpoint to fetch information about a given ZBD User, granted you can pass the providedaccessToken.
- Read here for more details on how to setup ZBD Login (OAuth2) with your platform.
Configuration
Header Parameters
Was this page helpful?