> For the complete documentation index, see [llms.txt](https://docs.uaepass.ae/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uaepass.ae/feature-guides/signature-integration-guide/hash-signing/hash-signing-single-document/hash-signing-java-sdk-set-up/hash-signing-process/5.-sign-pdf-document.md).

# 3. Sign PDF Document

## Obtain Access Token:

1- The url obtained from the above API call needs to be invoked in the browser to obtain the access token.

![](https://4217816688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MekZ3RZxqIxNNSkEFZ1%2Fuploads%2FQ7d7j7cs2RWNzCxltOYN%2Fimage.png?alt=media\&token=2c65c737-18c0-4c4b-a0aa-736d42da6705)

2- Pass the access token as a part of header **(X-SIGN-ACCESSTOKEN= Access Token)** with the along with the signing identity and transaction id in the next call as shown below

## This API call will create signing process

<mark style="color:green;">`POST`</mark> `http://localhost:8089/v2/signature/sign`

#### Headers

| Name               | Type   | Description                      |
| ------------------ | ------ | -------------------------------- |
| Content-Type       | string | multipart/form-data;             |
| X-SIGN-ACCESSTOKEN | string | value received from the API call |

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

````xml
​```
PK
```‌
````

{% endtab %}

{% tab title="400" %}

```javascript
{
   
  "error": "Invalid request"


}
```

{% endtab %}

{% tab title="412: Precondition Failed If you are trying to sign document with either a txId that is being already used to sign a document or txId is wrong." %}

```javascript
{
    Precondition Failed
}
```

{% endtab %}
{% endtabs %}

![](https://4217816688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MekZ3RZxqIxNNSkEFZ1%2Fuploads%2Fr4eneRnaMT9Afswrqaxf%2Fimage.png?alt=media\&token=70d4cbb7-d298-4671-95e4-29a9e1395ffb)

```
{
  "digestAlgorithm": "SHA256",
  "signIdentityId": "string",
  "txId": "string"
}
```

**List of attributes for request body:**

| Attributes                 | Description                                                                                                                                                         |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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                                                                                                                                     |
