# Login

| **API URL**     | {{url}}/fhir-auth-service/session |
| --------------- | --------------------------------- |
| **Method**      | POST                              |
| **Description** | Login and get Access Token        |

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

| **Field Name** | **Type** | **Mandatory** | **Example**               |
| -------------- | -------- | ------------- | ------------------------- |
| username       | String   | Yes           | <fhiradmin@mtdlabs.com>   |
| password       | String   | Yes           | Password                  |
| client(Header) | String   |               | spice web or spice mobile |

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

#### { <a href="#login" id="login"></a>

&#x20;   "username": "<fhiradmin@mtdlabs.com>",

&#x20;   "password": "fhirAdmin\@123"

}

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

```
{
    "id": 1,
    "username": "fhiradmin@mtdlabs.com",
    "firstName": "FHIR",
    "middleName": "",
    "lastname": "ADMIN",
    "companyName": "mdt_labs",
    "companyEmail": "fhiradmin@mtdlabs.com",
    "countryCode": "US",
    "phone": "123-456-7890",
    "address": "123 Main St",
    "website": "www.company.com",
    "country": {
        "id": 1,
        "name": "United States",
        "code": "1",
        "abbreviation": "US"
    },
    "timezone": {
        "id": 1,
        "offset": "-5:00",
        "description": "Eastern Time Zone"
    },
    "forgetPasswordCount": 0,
    "invalidLoginAttempts": 0,
    "isSuperUser": false,
    "roles": [
        {
            "id": 1,
            "name": "FHIR_Admin",
            "level": "1"
        }
    ],
    "currentDate": 1713423576927
}
```


---

# 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/fhir-adapter-services/login.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.
