MadelineProtoDocs/old_docs/API_docs_v53/constructors/authorization.md

50 lines
1.8 KiB
Markdown
Raw Normal View History

2018-04-01 13:19:25 +02:00
---
title: authorization
2019-12-27 17:48:04 +01:00
description: Logged-in session
2018-04-04 19:52:48 +02:00
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
2018-04-01 13:19:25 +02:00
---
2018-04-05 01:19:57 +02:00
# Constructor: authorization
2018-04-01 13:19:25 +02:00
[Back to constructors index](index.md)
2019-12-27 17:48:04 +01:00
Logged-in session
2018-12-26 02:56:50 +01:00
2018-04-01 13:19:25 +02:00
### Attributes:
2018-12-26 02:56:50 +01:00
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|
2019-12-27 17:48:04 +01:00
|hash|[long](../types/long.md) | Yes|Identifier|
2018-12-26 02:56:50 +01: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)|
2018-12-26 02:56:50 +01: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|
2018-04-01 13:19:25 +02:00
### Type: [Authorization](../types/Authorization.md)
### Example:
```php
2018-04-01 13:19:25 +02:00
$authorization = ['_' => 'authorization', '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:
2018-04-01 13:19:25 +02:00
```lua
2018-04-01 13:19:25 +02:00
authorization={_='authorization', 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'}
```