List contacts
GET
/v1/whatsapp/sessions/{sessionId}/contactsReturns the contacts of the session.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
limit | integer | Maximum contacts to return, from 1 to 1000. Defaults to 1000. |
offset | integer | Number of contacts to skip, for paging. |
curl "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/contacts?limit=50" \
-H "X-API-Key: $TUSK_WA_KEY"200 OK
[
{
"id": "[email protected]",
"name": "Amina Wanjiru",
"pushName": "Amina",
"number": "254700000002",
"isMyContact": true,
"isBlocked": false
}
]Check a number
GET
/v1/whatsapp/sessions/{sessionId}/contacts/check/{number}Checks whether a phone number is on WhatsApp. Limited to 30 checks per minute per session.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
numberrequired | path | The number in international format, without a plus. |
curl "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/contacts/check/254700000002" \
-H "X-API-Key: $TUSK_WA_KEY"200 OK
{
"number": "254700000002",
"exists": true,
"chat_id": "[email protected]"
}