# Authentication

{% stepper %}
{% step %}

### Prerequisites

In order to obtain an API Token you first need to have **client\_id** and **client secret** from our team.
{% endstep %}

{% step %}

### Request the Access Token

To authenticate and obtain an OAuth token, follow the standard OAuth token request flow.

* **POST** API URL

```
https://sandbox-app.lenderlink.ph/oauth/token
```

* To request the Access Token, submit a POST request to the API URL, including the following body parameters in JSON format:

```json

{
    "grant_type": "client_credentials",
    "client_id": "your client id",
    "client_secret": "your client secret"
}
                                        
```

{% endstep %}

{% step %}

### Handling the Token Response

Upon successful validation, the authorization server will respond with an access token:

```json

{
    "token_type": "Bearer",
    "expires_in": 86400,
    "access_token": "eyJ0eXAiOiJKasd10sJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI5YTc4MzVm..."
}
                                        
```

{% hint style="warning" %}
**Token Lifespan**

Access tokens have a limited lifespan of **86400** seconds. Once the token expires, you can obtain a new one.
{% endhint %}
{% endstep %}
{% endstepper %}


---

# 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://docs.lenderlink.ph/product-guides/api-integration-guides/authentication.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.
