Contato
Conceito
Para os contatos teremos três métodos.
- Check contact exit
- Find contact
- Get contacts
Métodos
/check
GET https://api.jlivery.com/api/v1/wa/SEU_TOKEN/contacts/SEU_PHONE/check
Esse método será responsável por verificar se o número que está conectado é registrado e válido.
Response check
200
{
"status": 200,
"message": "",
"data": {
"exists": true,
"phone": "[email protected]"
}
}
400
{
"status": 400,
"message": "failed to send usync query: info query timed out Failed check number is regitered on whatsapp",
"data": null
}
/phone
GET https://api.jlivery.com/api/v1/wa/SEU_TOKEN/contacts/PHONE_DE_BUSCA
Esse método sera responsável por buscar um contato especifico.
Response phone
200
{
"status": 200,
"message": "",
"data": {
"full_name": "Fulano tal",
"phone": "55xxxxxxxxxxx",
"found": true,
"first_name": "Fulano",
"push_name": "fulaninho",
"business_name": "",
"picture_url": "https://pps.whatsapp.net/v/t61.24694-24/379414893_174528269012143_2391459371330510330_n.jpg?ccb=11-4&oh=01_AdQIy7t8jTj0qI2_M-ONJCuf_PZvVMpqUxhbzoi3wLZB7Q&oe=6540BCD6&_nc_sid=000000&_nc_cat=104"
}
}
Params
| Key | Value |
|---|---|
| Authorization | Token xxxxxxxxxxxxxxx |
| Phone | 55xxxxxxxxxxx |
/contacts
GET https://api.jlivery.com/api/v1/wa/SEU_TOKEN/contacts
Já o endpoint /api/v1/wa/SEU_TOKEN/contacts irá buscar todos os seus contatos do Whatsapp.
Response contacts
200
{
"status": 200,
"message": "",
"data": {
"total": 523, // Trás o total de contatos que o número tem salvo.
"contacts": [
{
"full_name": "Fabi",
"phone": "55xxxxxxxxxxx",
"found": true,
"first_name": "",
"push_name": "",
"business_name": ""
},
{
"full_name": "Miguel",
"phone": "55xxxxxxxxxx",
"found": true,
"first_name": "",
"push_name": "",
"business_name": ""
},
{
"full_name": "Maurício",
"phone": "55xxxxxxxxxxx",
"found": true,
"first_name": "",
"push_name": "",
"business_name": ""
}
]
}
}