> For the complete documentation index, see [llms.txt](https://painor.gitbook.io/gramjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://painor.gitbook.io/gramjs/working-with-telegram-passport/account.getauthorizationform.md).

# 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
