Buscar contatos

Endpoint: GET https://croncrm.com/api/v2/contacts-whatsapp-app/find

Header do request
Atributo Descrição Obrigatório Tipo

apiKey

Informe sua API Key gerada na interface do CRONCRM.

Sim

String

Query do request
Atributo Descrição Obrigatório Tipo

page

Página da listagem (paginação).

Não

Inteiro

GET /api/v2/contacts-whatsapp-app/find?page=1
Response do request

Em caso de sucesso, retorna HTTP 200 com success true. Método incorreto retorna 405; falhas inesperadas retornam 500.

Atributo Descrição Tipo

success

Informa se a operação teve sucesso ou não.

Boolean

msg

Mensagem de retorno.

String

page

Página atual.

Inteiro

pages

Total de páginas.

Inteiro

limit

Quantidade de registros por página.

Inteiro

count

Total de registros encontrados.

Inteiro

contacts

Lista de contatos.

wid: (String) WID do contato.

wuser: (String) Usuário do WID.

wserver: (String) Servidor do WID.

name: (String) Nome do contato.

is_business: (Boolean) Indica se o contato é conta comercial.

is_enterprise: (Boolean) Indica se o contato é uma conta enterprise.

is_my_contact: (Boolean) Indica se o contato está na sua agenda do celular.

Array|null

{
  "success": true,
  "msg": "Consulta realizada com sucesso.",
  "page": 1,
  "pages": 10,
  "limit": 20,
  "count": 200,
  "contacts": [
    {
      "wid": "[email protected]",
      "wuser": "5599...",
      "wserver": "c.us",
      "name": "Contato A",
      "is_business": false,
      "is_enterprise": false,
      "is_my_contact": true
    }
  ]
}
<?php
$apiKey = 'SEU_API_KEY';
$baseUrl = 'https://croncrm.com/api/v2/contacts-whatsapp-app/find';

$query = [
    'page' => 1,
];

$url = $baseUrl . '?' . http_build_query($query);

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => [
        'apiKey: ' . $apiKey,
    ],
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);

if ($error) {
    throw new RuntimeException($error);
}

echo "HTTP {$httpCode}\n";
echo $response;
?>
curl -G \
  'https://croncrm.com/api/v2/contacts-whatsapp-app/find' \
  -H 'apiKey: SEU_API_KEY' \
  --data-urlencode 'page=1'