# Authorization Widget

### Create Signature <a href="#create-signature" id="create-signature"></a>

#### A. Sort ascending parameter name <a href="#a-sort-ascending-parameter-name" id="a-sort-ascending-parameter-name"></a>

```
{ 
  "requestType": "getToken", 
  "phoneNumber": "081286288844", 
  "reqDtime": "20181127182011", 
  "transNumber": "20181234567890" 
}
```

Result:

```
1. phoneNumber 
2. reqDtime 
3. requestType 
4. transNumber
```

#### B. Join all parameters <a href="#b-join-all-parameters" id="b-join-all-parameters"></a>

```
08128628884420181127182011getToken20181234567890
```

#### C. Hash Using hash\_mach sha256 with keysignature <a href="#c-hash-using-hash_mach-sha256-with-keysignature" id="c-hash-using-hash_mach-sha256-with-keysignature"></a>

```
keysignature is hexa from secret key 
secretkey : e4siErApPs2020 
keysignature : 6534736985724170507332303230
```

#### D. Convert to uppercase, result of point C <a href="#d-convert-to-uppercase-result-of-point-c" id="d-convert-to-uppercase-result-of-point-c"></a>

```
55C9AF15C92408C32211894070BAIEC02C2C17BEAD626934F6IC0IA3117A05CF
```

### Code example to generate signature <a href="#code-example-to-generate-signature" id="code-example-to-generate-signature"></a>

```
function signature($array, $kunci){ 
  unset($array["signature"]); 
  ksort($array); 
  $output = ""; 
    foreach($array as $key => $val){ 
      $output .= $val; 
    } 
  $output = hash_hmac("sha256", $output, strToHex($kunci)); 

return strtoupper($output); 
}
```


---

# 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/authorization-widget.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.
