Obter Contatos
1 min
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://{BACKEND_URL}/api/contacts/all',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer seutokenaqui'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;{
"id": 1067,
"status": "pending",
"unreadMessages": 0,
"lastMessage": "",
"protocolo": "1693",
"typebot_sessionId": "ur3209ru82094823043209rd320984230",
"customA": "Campo customizado 1",
"customB": "Campo customizado 2",
"isGroup": false,
"userId": null,
"contactId": 9016,
"whatsappId": 17,
"queueId": 34,
"chatbot": false,
"channel": "whatsapp",
"queueOptionId": null,
"companyId": 1,
"uuid": "34c8b52a-7fb4-4fc3-b819-08b189b6cee0",
"createdAt": "2023-10-29T17:55:20.292Z",
"updatedAt": "2023-10-29T19:23:10.869Z",
"contact": {
"id": 9016,
"name": "Rafael TIM",
"number": "5511912341234",
"email": "",
"profilePicUrl": "",
"acceptAudioMessage": true,
"active": true,
"disableBot": false,
"extraInfo": []
},
"user": null,
"queue": {
"id": 34,
"name": "Teste Perfeito",
"color": "#0c797d"
},
"whatsapp": {
"name": "Rafa AB LZ",
"webhook": "",
"id": 17,
"token": "",
"coverImage": null
},
"tags": [],
"company": {
"id": 1,
"name": "Nome da Empresa"
}
}