XM

Get User Details

Path:

GET https://{baseurl}/api-commerceIdentity/user/{user Id}

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

https://{baseurl}/user/5e97947d3cb8553c0e43d87f

Response

HTTP Code : 200 Message : OK

You will see this message when the user details are successfully retrieved.

Sample

{
"_id": "5e97947d3cb8553c0e43d87f",
"isActive": {
"status": true
},
"registrationDate": "2020-04-15T22:34:22.429Z",
"expiryDate": "2070-04-15T22:34:22.429Z",
"roles": [
"5de1646f8c6352091d944f1c"
],
"name": {
"first": "John",
"middle": "A",
"last": "Smith"
},
"phone": [
{
"_id": "5e97947d3cb8553c0e43d880",
"number": "123456789",
"countryCode": "+1",
"extension": "1234",
"kind": "mobile",
"id": "5e97947d3cb8553c0e43d880"
}
],
"email": "[email protected]",
"extra": {
"dob": "03-19-1993"
},
"registrationSite": "abcde.com",
"account": "5e97947d3cb8553c0e43d87e",
"userId": 90,
"address": [],
"provider": [
{
"registrationDate": "2020-04-15T22:34:22.429Z",
"isActive": true,
"_id": "5e97947d3cb8553c0e43d881",
"name": "LOCAL",
"lastLoginDate": "2020-04-16T04:28:33.560Z",
"id": "5e97947d3cb8553c0e43d881"
}
],
"createdAt": "2020-04-15T23:10:53.773Z",
"updatedAt": "2020-04-16T04:28:33.560Z",
"__v": 0
}

HTTP Code : 403 Message : Forbidden

Description: You will see this message when the system user ID is incorrect.

Sample

{
"statusCode": 403,
"error": "Forbidden",
"message": "User is not authorized to access this resource"
}

Changelog

  • Last updated - July 2020