curl --request PUT \
--url https://api.identity.fabric.zone/ums/v2/users/self \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"loginId": "sdsdf232ew-123asdaa-1231231",
"email": "test.user@foobar.com",
"firstName": "Test",
"lastName": "Jr",
"primaryContact": "+1 650 333 4444"
}
'import requests
url = "https://api.identity.fabric.zone/ums/v2/users/self"
payload = {
"loginId": "sdsdf232ew-123asdaa-1231231",
"email": "test.user@foobar.com",
"firstName": "Test",
"lastName": "Jr",
"primaryContact": "+1 650 333 4444"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
loginId: 'sdsdf232ew-123asdaa-1231231',
email: 'test.user@foobar.com',
firstName: 'Test',
lastName: 'Jr',
primaryContact: '+1 650 333 4444'
})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'loginId' => 'sdsdf232ew-123asdaa-1231231',
'email' => 'test.user@foobar.com',
'firstName' => 'Test',
'lastName' => 'Jr',
'primaryContact' => '+1 650 333 4444'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.identity.fabric.zone/ums/v2/users/self"
payload := strings.NewReader("{\n \"loginId\": \"sdsdf232ew-123asdaa-1231231\",\n \"email\": \"test.user@foobar.com\",\n \"firstName\": \"Test\",\n \"lastName\": \"Jr\",\n \"primaryContact\": \"+1 650 333 4444\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.identity.fabric.zone/ums/v2/users/self")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"loginId\": \"sdsdf232ew-123asdaa-1231231\",\n \"email\": \"test.user@foobar.com\",\n \"firstName\": \"Test\",\n \"lastName\": \"Jr\",\n \"primaryContact\": \"+1 650 333 4444\"\n}")
.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::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"loginId\": \"sdsdf232ew-123asdaa-1231231\",\n \"email\": \"test.user@foobar.com\",\n \"firstName\": \"Test\",\n \"lastName\": \"Jr\",\n \"primaryContact\": \"+1 650 333 4444\"\n}"
response = http.request(request)
puts response.read_body{
"id": "1231012312-312-31231asda",
"status": "active",
"orgId": "4ed1acc6-7799-4bee-856e-91f18ca77d7a",
"loginId": "testuser@gmail.com",
"isStaffUserFederated": true,
"email": "foo@bar.com",
"primaryContact": "+1 234 8992341234",
"firstName": "James",
"lastName": "Bond",
"meta": {
"fabricBirthDate": "28-20-2000"
}
}{
"code": "REQUEST_DENIED",
"message": "User does not have the required permission"
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}Update user details
This API allows a logged in user to update his own details in the fabric Identity. fabric Identity stores only the infromation that is necessary for user authentication functionality. The other customer details of the user like shipping and communication preferences are to be stored in the customer service APIs of fabric.
curl --request PUT \
--url https://api.identity.fabric.zone/ums/v2/users/self \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"loginId": "sdsdf232ew-123asdaa-1231231",
"email": "test.user@foobar.com",
"firstName": "Test",
"lastName": "Jr",
"primaryContact": "+1 650 333 4444"
}
'import requests
url = "https://api.identity.fabric.zone/ums/v2/users/self"
payload = {
"loginId": "sdsdf232ew-123asdaa-1231231",
"email": "test.user@foobar.com",
"firstName": "Test",
"lastName": "Jr",
"primaryContact": "+1 650 333 4444"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
loginId: 'sdsdf232ew-123asdaa-1231231',
email: 'test.user@foobar.com',
firstName: 'Test',
lastName: 'Jr',
primaryContact: '+1 650 333 4444'
})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'loginId' => 'sdsdf232ew-123asdaa-1231231',
'email' => 'test.user@foobar.com',
'firstName' => 'Test',
'lastName' => 'Jr',
'primaryContact' => '+1 650 333 4444'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.identity.fabric.zone/ums/v2/users/self"
payload := strings.NewReader("{\n \"loginId\": \"sdsdf232ew-123asdaa-1231231\",\n \"email\": \"test.user@foobar.com\",\n \"firstName\": \"Test\",\n \"lastName\": \"Jr\",\n \"primaryContact\": \"+1 650 333 4444\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.identity.fabric.zone/ums/v2/users/self")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"loginId\": \"sdsdf232ew-123asdaa-1231231\",\n \"email\": \"test.user@foobar.com\",\n \"firstName\": \"Test\",\n \"lastName\": \"Jr\",\n \"primaryContact\": \"+1 650 333 4444\"\n}")
.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::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"loginId\": \"sdsdf232ew-123asdaa-1231231\",\n \"email\": \"test.user@foobar.com\",\n \"firstName\": \"Test\",\n \"lastName\": \"Jr\",\n \"primaryContact\": \"+1 650 333 4444\"\n}"
response = http.request(request)
puts response.read_body{
"id": "1231012312-312-31231asda",
"status": "active",
"orgId": "4ed1acc6-7799-4bee-856e-91f18ca77d7a",
"loginId": "testuser@gmail.com",
"isStaffUserFederated": true,
"email": "foo@bar.com",
"primaryContact": "+1 234 8992341234",
"firstName": "James",
"lastName": "Bond",
"meta": {
"fabricBirthDate": "28-20-2000"
}
}{
"code": "REQUEST_DENIED",
"message": "User does not have the required permission"
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Update User Self Details
Response
User Identity Object
Id
"8fed3942-b742-4559-bc99-e4129e888eb1"
Role Status
active, inactive "active"
User Login Id
"test.user@foobar.com"
User Organization Id
"123123-23wdd-123234"
User Staff Organization
false
Show child attributes
Show child attributes
{ "fabricBirthDate": "28-20-2000" }
User Email Id
"test.user@foobar.com"
User First Name
"Test"
User Last Name
"User"
User Primary Contact
"+1 650 333 4444"
Was this page helpful?
