Get a User by Id
Returns the details of a user (including custom fields)* based on the User Id.
Pass the “UserId” in the API URL. You’ll get an empty (square brackets []) response if –
- You pass the “UserId” of an inactive user.
- The user doesn’t exist.
Note:
- *The API only returns user custom fields mx_Custom_1 to mx_Custom_10. To retrieve other user custom fields, call the User Advanced Search API.
- The User Id is different from the Email Address. If you want to get users by Email Address, use the Get User by Email Address API.
API URL
URL Parameters
| Parameter | Description |
|---|---|
| UserId | Unique Id of the user. |
Response
[
{
"UserId": "718ae557-9d0b-11e7-b0ab-02e89b2fb8f4",
"FirstName": "John",
"LastName": "George",
"EmailAddress": "vir.singh@leadsquared.com",
"AssociatedPhoneNumbers": "",
"DateFormat": "mm/dd/yy",
"TimeZone": "Asia/Kolkata",
"Role": "Sales_User",
"IsPhoneCallAgent": true,
"OrgId": 22824,
"CompanyName": "Education 101",
"UserType": 0,
"ManagerUserId": "3b1041fb-8374-11e7-8758-0a106ee76b21",
"Address": "10th Main Street",
"City": "Delhi",
"State": "UT",
"Country": "India",
"ZipCode": "5600012",
"TelephonyAgentId": "1232",
"ManagerName": "Vir Singh",
"PhoneMain": "+91-123212332",
"PhoneMobile": "+91-2387463526",
"PhoneOthers": "+91-2321283945",
"IsCheckedIn": true,
"LastCheckedOn": "2020-03-31 13:31:17",
"LastCheckedIpAddress": "2402:3a80:526:1df8:dcfe:b00a:b76d:5baa",
"AvailabilityStatus": "online",
"Designation": "Sales Executive",
"Department": "Pre Sales",
"OfficeLocationName": "Delhi",
"Skills": "Sales Pitching",
"SalesRegions": "North India",
"mx_Custom_1": "Unmarried",
"mx_Custom_2": "Male",
"mx_Custom_3": "1991-02-06 13:21:00",
"mx_Custom_4": "2019-05-17 13:21:00",
"mx_Custom_5": "",
"mx_Custom_6": "",
"mx_Custom_7": "",
"mx_Custom_8": "",
"mx_Custom_9": "",
"mx_Custom_10": "",
"Groups": [
{
"Id": "022bc5d4-0fba-11e8-871e-02bf1924461c",
"Name": "Delhi"
}
],
"TeamId": "8bfd8940-0f53-11e8-871e-02bf1924461c",
"TeamName": "Bangalore"
}
]
HTTP Response Codes
| Code | Description |
|---|---|
| 200 OK | This is the status code for successful API call. |
| 401 Unauthorized | The API call was made with invalid access credentials. Check your AccessKey and SecretKey. |
| 400 Bad Request | The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure. |
| 404 Not Found | The API could not be found. Please check the API signature. |
| 429 Too Many Requests | API calls exceeded the limit of 25 in 5 second(s) |
| 500 Internal Server Error | The API called failed. There could be many reasons for it. Check the exception message to get more details. |

