auth.importAuthorization
Logs in a user using a key transmitted from his native data-center.
func (c *Client) AuthImportAuthorization(ctx context.Context, request *AuthImportAuthorizationRequest) (AuthAuthorizationClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AuthImportAuthorization(ctx, &tg.AuthImportAuthorizationRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // AuthAuthorizationClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ID | int64 | yes | User ID |
Bytes | []byte | yes | Authorization key |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | AUTH_BYTES_INVALID | The provided authorization is invalid. |
| 400 | USER_ID_INVALID | The provided user ID is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
auth.importAuthorization#a57a7dad