XM
Powered By GitBook
Get User Details
Path:
1
GET https://{baseurl}/api-commerceIdentity/user/{user Id}
Copied!
The 24 character system-generated user ID is passed as path param of this API, to retrieve the user details. In addition to running focused campaigns to offer product recommendation, promos, and the like, user details are required to build user profile and create personalized experience across channels.
Headers
Content-Type : application/json
x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }
Authorization: The JWT access token from the Login API. This is applicable only for a logged in user (not for guest user).

Parameters

Type : Path
Name : The system-generated user ID (represented as _Id)
Required: true

Sample Request

1
https://{baseurl}/user/5e97947d3cb8553c0e43d87f
Copied!

Response

HTTP Code : 200 Message : OK
You will see this message when the user details are successfully retrieved.
Sample
1
{
2
"_id": "5e97947d3cb8553c0e43d87f",
3
"isActive": {
4
"status": true
5
},
6
"registrationDate": "2020-04-15T22:34:22.429Z",
7
"expiryDate": "2070-04-15T22:34:22.429Z",
8
"roles": [
9
"5de1646f8c6352091d944f1c"
10
],
11
"name": {
12
"first": "John",
13
"middle": "A",
14
"last": "Smith"
15
},
16
"phone": [
17
{
18
"_id": "5e97947d3cb8553c0e43d880",
19
"number": "123456789",
20
"countryCode": "+1",
21
"extension": "1234",
22
"kind": "mobile",
23
"id": "5e97947d3cb8553c0e43d880"
24
}
25
],
26
"email": "[email protected]",
27
"extra": {
28
"dob": "03-19-1993"
29
},
30
"registrationSite": "abcde.com",
31
"account": "5e97947d3cb8553c0e43d87e",
32
"userId": 90,
33
"address": [],
34
"provider": [
35
{
36
"registrationDate": "2020-04-15T22:34:22.429Z",
37
"isActive": true,
38
"_id": "5e97947d3cb8553c0e43d881",
39
"name": "LOCAL",
40
"lastLoginDate": "2020-04-16T04:28:33.560Z",
41
"id": "5e97947d3cb8553c0e43d881"
42
}
43
],
44
"createdAt": "2020-04-15T23:10:53.773Z",
45
"updatedAt": "2020-04-16T04:28:33.560Z",
46
"__v": 0
47
}
Copied!
HTTP Code : 403 Message : Forbidden
Description: You will see this message when the system user ID is incorrect.
Sample
1
{
2
"statusCode": 403,
3
"error": "Forbidden",
4
"message": "User is not authorized to access this resource"
5
}
Copied!

Changelog

    Last updated - July 2020
Last modified 3mo ago
Copy link
Contents
Changelog