Users are the profiles you create in CRM for your employees. These are not your customers, but your managers or support staff.
The set of methods below will help you set up synchronization of user accounts in your CRM with Wazzup.
Getting a list of users
To get a list of active Wazzup users, you need to call:
GET https://api.wazzup24.com/v3/users?offset=
This method returns users in pages of 100, taking into account offset, sorted by name.
Request example
curl --location --request GET 'https://api.wazzup24.com/v3/users' \ --header 'Authorization: Bearer c8cf90444442348we909520d454368d27'
Response
Request result example
{ “count”: “1”, “data”: [ {"id": "2e0df379-0e3c-470f-9b36-06b9e34c3bdb", // user id "name": "User Name"} // user name ] }
Retrieving single user data
To retrieve data on a specific user, you need to call
GET https://api.wazzup24.com/v3/users/:id
The response will be a JSON like this
{ {"id": "2e0df379-0e3c-470f-9b36-06b9e34c3bdb", //user id "name": "User Name"} , "phone": "79332345432 //user name ] }
Adding users
To add a new user you need to call
POST https://api.wazzup24.com/v3/users
In the request body you should pass an array with data about users (not more than 100 in one request). Users are compared by their id: if the user does not yet exist in Wazzup, he will be added, if he exists, his data will be updated.
Parameter | Type | Description |
id* | String | User identifier. Up to 200 characters |
name* | String | User name. A string of up to 200 characters |
phone | String | The phone number is in international format “79261234567”. If the phone number does not pass the formal validation, there will be no error and the property phone will simply be deleted. |
The “phone” field is specified only for the ability to add a user to the mobile application.
Request example
curl --location --request POST 'https://api.wazzup24.com/v3/users' \ --header 'Authorization: Bearer c8cf90444023482f909520d454368d27' \ --header 'Content-Type: application/json' \ --data-raw '[ { "id": "2e0df379-0e3c-470f-9b36-06b9e34c3bdb", "name": "Alex Salesman", "phone": "79263334567" }, { "id": "111-2e0df379-0e3c-470f-9b36", "name": "Kate Supportics", "phone": "79261234567" } ]'
Error
Error | Description |
INVALID_USERS_DATA | The body of the request is empty or some of the passed fields are invalid. |
TOO_MACH_ENTITIES | Entity limit per request exceeded |
USER_LIMIT_EXCEEDED | Entity limit exceeded |
INVALID_USERS_DATA example
HTTP/1.1 400 Bad Request { "error": "INVALID_USERS_DATA", "description": "One or more of provided users identifiers are not valid." "data": [ { index: 12, fields: [ "id", "name" ] } ] }
TOO_MACH_ENTITIES example
HTTP/1.1 400 Bad Request { "error": "TOO_MACH_ENTITIES", "description": "Too mach entities per request.", "data": { "count": 123, "limit": 100 } }
USER_LIMIT_EXCEEDED example
HTTP/1.1 400 Bad Request { "error": "USER_LIMIT_EXCEEDED", "description": "User limit exceeded.", "data": { "limit": 1000, } }
Deleting a user
To delete a user, you need to call
DELETE https://api.wazzup24.com/v3/users/{contact id}
Request example
curl --location --request DELETE 'https://api.wazzup24.com/v3/users/111-2e0df379-0e3c-470f-9b36' \ --header 'Authorization: Bearer c8cf90444023482f909520d454368d27'
Mass user removal
To delete the list of users, it is necessary to call
PATCH https://api.wazzup24.com/v3/users/bulk_delete
In the body of the request you must pass an array of IDs of users you want to remove. If the deletion is successful, 200 OK and an empty array will be returned. If the deletion request specified users, some of which are absent in Wazzup, their IDs will be returned as an array in the response.