Layer 220
InitConnection
Initialize connection
method
Users
Bots
initConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| ApiId | int | Application identifier (see. App configuration ) |
| DeviceModel | string | Device model |
| SystemVersion | string | Operation system version |
| AppVersion | string | Application version |
| SystemLangCode | string | Code for the language used on the device's OS, ISO 639-1 standard |
| LangPack | string | Platform identifier (i. e. android, tdesktop, etc). |
| LangCode | string | Either an ISO 639-1 language code or a language pack name obtained from a language pack link. |
| Proxy | flags.0?InputClientProxy | Info about an MTProto proxy |
| Params | flags.1?JSONValue | Additional init Connection parameters. For now, only the tz_offset field is supported, for specifying the timezone offset in seconds. |
| Query | !X | The query itself |
Possible Errors
| Code | Type | Description |
|---|---|---|
| 400 | CONNECTION_LAYER_INVALID | Layer invalid. |
Gogram Example
// InitConnection - using Params struct result, err := client.InitConnection(&tg.InitConnectionParams{ ApiId: 0, DeviceModel: "...", SystemVersion: "...", AppVersion: "...", SystemLangCode: "...", LangPack: "...", LangCode: "...", Query: nil, // Optional fields: // Proxy: &tg.InputClientProxy{}, // Params: &tg.JsonValue{}, }) if err != nil { // handle error } // result is *tg.ReturnsTheTypeReturnedByTheInvokedMethod