Get user details
curl --request GET \
--url https://api.identity.fabric.zone/ums/v2/users/self \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.identity.fabric.zone/ums/v2/users/self"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.identity.fabric.zone/ums/v2/users/self', 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.identity.fabric.zone/ums/v2/users/self",
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.identity.fabric.zone/ums/v2/users/self"
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.identity.fabric.zone/ums/v2/users/self")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.identity.fabric.zone/ums/v2/users/self")
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{
"id": "1234-1234-1234",
"status": "active",
"isStaffUserFederated": true,
"loginId": "sdsdf232ew-123asdaa-1231231",
"orgId": "123123-23wdd-123234",
"email": "test.user@foobar.com",
"primarycontact": "+1 650 333 4444",
"firstName": "Test",
"lastName": "User",
"meta": {
"fabricBirthDate": "28-20-2000"
},
"accounts": {}
}{
"code": "REQUEST_DENIED",
"message": "User does not have the required permission"
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}User Self Service APIs
Get user details
This API allows a logged in user to get his own details from the fabric Identity. The API is designed to return the details of the user whose bearer token is sent in the header.
GET
/
users
/
self
Get user details
curl --request GET \
--url https://api.identity.fabric.zone/ums/v2/users/self \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.identity.fabric.zone/ums/v2/users/self"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.identity.fabric.zone/ums/v2/users/self', 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.identity.fabric.zone/ums/v2/users/self",
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.identity.fabric.zone/ums/v2/users/self"
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.identity.fabric.zone/ums/v2/users/self")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.identity.fabric.zone/ums/v2/users/self")
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{
"id": "1234-1234-1234",
"status": "active",
"isStaffUserFederated": true,
"loginId": "sdsdf232ew-123asdaa-1231231",
"orgId": "123123-23wdd-123234",
"email": "test.user@foobar.com",
"primarycontact": "+1 650 333 4444",
"firstName": "Test",
"lastName": "User",
"meta": {
"fabricBirthDate": "28-20-2000"
},
"accounts": {}
}{
"code": "REQUEST_DENIED",
"message": "User does not have the required permission"
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}Authorizations
Response
User Identity Object
User Self Details. For shoppers, accounts property will be empty.
Was this page helpful?
