WAuth

The system is inspired by OAuth2.0, but formally it is not. This connection method should be used by each partner who wants to publish their integration on our marketplace.

WAuth is needed so that the user can connect the integration “by button”, and not fiddle with the API key.

How a user connect the integration from our marketplace:

1. The user selects a CRM in the Wazzup integrations marketplace.

2. Clicks “Connect”.

3. The user is redirected to CRM.

4. He logs in to CRM and confirms that he wants to connect the integration.

Done — the user has connected the integration between Wazzup and CRM.

WAuth setup

When all the steps to create an integration are completed, you can proceed to WAuth.

Step 1: Call POST v3/marketplace to pass field values:

Parameter Type Description
crmCode String A string of Latin letters, numbers (hyphens and underscores can be used). Serves for internal identification of CRM. Unique within Wazzup
authRedirectUri String Address of the page to which the client will be redirected to confirm authorization.

If each customer has a unique address and you can’t redirect to the same page — leave this parameter empty.

Then, when the client selects CRM in Wazzup, we will ask him to specify the link themself

secret String The key (token) that is needed when confirming the installation of the integration. Participates only in server-to-server requests, never sent to the client

These parameters will be used when your client selects Wazzup CRM in the marketplace and clicks “Connect”. In this moment:

  • a state is generated in which crmCode and accountId will be encoded;
  • in the query string authRedirectUri, add state and transfer the user to this link. If the authRedirectUri parameter is empty, we will ask the client to specify their link and redirect to the specified link.

The client will follow the link where he will be authorized on the CRM side.

Stage 2: If the client was able to log in, CRM should make a request:

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

The method has non-standard authorization: we define the user by the secret property in the request body

The request body must contain JSON with parameter values:

Parameter Type Description
state String Key generated and signed on the Wazzup side. We generate when the user has selected CRM in the marketplace and clicked “Connect”
secret String The key entered by the administrator of the marketplace CRM
crmKey String A partner-generated key that will be sent in the header { Authorization: “Bearer {wazzupKey}” } when sending webhooks
name String Integration name
Request example
curl --location --request POST 'https://api.wazzup24.com/v3/connect' \
--header 'Content-Type: application/json' \
--data-raw '
{
"state": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2Vy....",
"secret": "61e5a375-1760-452f-ad73-5318844ffc4f",
"crmKey": "e0629e11-0f67-4567-92a9-2237e91ec1b9",
"name": "Any integration name"
}
'
Response
HTTP/1.1 200 OK 
{ 
 "data": "1365e2e9119c4d889ca467cc4a9e6a48" 
}

If everything is set up properly, Wazzup will receive the request → store the crmKey → generate an apiKey and return it in the response body.

After that, CRM downloads information about users, deals, contacts, funnels with stages and sets the URL for webhooks.

Done — the integration has been successfully connected.

Publishing in the Wazzup Integration Marketplace

In order to publish, you must:

  1. Implement integration scenarios
  2. Set up authorization with Wauth
  3. Set the CRM name and logo with PATCH v3/marketplace
  4. Write to Wazzup support asking them to publish the integration module. Wazzup technical support will forward the ticket to a reviewer who will verify that the integration works and meets requirements. If everything is OK, the integration will be published, otherwise the module will be returned to the developer for revision and he will receive a notification about it in the chat in which the request for publication was sent.

Connecting the integration hosted in the Marketplace via WAuth

If the user clicked “connect integration”, was successfully navigated to the given link and logged into the CRM, the CRM should make a request for

 POST https://api.wazzup24.com/v3/connect/
This method has a non-standard authorization. The user is identified by the secret property, placed in the request body.

The request body must contain JSON with the values of the following parameters:

Parameter Type Description
state String generated and signed on the Wazzup side of the key, received by the integrator in the first stage of connecting CRM
secret String the secret entered by the administrator of the marketplace CRM
сrmKey String a partner-generated key that can be used to determine which customer the webhooks refer to. The key will come in the { Authorization: “Bearer {wazzupKey}” } header when sending webhooks.
name String the name of the integration. For example, the client’s domain in CRM. It will be specified in the personal cabinet when the client connects the integration.
 curl --location --request POST 'https://api.wazzup24.com/v3/connect' \
--header 'Content-Type: application/json' \
--data-raw '
{
"state": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2Vy....",
"secret": "61e5a375-1760-452f-ad73-5318844ffc4f",
"crmKey": "e0629e11-0f67-4567-92a9-2237e91ec1b9",
"name": "Any integration name"
}
'
Response

200 ok

data — the key to use * in the Authorization: Bearer {apiKey} header when making requests to Wazzup

Loading Wauth parameters

To update crmCode, authRedirectUri, secret you need to call

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

The request body should contain JSON with the values of the following parameters:

Parameter Type Description
crmCode String A string of Latin letters, numbers (you can use hyphens and underscores). Used for internal CRM identification. Unique within Wazzup. No more than 50 characters.
authRedirectUri String The address of the page to which the user who sets up the integration will be redirected to confirm authorization.
secret String The key (token) that is used to confirm the installation of the integration. Participates only in server-to-server queries.
Request example
 curl --location --request POST 'https://api.wazzup24.com/v3/marketplace' \

--header 'Authorization: Bearer 4a0с541451244aa9a281fba4716da40d' \

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

--data-raw '{

"crmCode": "BestCrmInTheWorld",

"secret": "our-secret",

"authRedirectUri": "http://redirect.uri"

}'

Simulation of client integration installation (Wauth test)

To simulate the installation of the integration by the client, you need to call:

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

The request body should contain JSON with the values of the following parameters:

Parameter

Required marked *

Type Description
type* String crmCode specified by the integrator at the moment of POST /v3/marketplace call
domain String It is needed if the authRedirectUri parameter is left empty, because each client has a unique link.

In the domain parameter add the full link to the CRM account: with protocol and domain. For example, https://accountcrm.com/

We will redirect to this address to confirm authorization. Just like when your client specifies a unique link when connecting

Uploading the integration name and logo

To change the logo and the public name of the integration module, you need to call:

 PATCH https://api.wazzup24.com/v3/marketplace

The request body should contain JSON with the values of the following parameters:

Parameter Type Description
crmName String The public name of CRM in English, which will be displayed in the Wazzup Personal Area
logo Object Объект с данными логотипа:

— Transparent or white background

— SVG format

— No internal indentation in the logo

— Company name on the logo in English

logo.name String Logo file name
logo.content String base64-encoded file with the logo
This method can only be invoked when the integration module is under development, i.e. has not yet been reviewed and published in the Wazzup Marketplace. If you need to change the crmName or logo after the module has been published, contact support.
Request example
 curl --location --request PATCH 'https://api.wazzup24.com/v3/marketplace' \

--header 'Authorization: Bearer 4a0b541a61244aa9a281fba4816da48d' \

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

--data-raw '{

"crmName": "The Cool CRM",

"logo": {

"name": "the-cool-crm.svg",

"content": "YmFzZTY0LWVuY29kZWQtbG9nby1maWxlLWNvbnRlbnQK"

 

}

}'