2019-06-24 15:45:02 +02:00
|
|
|
---
|
|
|
|
title: authorization
|
2019-12-27 17:48:04 +01:00
|
|
|
description: Logged-in session
|
2019-06-24 15:45:02 +02:00
|
|
|
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
|
|
|
|
---
|
|
|
|
# Constructor: authorization
|
|
|
|
[Back to constructors index](index.md)
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-27 17:48:04 +01:00
|
|
|
Logged-in session
|
2019-06-24 15:45:02 +02:00
|
|
|
|
|
|
|
### Attributes:
|
|
|
|
|
|
|
|
| Name | Type | Required | Description |
|
|
|
|
|----------|---------------|----------|-------------|
|
2019-12-27 17:48:04 +01:00
|
|
|
|current|[Bool](../types/Bool.md) | Optional|Whether this is the current session|
|
|
|
|
|official\_app|[Bool](../types/Bool.md) | Optional|Whether the session is from an official app|
|
|
|
|
|password\_pending|[Bool](../types/Bool.md) | Optional|Whether the session is still waiting for a 2FA password|
|
|
|
|
|hash|[long](../types/long.md) | Yes|Identifier|
|
2019-06-24 15:45:02 +02:00
|
|
|
|device\_model|[string](../types/string.md) | Yes|Device model|
|
|
|
|
|platform|[string](../types/string.md) | Yes|Platform|
|
|
|
|
|system\_version|[string](../types/string.md) | Yes|System version|
|
2019-12-27 17:48:04 +01:00
|
|
|
|api\_id|[int](../types/int.md) | Yes|[API ID](https://core.telegram.org/api/obtaining_api_id)|
|
2019-06-24 15:45:02 +02:00
|
|
|
|app\_name|[string](../types/string.md) | Yes|App name|
|
|
|
|
|app\_version|[string](../types/string.md) | Yes|App version|
|
2019-12-27 17:48:04 +01:00
|
|
|
|date\_created|[int](../types/int.md) | Yes|When was the session created|
|
|
|
|
|date\_active|[int](../types/int.md) | Yes|When was the session last active|
|
|
|
|
|ip|[string](../types/string.md) | Yes|Last known IP|
|
|
|
|
|country|[string](../types/string.md) | Yes|Country determined from IP|
|
|
|
|
|region|[string](../types/string.md) | Yes|Region determined from IP|
|
2019-06-24 15:45:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Type: [Authorization](../types/Authorization.md)
|
|
|
|
|
|
|
|
|
|
|
|
### Example:
|
|
|
|
|
|
|
|
```php
|
|
|
|
$authorization = ['_' => 'authorization', 'current' => Bool, 'official_app' => Bool, 'password_pending' => Bool, 'hash' => long, 'device_model' => 'string', 'platform' => 'string', 'system_version' => 'string', 'api_id' => int, 'app_name' => 'string', 'app_version' => 'string', 'date_created' => int, 'date_active' => int, 'ip' => 'string', 'country' => 'string', 'region' => 'string'];
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Or, if you're into Lua:
|
|
|
|
|
|
|
|
```lua
|
|
|
|
authorization={_='authorization', current=Bool, official_app=Bool, password_pending=Bool, hash=long, device_model='string', platform='string', system_version='string', api_id=int, app_name='string', app_version='string', date_created=int, date_active=int, ip='string', country='string', region='string'}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|