Get account & credit balance
curl --request GET \
--url https://kodisc.com/api/v2/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://kodisc.com/api/v2/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://kodisc.com/api/v2/me', 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://kodisc.com/api/v2/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://kodisc.com/api/v2/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://kodisc.com/api/v2/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://kodisc.com/api/v2/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"userId": "usr_xxxxxxxxxxxxxxxxxxx",
"keyId": "key_xxxxxxxxxxxxxxxx",
"keyPrefix": "kdsc_live_xxxx",
"credits": {
"paid": 1840,
"free": 200,
"total": 2040
}
}{
"error": "Unauthorized",
"message": "Invalid or missing API key"
}Account
Get account & credits
Returns the user and key behind the credentials on this request, plus the live credit balance. Useful as a health check while wiring up an integration, or to show remaining credits inside your own dashboard.
GET
/
api
/
v2
/
me
Get account & credit balance
curl --request GET \
--url https://kodisc.com/api/v2/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://kodisc.com/api/v2/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://kodisc.com/api/v2/me', 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://kodisc.com/api/v2/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://kodisc.com/api/v2/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://kodisc.com/api/v2/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://kodisc.com/api/v2/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"userId": "usr_xxxxxxxxxxxxxxxxxxx",
"keyId": "key_xxxxxxxxxxxxxxxx",
"keyPrefix": "kdsc_live_xxxx",
"credits": {
"paid": 1840,
"free": 200,
"total": 2040
}
}{
"error": "Unauthorized",
"message": "Invalid or missing API key"
}Authorizations
Send your API key in the Authorization header as Bearer kdsc_live_<...>. Generate keys from the developer dashboard. Keys are returned in plaintext only once at creation time — store them like a password.
Response
Account info and credits.
Internal ID for the key being used to authenticate this request.
First 16 characters of the API key (e.g. kdsc_live_xxxx). Safe to display in your UI to help users identify which key is in use.
Show child attributes
Show child attributes
Was this page helpful?