# Get Token

### URL Endpoint <a href="#url-endpoint" id="url-endpoint"></a>

| Environment | Method | URL                                                       |
| ----------- | ------ | --------------------------------------------------------- |
| Development | POST   | <https://demos.finnet.co.id/apicobrand/security/getToken> |
| Production  | POST   |                                                           |

### Request Get Token <a href="#request-get-token" id="request-get-token"></a>

| No | Name        | Type             | Mandatory | Min Length | Max Length | Description                                     |
| -- | ----------- | ---------------- | --------- | ---------- | ---------- | ----------------------------------------------- |
| 1  | reqDtime    | String           | M         | 1          | 14         | Format yyyymmddhh24iiss (GMT+7)                 |
| 2  | requestType | String           | M         | 1          | 8          | Fill with 'getToken'                            |
| 3  | transNumber | String           | M         | 1          | 100        | Unique transaction ID from the partners (mitra) |
| 4  | signature   | Alphanumeric(64) | M         | 1          | 64         | Signature algorithm                             |

#### Sample Request <a href="#sample-request" id="sample-request"></a>

```
{ 
  "reqDtime": "20240821142750", 
  "requestType": "getToken", 
  "transNumber": "TKN212418241627519329", 
  "signature": "C851DDC730549FEAFDFFD486AC11F3BF0C9CE44F0190C7DDC5FFDC622782E91D" 
}
```

### Response Get Token <a href="#response-get-token" id="response-get-token"></a>

| No | Name           | Type   | Mandatory | Min Length | Max Length | Description                                          |
| -- | -------------- | ------ | --------- | ---------- | ---------- | ---------------------------------------------------- |
| 1  | statusCode     | String | M         | 3          | 5          | 000 indicates success                                |
| 2  | statusDesc     | String | M         | 1          | 100        | Description of statusCode                            |
| 3  | tokenID        | String | M         | 1          | 100        | The Token obatained for accessing other APIs         |
| 4  | tokenExpiry    | String | M         | 1          | 18         | tokenID validity period, format DD-MMM-YY HH24:MI:SS |
| 5  | processingTime | Float  | M         | 1          | 20         | API processing time in seconds                       |

#### Sample Response <a href="#sample-response" id="sample-response"></a>

```
{ 
  "statusCode": "000", 
  "statusDesc": "Berhasil", 
  "tokenID": "20240821162411771B7219C0DB6E6374075F8E7D28D89AE9F7905E73E01202365345C5A965574D", 
  "tokenExpiry": "24-AUG-24 16:23:30", 
  "processingTime": 0.11939597129821777 
}
```

### Obtaining a Token <a href="#obtaining-a-token" id="obtaining-a-token"></a>

1. Perform a POST request to the getToken endpoint in the staging environment to obtain a tokenID.
2. If you receive a response with a false signature, copy the response, insert the true signature into the body, and then resend the request.

[<br>](https://hub.finpay.id/docs/finpay-money/widget/authorization)


---

# 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.finpay.id/api-reference/finpay-money/widget/get-token.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.
