# Get Access Token

To obtain an access token for the core banking application API, users need to follow the steps outlined below:\
\
1\. **Obtain Client Credentials**: To obtain an access token, users must first acquire a "`clientID`" And "`clientSecret`" from the API provider. These credentials serve as the client's unique identifier and are used to authenticate the client with the API.\
\
2\. **Pass Credentials to `/auth` Endpoint**: Once the `clientID` and `clientSecret` are obtained, they must be included in the request to the /auth endpoint. This endpoint is responsible for authenticating the client and generating an access token.\
\
**Body**

<table><thead><tr><th width="181">Name</th><th width="180">Data Type (Length)</th><th>Description</th><th data-hidden data-type="checkbox">Required</th></tr></thead><tbody><tr><td><code>clientID</code><mark style="color:red;">*</mark></td><td>string <a data-footnote-ref href="#user-content-fn-1">(100)</a></td><td>Client ID</td><td>true</td></tr><tr><td><code>clientSecret</code><mark style="color:red;">*</mark></td><td>string <a data-footnote-ref href="#user-content-fn-1">(100)</a></td><td>Client Secret</td><td>true</td></tr></tbody></table>

Here is a request and response with a sample payload sent to the endpoint in Curl format.

**Sample API Request**

{% tabs %}
{% tab title="Curl" %}

```javascript
const message = "hello world";
curl --location -g '{{baseurl}}/api/auth/v1/authenticate' \
--header 'Content-Type: application/json' \
--data '{
  "clientId": "string",
  "clientSecret": "string"
}
```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "accessToken": "string",
  "tokenType": "string",
  "expirationTime": "long",//EPOCH time
  "tokenValiditySec": "long" //Token validity in Seconds
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
It is crucial to securely store and manage the client credentials and access tokens to ensure the security of the API integration.
{% endhint %}

[^1]: This is the maximum number of characters allowed.
