contacts.resolvePhone
Resolve a phone number to get user info, if their privacy settings allow it. Make sure to implement client-side ratelimiting/debounce for this method, allowing at most 1 call every 3 seconds.
func (c *Client) ContactsResolvePhone(ctx context.Context, phone string) (*ContactsResolvedPeer, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.ContactsResolvePhone(ctx, phone)
if err != nil {
return err
}
_ = res // *ContactsResolvedPeer
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Phone | string | yes | Phone number in international format, possibly obtained from a phone number deep link. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | PHONE_NOT_OCCUPIED | No user is associated to the specified phone number. |
References
- Official documentation
- Generated Go reference
- TL definition:
contacts.resolvePhone#8af94344