# 1. Token

Firstly, the document signature application/portal calls the UAEPASS API to obtain the access token using client credentials issued to them.

## API Calling Method

<mark style="color:green;">`POST`</mark> `stg-id.uaepass.ae/trustedx-authserver/oauth/main-as/token`&#x20;

HTTP/1.1

#### Headers

| Name          | Type   | Description                               |
| ------------- | ------ | ----------------------------------------- |
| Authorization | string | Basic ZG9jc2lnbjpkZW1vZGVtbw==            |
| Content-Type  | string | application/x-www-form-urlencoded         |
| grant\_type   | string | client\_credentials                       |
| scope         | string | urn:safelayer:eidas:sign:process:document |

{% tabs %}
{% tab title="200 Content-Type: application/json;charset=utf-8
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache" %}

```
{
    "access_token": "6fed0c30a51643f9b6ad7365cf90d7e.....72848cf0fb3aee9ad5ac1811212",
    "token_type": "Bearer",
    "expires_in": 600,
    "scope": "urn:safelayer:eidas:sign:process:document"
}
 
```

{% endtab %}
{% endtabs %}

{% hint style="info" %} <mark style="color:$info;">**Note: Token remains valid for 10 mins. If the same user signs the document within that time period, token endpoint is not required to be invoked again.**</mark>
{% endhint %}


---

# 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/digital-signature-single-document/signing-guide/untitled/1.-obtaining-the-token-for-accessing-the-signature-operations.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.
