Working with a list of deals

A deal is an entity that combines one or more contacts and has a responsible user. In CRM terminology, this entity is most often represented as an “order” or the same “deal”.

Uploading the deals list

To upload a list of deals from CRM to Wazzup, send a request

 POST https://api.wazzup24.com/v3/deals

In the request body you need to send an array with data about deals. Deals are compared by their id, if there is no such deal in Wazzup then it will be added, if there is, then data for it will be updated. You can upload not more than 100 deals in one query.

Request parameters
Parameter

Required parameters marked with an asterisk

Type Description
id* Number Deal id. Required field, no more than 100 characters.
responsibleUserId* String id of the responsible user. Fill in this field so that the responsible sales rep will have a dialog with the contact from the deal in the Wazzup chat window.
name* String Name of the deal, no more than 200 characters
uri* string The link to the deal in the CRM. If specified, in the “Deals” dropdown, the user will be able to see a list of deals with the contact, in which he/she is responsible and go to their page in the CRM. Optional field, no more than 200 characters
contacts* Object An array with the id of the contacts associated with the deal. The id of the contacts can be string
closed* Boolean Flag marking closed deals
Request example
 curl --location --request POST 'https://api.wazzup24.com/v3/deals'; \
--header 'Authorization: Basic c8cf90444023482f909520d454368d27' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"id": "1",
"responsibleUserId": "id007",
"name": "Daily Deal Test",
"closed": false,
"contacts": ["111-2e0df379-0e3c-470f-9b36"],
"link": "https://link-to-deal-in-crm.com";
}
]
'

Obtaining the list of deals

To get the list of deals send a GET request to

https://api.wazzup24.com/v3/deals. You can get up to 100 records in one request.

 GET https://api.wazzup24.com/v3/deals?offset=
Request example
 curl --location --request GET 'https://api.wazzup24.com/v3/deals' \

--header 'Authorization: Bearer c8cf90474023482f909520d45f368d27'
Response

The result data will come as an array of objects with the following parameters:

Parameter Type Description
count Number Number of contacts in the response
data Object Array with contact data
data.id String Deal id. No more than 100 characters
data.responsibleUserId String Id of the responsible user. No more than 100 characters. Needed to display a dialog with a contact from a deal to a responsible user in Wazzup chats.
data.name String Contact name. No more than 200 characters
data.contacts Object Array id of contacts with which the transaction is connected, there should be no more than 10
data.uri String A link to the contact in the CRM. Not more than 200 characters. If specified, in the “Deals” dropdown, the user will be able to see a button leading to the contact’s page in the CRM.

Getting information on an individual deal

To get information about an individual transaction you need to call:

 GET https://api.wazzup24.com/v3/deals/{deal id}
Response

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

Parameter Type Description
id Number Deal id. Required field, not more than 100 characters.
responsibleUserId String Id of the responsible user. Needed to display a dialog with a contact from a deal to a responsible user in Wazzup chats.
name String Name of the deal, no more than 200 characters
uri string The link to the deal in the CRM. If specified, in the “Deals” dropdown, the user will be able to see a list of deals with the contact, in which he/she is responsible and go to their page in the CRM. Optional field, no more than 200 characters
contacts Object An array with the id of the contacts associated with the deal. The id of the contacts can be string
closed Boolean Flag marking closed deals

Deleting a deal

To delete a specific deal, call:

 DELETE https://api.wazzup24.com/v3/deals/{deal id}
Request example
 curl --location --request DELETE 'https://api.wazzup24.com/v3/deals/101' \

--header 'Authorization: Bearer c8cf97644023482f909520d454368d27'
Errors
  • common to all routes
  • 404 Not found if no such deal exists

Deleting multiple deals

To delete a list of contacts you need to call:

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

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