Get contact metadata
#
Método#
/contacts/{phone}GET
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/contacts/{phone}
#
HeaderKey | Value |
---|---|
Client-Token | ACCOUNT SECURITY TOKEN |
#
ConceptThis method is responsible for returning all of you contact’s metadata
Tip about contact's image
If you intend to store your contact's image, please note that we always return in get-contacts the attribute with imgUrl with it for you, but it is important to remember that it is only available for 48 hours. After this period the image link is deleted by WhatsApp itself . We suggest that if you need to update your contact's image, you use the next method in this documentation, get-profile-picture.
#
Attributes#
RequiredAttributes | Type | Description |
---|---|---|
phone | string | Telephone number in the format DDI DDD NUMERS Ex: 551199999999. IMPORTANT only send numbers without formatting or a mask |
#
OptionalsAttributes | Type | Description |
---|---|---|
#
Request Params#
URL exampleMethod
GET
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/contacts/5511999999999
#
Response#
200Attributes | Type | Description |
---|---|---|
phone | string | Contacts phone |
name | string | First and last name of the contact, it will only return filled in if you have the number in your contacts |
short | string | Contact name, it will only return filled in if you have the number in your contacts |
vname | string | Contact name if you have him as a contact |
notify | string | Name entered in WhatsApp name settings |
imgUrl | string | Contact photo URL WhatsApp deletes after 48h |
Example
#
405In this case certify that you are sending the correct specification of the method. This means, verify if you sent a POST or GET as specified at the beginning of this topic.
#
415In case you receive 415 error, make sure to add the “Content-Type” of the object you are sending in the request headers, mostly “application/json”