# Get User Details

| **API URL**     | {{url}}/user-service/user/details/{{userId}} |
| --------------- | -------------------------------------------- |
| **Method**      | GET                                          |
| **Description** | To get user details by user id               |

#### **Input** <a href="#getuserdetails-input" id="getuserdetails-input"></a>

| **Field Name**        | **Type** | **Mandatory** | **Example**                          |
| --------------------- | -------- | ------------- | ------------------------------------ |
| userId(parameter)     | String   | Yes           | User unique identification number    |
| Authorization(Header) | String   | Yes           | Authorized token from login response |

#### **Sample Input** <a href="#getuserdetails-sampleinput" id="getuserdetails-sampleinput"></a>

{{url}}/user-service/user/details/248

#### **Output** <a href="#getuserdetails-output" id="getuserdetails-output"></a>

| **Field Name**          | **Type** | **Comments**                     |
| ----------------------- | -------- | -------------------------------- |
| `id`                    | Integer  | User ID                          |
| `username`              | String   | User Username                    |
| `gender`                | String   | User Gender                      |
| `roles`                 | Object   | Roles of the user                |
| `active`                | Boolean  | Flag for, is user active or not  |
| `firstName`             | String   | User First Name                  |
| `lastName`              | String   | User Last Name                   |
| `middleName`            | String   | User Middle Name                 |
| `phoneNumber`           | String   | User Phone number                |
| `country`               | Object   |                                  |
| `timezone`              | Object   | User Timezone                    |
| `organizations`         | Object   |                                  |
| `isBlocked`             | Boolean  | Flag for, is user blocked or not |
| `countryCode`           | String   | Country code value               |
| `cultureId`             | Integer  |                                  |
| `tenantId`              | Integer  | User Tenant ID                   |
| `isSuperUser`           | Boolean  | Flag for, Super user or not      |
| redRisk                 | Boolean  |                                  |
| defaultOrganizationName | String   |                                  |
| defaultRoleName         | String   |                                  |

#### **Sample Output:** <a href="#getuserdetails-sampleoutput" id="getuserdetails-sampleoutput"></a>

```
      "id": 248,
    "username": "mcf_labtechnicxxx@spice.mdt",
    "gender": "",
    "roles": [
        {
            "id": 25,
            "name": "LAB_TECHNICIAN",
            "level": null,
            "authority": "LAB_TECHNICIAN",
            "createdBy": 1,
            "updatedBy": 1,
            "createdAt": "2023-01-12T23:00:47+06:00",
            "updatedAt": "2023-01-12T23:00:47+06:00",
            "active": true,
            "deleted": false
        }
    ],
    "active": true,
    "firstName": "MCF",
    "lastName": "Lab technician",
    "phoneNumber": "978XXX4323",
    "country": {
        "id": 4,
        "name": "India",
        "countryCode": "91",
        "unitMeasurement": "metric",
        "tenantId": 6
    },
    "timezone": {
        "id": 2,
        "offset": "-08:00",
        "description": "(UTC-08:00) Baja California"
    },
    "organizations": [
        {
            "id": 15,
            "createdBy": 2,
            "updatedBy": 2,
            "createdAt": "2023-03-08T15:41:23+06:00",
            "updatedAt": "2023-03-08T15:41:25+06:00",
            "tenantId": 10,
            "formDataId": 1,
            "formName": "site",
            "name": "MCF Ashoknagar",
            "sequence": null,
            "parentOrganizationId": 10,
            "active": true,
            "deleted": false
        },
        {
            "id": 33,
            "createdBy": 2,
            "updatedBy": 2,
            "createdAt": "2023-03-08T17:33:16+06:00",
            "updatedAt": "2023-03-08T17:33:18+06:00",
            "tenantId": 10,
            "formDataId": 2,
            "formName": "site",
            "name": "MCF Guindy",
            "sequence": null,
            "parentOrganizationId": 10,
            "active": true,
            "deleted": false
        }
    ],
    "isBlocked": false,
    "countryCode": "91",
    "tenantId": 15,
    "isSuperUser": false,
    "defaultOrganizationName": "MCF Ashoknagar",
    "defaultRoleName": "LAB_TECHNICIAN",
    "cultureId": 1,
    "redRisk": false
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://spice.docs.medtroniclabs.org/spice-docs/versions/spice-1.0/engineering/api-documentation/common-services/get-user-details.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
