# account.getAuthorizationForm

Returns a Telegram Passport authorization form for sharing data with a service

## Example

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

```javascript
const {Api, TelegramClient} = require('telegram');
const {StringSession} = require('telegram/sessions');

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result = await client.invoke(new Api.account.getAuthorizationForm({
        botId: 2663630,
        scope: 'random string here',
        publicKey: 'random string here',
        }));
    console.log(result); // prints the result
})();
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
import {Api, TelegramClient} from 'telegram';
import {StringSession} from 'telegram/sessions';

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result: Api.account.AuthorizationForm = await client.invoke(new Api.account.getAuthorizationForm({
        botId: 2663630,
        scope: 'random string here',
        publicKey: 'random string here',
        }));
    console.log(result); // prints the result
})();
```

{% endtab %}
{% endtabs %}

## TL schema

```
account.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;
---functions---
account.getAuthorizationForm#b86ba8e1 bot_id:int scope:string public_key:string = account.AuthorizationForm;
```

## Parameters

|       Name      | Type                                            | Description                                              |
| :-------------: | ----------------------------------------------- | -------------------------------------------------------- |
|   **bot\_id**   | [int](https://core.telegram.org/type/int)       | User identifier of the service's bot                     |
|    **scope**    | [string](https://core.telegram.org/type/string) | Telegram Passport element types requested by the service |
| **public\_key** | [string](https://core.telegram.org/type/string) | Service's public key                                     |

## Result

[account.AuthorizationForm](https://core.telegram.org/type/account.AuthorizationForm)

## Possible errors

| Code | Type | Description |
| :--: | ---- | ----------- |

## Can bots use this methd ?

### yes

## Related pages


---

# 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://painor.gitbook.io/gramjs/working-with-telegram-passport/account.getauthorizationform.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.
