Layer 220
Authorization
Logged-in session
constructor
authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true encrypted_requests_disabled:flags.3?true call_requests_disabled:flags.4?true unconfirmed:flags.5?true 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 = Authorization;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| Current | flags.0?true | Whether this is the current session |
| OfficialApp | flags.1?true | Whether the session is from an official app |
| PasswordPending | flags.2?true | Whether the session is still waiting for a 2 FA password |
| EncryptedRequestsDisabled | flags.3?true | Whether this session will accept encrypted chats |
| CallRequestsDisabled | flags.4?true | Whether this session will accept phone calls |
| Unconfirmed | flags.5?true | Whether the session is unconfirmed, see here for more info. |
| Hash | long | Identifier |
| DeviceModel | string | Device model |
| Platform | string | Platform |
| SystemVersion | string | System version |
| ApiId | int | API ID |
| AppName | string | App name |
| AppVersion | string | App version |
| DateCreated | int | When was the session created |
| DateActive | int | When was the session last active |
| Ip | string | Last known IP |
| Country | string | Country determined from IP |
| Region | string | Region determined from IP |
Returns
AuthorizationGogram Example
// Creating Authorization constructor obj := &tg.Authorization{ Hash: int64(0), DeviceModel: "...", Platform: "...", SystemVersion: "...", ApiId: 0, AppName: "...", // ... more required fields // Optional fields: // Current: true, // OfficialApp: true, // PasswordPending: true, // EncryptedRequestsDisabled: true, // ... more optional fields }