Get logged in users data
curl --request GET \
--url https://api.royalti.io/auth/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.royalti.io/auth/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.royalti.io/auth/', 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.royalti.io/auth/",
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://api.royalti.io/auth/"
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://api.royalti.io/auth/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/auth/")
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{
"message": "Successful",
"user": {
"fullName": "Emmanuel Umukoro",
"email": "emma221999@gmail.com",
"lastLogin": null,
"TenantId": 1,
"id": "7c5c54e3-b6e0-4b89-b443-928727b9a931",
"UserId": "f4b4e2f8-fe5e-4076-9e09-3424ff7f185f",
"nickName": "iEmmanuel104",
"paymentSettings": {
"AccountNumber": "1234567890",
"accountName": "Royalti Account",
"bank": "AFRICA FINANCE CORPORATION",
"bankCode": "44444",
"paypalcurrency": "USD",
"wirecurrency": "USD",
"paypalEmail": "royalti@gmail.com",
"beneficiaryType": "company",
"bankCountry": "Nigeria"
},
"userType": [
"Artist"
],
"externalId": null,
"firstName": "Emmanuel",
"lastName": "Umukoro",
"profileImg": null,
"phone": "080628537875",
"country": "Algeria",
"ipi": null,
"role": "admin",
"isActive": true,
"signUpForm": {},
"permissions": null,
"createdAt": "2023-05-18T14:09:05.008Z",
"updatedAt": "2024-03-22T11:10:53.519Z",
"User": {
"email": "emma221999@gmail.com"
}
},
"workspace": {
"name": "Royalti Demo",
"uid": "7bd60554-4f63-4c62-a5f6-c29c3f67cb2a",
"bigqueryDataset": "royalti_demo"
}
}{
"error": {
"status": 401,
"message": " JWT token expired "
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}Auth
Get logged in users data
/auth/
GET
/
auth
/
Get logged in users data
curl --request GET \
--url https://api.royalti.io/auth/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.royalti.io/auth/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.royalti.io/auth/', 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.royalti.io/auth/",
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://api.royalti.io/auth/"
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://api.royalti.io/auth/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/auth/")
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{
"message": "Successful",
"user": {
"fullName": "Emmanuel Umukoro",
"email": "emma221999@gmail.com",
"lastLogin": null,
"TenantId": 1,
"id": "7c5c54e3-b6e0-4b89-b443-928727b9a931",
"UserId": "f4b4e2f8-fe5e-4076-9e09-3424ff7f185f",
"nickName": "iEmmanuel104",
"paymentSettings": {
"AccountNumber": "1234567890",
"accountName": "Royalti Account",
"bank": "AFRICA FINANCE CORPORATION",
"bankCode": "44444",
"paypalcurrency": "USD",
"wirecurrency": "USD",
"paypalEmail": "royalti@gmail.com",
"beneficiaryType": "company",
"bankCountry": "Nigeria"
},
"userType": [
"Artist"
],
"externalId": null,
"firstName": "Emmanuel",
"lastName": "Umukoro",
"profileImg": null,
"phone": "080628537875",
"country": "Algeria",
"ipi": null,
"role": "admin",
"isActive": true,
"signUpForm": {},
"permissions": null,
"createdAt": "2023-05-18T14:09:05.008Z",
"updatedAt": "2024-03-22T11:10:53.519Z",
"User": {
"email": "emma221999@gmail.com"
}
},
"workspace": {
"name": "Royalti Demo",
"uid": "7bd60554-4f63-4c62-a5f6-c29c3f67cb2a",
"bigqueryDataset": "royalti_demo"
}
}{
"error": {
"status": 401,
"message": " JWT token expired "
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
/auth/ Description:The
/auth/ endpoint provides access to information about the currently logged-in user, including their user data and authentication details.
Method:GET
Response:Upon successful retrieval of the user’s data, the endpoint returns the user’s information in the response body.
Code Examples
const response = await fetch('https://api.royalti.io/auth/', {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
},
});
const data = await response.json();
console.log(data);
import requests
response = requests.get(
'https://api.royalti.io/auth/',
headers={
'Authorization': f'Bearer {token}'
},
)
data = response.json()
print(data)
curl -X GET https://api.royalti.io/auth/ \
-H "Authorization: Bearer YOUR_TOKEN" \
⌘I