Working with contacts

Contact is an entity that connects the user and the customer who wrote. This is a kind of “contact card”, where the client’s contact information (phone number to contact in WhatsApp, id in telegram, username in instagram) and the sales rep responsible for him are stored.

Adding and updating the contact list

To add a contact list or change existing ones, send a request

 POST https://api.wazzup24.com/v3/contacts
Parameter Type Description
id* String Contact Id in the CRM system. No more than 100 characters
responsibleUserId* String The Id of the responsible user. No more than 100 characters Fill in this field to have the dialog displayed in the Wazzup chat window of the person responsible for the contact.
name* String Contact Name. No more than 200 characters
contactData* Array An array of objects with contact data that contains:

chatType — string

chatId — string

contactData.chatType* String Messenger type
contactData.chatId* String Chat identifier. Mandatory for all messengers except Telegram. Mandatory for Telegram if no username or phone value is passed.
contactData.username String For Telegram only.
username of a Telegram contact, with no “@” at the beginning. Can be used when sending messages via Telegram if chatId is not known. Obligatory for Telegram if no chatId or phone value is passed.
contactData.phone String For Telegram only.
Contact’s phone number in international format, without “+” and other symbols, only numbers, with the correct country code. Can be used when sending messages via Telegram if the chatId is not known.
Obligatory for Telegram if no chatId or username value is passed.
uri String A link to the contact in the CRM. Not more than 200 characters. If specified, in the “suitcase” tool, the user will be able to see a button leading to the contact’s page in the CRM.
Request example
 curl --location --request POST 'https://api.wazzup24.com/v3/contacts' \

--header 'Authorization: Bearer c8cf90444023482f909520d454368d27' \

--header 'Content-Type: application/json' \

--data-raw '[

{

"id": "1",

"responsibleUserId": "id007",

"name": "Alex New",

 

"uri": "https://link-to-contact-in-crm.com"

},

 

{

"id": "contact-id",

"responsibleUserId": "user-id",

"name": "Supervisor",

"contactData": [

{

"chatType": "whatsapp",

"chatId": "79998881234"

}

]

}

]

'
Errors

In addition to the common errors for all roots, in this one it is still possible:

Error Description
INVALID_CONTACTS_DATA The body of the request is empty or some of the passed fields are invalid.
TOO_MACH_ENTITIES Entity limit per request exceeded

 HTTP/1.1 400 Bad Request
{
"error": "INVALID_CONTACTS_DATA",
"description": "One or more of provided contacts data are not valid."
"data": [
{
index: 12,
fields: [
"responsibleUserId",
]
}
]
}

 HTTP/1.1 400 Bad Request
{
"error": "TOO_MACH_ENTITIES",
"description": "Too mach entities per request.",
"data": {
"count": 123,
"limit": 100,
}
}

Obtaining the contact list

To get the list of contacts it is necessary to call

 GET https://api.wazzup24.com/v3/contacts?offset=

You can get up to 100 records in one query, including offset, sorted by ascending id (ASC).

offset — pagination offset, non-negative integer.

Response

The data from the query result will come in an array of objects with the following parameters:

Parameter Type Description
count Number Total number of contacts
data Object Array with data about the contact
data.id String Contact Id in the CRM system. No more than 100 characters
data.responsibleUserId String Id of the responsible user. No more than 100 characters
data.name String Contact name. No more than 200 characters
data.contactData Object An array of objects with contact data that contains: chatType — string chatId — string
data.uri String A link to the contact in the CRM. Not more than 200 characters. If specified, in the “suitcase” tool, the user will be able to see a button leading to the contact’s page in the CRM.

Getting information about an individual contact

To get information about a single contact uploaded from CRM to Wazzup you need to call

 GET https://api.wazzup24.com/v3/contacts/{contact id}
Request example
 curl --location --request GET 'https://api.wazzup24.com/v3/contacts/111-2e0df379-0e3c-470f-9b36' \

--header 'Authorization: Bearer c8cf904467023482f909520d454368d27'
Response

The data from the query result will come in the form of an object with the following parameters:

Параметр Тип Описание
id String Contact Id in the CRM system. No more than 100 characters
responsibleUserId String Id of the responsible user. No more than 100 characters
name String Contact name. No more than 200 characters
contactData Object An array of objects with contact data that contains: chatType — string chatId — string
uri String A link to the contact in the CRM. Not more than 200 characters. If specified, in the “suitcase” tool, the user will be able to see a button leading to the contact’s page in the CRM.

Deleting a contact

To delete a contact, call:

 DELETE https://api.wazzup24.com/v3/contacts/{contact id}

If there is a dialog with this contact in the general chat, it will remain there.

Request example
 curl --location --request DELETE 'https://api.wazzup24.com/v3/contacts/111-2e0df379-0e3c-470f-9b36' \

--header 'Authorization: Basic c8cf90444023482f909520d454368d27'
Errors
  • common to all routes
  • 404 Not found if no such contact exists

Deleting multiple contacts

To delete the list of contacts, you need to call

 PATCH https://api.wazzup24.com/v3/contacts/bulk_delete

In the body of the request you must pass an array of id of contacts to be deleted. If the deletion is successful, 200 OK and an empty array will be returned. If you specified contacts in the deletion request, some of which are absent in Wazzup, their IDs will be returned as an array in the response.