# 2. Initiate Signing Process

&#x20;The obtained signing identity and txId during the previous step needs to be passed in the next API call along with the single or multiple documents to be signed.

<mark style="color:blue;">**`PUT http://localhost:8080/v2/signature/request`**</mark>

**Headers**

| Name         | Value               |
| ------------ | ------------------- |
| Content-Type | multipart/form-data |

**Body**

| Name            | Description                                                                                                                                             |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| digestAlgorithm | SHA256                                                                                                                                                  |
| signIdentityId  | ckqtokgre4o5mrk4bajtk413ui                                                                                                                              |
| txId            | 90ca005cfb4d4827b1247889166b72fe                                                                                                                        |
| file            | file1.pdf file2.pdf                                                                                                                                     |
| sigProp         | { "signPropDetail": \[ { "fileName": "file1.pdf", "signInfo": "1:50, 50, 200,200]" }, { "fileName": "file2.pdf", "signInfo": "1:\[50,50,200,200]" } ] } |

**Response**

{% tabs %}
{% tab title="200" %}
{% code overflow="wrap" %}

````url
{
  ```
https://stg-id.uaepass.ae/trustedx-authserver/oauth/hsign-as?response_type=code&client_id=sandbox_stage&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fv2%2Fsignature%2Ftoken&scope=urn:uae:digitalid:backend_api:hash_signing urn:safelayer:eidas:sign:identity:use:server&state=1434459749&digests_summary=npBScEri0PAqJ8yWz11jvcjFOlzVkDijlM-osjrX98k%3D&digests_summary_algorithm=SHA256&sign_identity_id=ckqtokgre4o5mrk4bajtk413ui
```
}
````

{% endcode %}
{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}

Provide the below values for “signProp” parameter in the API call. The values should be adjusted accordingly as per the files.

```
{
  "signPropDetail": [
    {
      "fileName": "sample1.pdf",
      "signInfo": "1:[50, 600, 200, 100]"
    },
    {
      "fileName": "sample2.pdf",
      "signInfo": "1:[50, 600, 200, 100]"
    }
  ]
}

```

**Description of parameters in the above request body:**

| filename | The name of the file that needs to be signed. It should be exactly same as the selected one.                                                                                                                              |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| signInfo | Page number and the signing position on the specified page. The first 2 values (50,600) specify the values for lower left corner X,Y coordinates and other two 200,100) represent the upper right corner X,Y coordinates. |

| txId(mandatory)            | <p>Transaction id for signing request.</p><p><strong>Note</strong>: Transaction ID is valid for only 10 minutes and operation should end within the same period.</p> |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| digestAlgorithm(mandatory) | <p>Entity can use one of the digest algorithms from below according to their requirement:</p><p>SHA256</p><p>SHA384</p><p>SHA512</p>                                 |
| signIdentityId(mandatory)  | User’s qualified certificate id                                                                                                                                      |
| file(mandatory)            | Pdf file which is to be signed                                                                                                                                       |
| signProp                   | As described above                                                                                                                                                   |

<figure><img src="/files/TGkuMudPdQmGnn1vgFkB" alt=""><figcaption><p><mark style="color:green;">Sample postman request</mark></p></figcaption></figure>

#### Sample Curl Command

```url
curl --location --request PUT 'http://localhost:8080/v2/signature/request' \
--header 'Content-Type: multipart/form-data' \
--form 'digestAlgorithm="SHA256"' \
--form 'signIdentityId="49o09dt4v47lvd2r14tesod0at"' \
--form 'txId="4f1068dbe3f64aefa45ada9555c9ba0b"' \
--form 'file=@"/C:path to file/file1.pdf"' \
--form 'file=@"/C:path to file/file2.pdf"' \
--form 'sigProp="{
  \"signPropDetail\": [
    {
      \"fileName\": \"file1.pdf\",
      \"signInfo\": \"1:50, 50, 200,200]\"

    },
    {
      \"fileName\": \"file2.pdf\",
      \"signInfo\": \"1:[50,50,200,200]\"
    }
  ]
}"'
```


---

# 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.uaepass.ae/feature-guides/signature-integration-guide/hash-signing/hash-signing-single-document/hash-signing-docker-container-set-up/hash-signing-process/2.-initiate-signing-process.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.
