### Connexease Mini Conversation Link Structure Examples Source: https://help.connexease.com/dev/connexease-mini Examples illustrating the correct and incorrect URL structures for conversation links to ensure the mini opens automatically and selects the correct conversation. ```plaintext // Correct Link Structure // https://mini.connexease.com/conversation?id={{conversationUuid}} // Incorrect Links Structure // https://mini.connexease.com // https://connexease.com // https://mini.connexease.com/id={{conversationUuid}} // https://mini.connexease.com/conversation={{conversationUuid}} // https://mini.connexease.com/{{conversationUuid}} ``` -------------------------------- ### Check if Connexease Mini Library is Active Source: https://help.connexease.com/dev/connexease-mini Use this code to verify if the mini.crawler tracking library has started running. It returns true if the library is active. ```javascript window.Mini.initialized ``` -------------------------------- ### Message Data Property Variants Source: https://help.connexease.com/dev/webhooks Examples of specific data structures within the message payload for interactive replies and AI or edited suggestions. ```json "data": { "language": "turkish", "interactive": { "reply_id": "2" } } ``` ```json "data": { "suggestions": { "type": "ai", "external_id": 2 } } ``` ```json "data": { "suggestions": { "type": "edited", "original_content": 'text', "external_id": 2 } } ``` -------------------------------- ### POST /accounts/{account_uuid}/channels/onboarding/ Source: https://help.connexease.com/dev/reseller Generates a short-lived token for initiating the channel onboarding process. This is the first step in adding a new channel for an account. ```APIDOC ## POST /accounts/{account_uuid}/channels/onboarding/ ### Description Adding a channel is a two-step process involving your backend and your frontend. This endpoint, called from your server, generates a short-lived token (valid for 10 minutes) to initiate the onboarding process. ### Method POST ### Endpoint `https://api.reseller.connexease.com/accounts//channels/onboarding/` ### Parameters #### Path Parameters - **account_uuid** (string) - Required - The UUID of the account for which to onboard a channel. #### Request Body - **type** (string) - Required - The type of channel to onboard (e.g., `whatsapp`). - **channel_uuid** (string) - Optional - The UUID of an existing channel if reconnecting. ### Request Example (for reconnecting) ```json { "type": "whatsapp", "channel_uuid": "3990d863-3734-4088-aca3-f91c70b21a55" } ``` ### Response #### Success Response (200) - **onboarding_url** (string) - A URL to initiate the channel connection flow. - **expires_at** (integer) - The expiry time of the onboarding URL as a Unix timestamp. ### Response Example ```json { "onboarding_url": "https://app.connexease.com/reseller/channels/whatsapp/connect?token=58f07878-62ff-4b3b-8d9a-d34057ec863d", "expires_at": 1774336309 } ``` ``` -------------------------------- ### Initialize Connexease Mini Tracking Library Source: https://help.connexease.com/dev/connexease-mini Call this function after embedding the Mini to initialize the tracking library. The library runs until a specific value in localStorage is deleted. ```javascript window.Mini.initialize() ``` -------------------------------- ### Request Onboarding Token Source: https://help.connexease.com/dev/reseller Generate a short-lived token to facilitate channel onboarding or reconnection. ```http POST https://api.reseller.connexease.com/accounts//channels/onboarding/ ``` ```json { "type": "whatsapp", "channel_uuid": "3990d863-3734-4088-aca3-f91c70b21a55" } ``` ```json { "onboarding_url": "https://app.connexease.com/reseller/channels/whatsapp/connect?token=58f07878-62ff-4b3b-8d9a-d34057ec863d", "expires_at": 1774336309 } ``` -------------------------------- ### Create a Customer Account Source: https://help.connexease.com/dev/reseller Call this endpoint to provision a new Connexease account scoped to your reseller profile. ```http POST https://api.reseller.connexease.com/accounts/ ``` ```json { "uuid": "eabd44ac-9639-4f6d-8885-abec634893d4", "name": "Acme Corp", "is_active": true, "contact_email": "[email protected]" } ``` -------------------------------- ### POST /accounts/ Source: https://help.connexease.com/dev/reseller Provisions a Connexease account scoped to your reseller. This endpoint should be called from your backend when a customer signs up. ```APIDOC ## POST /accounts/ ### Description When one of your customers signs up, call the account creation endpoint from your backend. This provisions a Connexease account scoped to your reseller. ### Method POST ### Endpoint `https://api.reseller.connexease.com/accounts/` ### Request Body (No specific request body fields are detailed in the provided text, but typically would include customer details like name and email.) ### Response #### Success Response (200) - **uuid** (string) - The unique identifier for the newly created account. - **name** (string) - The name of the account. - **is_active** (boolean) - Indicates if the account is active. - **contact_email** (string) - The contact email for the account. ### Request Example (No example provided in the source text) ### Response Example ```json { "uuid": "eabd44ac-9639-4f6d-8885-abec634893d4", "name": "Acme Corp", "is_active": true, "contact_email": "[email protected]" } ``` ### Notes Store the `uuid` from the response — you will use it in all subsequent calls for this account. ``` -------------------------------- ### Verify Webhook Requests in C# Source: https://help.connexease.com/dev/webhooks Implementation of a .NET Core MVC controller to handle and verify incoming webhook requests. ```csharp using System; using System.Text; using System.Collections.Generic; using System.Security.Cryptography; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace WebhookHandler.Controllers { [Route("webhook")] [ApiController] public class WebhookController : ControllerBase { public static string MakeDigest(string data, string key) { var keyByte = Encoding.UTF8.GetBytes(key); var digest = new HMACSHA256(keyByte); digest.ComputeHash(Encoding.UTF8.GetBytes(data)); return Convert.ToBase64String(digest.Hash); } [Route("")] [HttpPost] public void WebhookHandler(JObject webhook_body) { string sign = Request.Headers["X-Connexease-Webhook-Sign"]; JObject channel = (JObject)webhook_body["channel"]; string channel_uuid = (string)channel["uuid"]; string secretKey = "your-awesome-secret-key"; string signGenerated = MakeDigest(channel_uuid, secretKey); if (sign == signGenerated) { // Success. } else { // Fail. } } } } ``` -------------------------------- ### Set Connexease Mini Auto Login Credentials Source: https://help.connexease.com/dev/connexease-mini Provide your username and password to enable automatic login for users after they log in to your site. This information is stored in an encrypted format. ```javascript window.Mini._setAuth('username', 'password') ``` -------------------------------- ### Register Webhooks Source: https://help.connexease.com/dev/reseller Configure webhooks for specific accounts to receive event notifications. ```http POST https://api.reseller.connexease.com/accounts//webhooks/ ``` ```json { "hook": "channel.created", "account": { "uuid": "eabd44ac-9639-4f6d-8885-abec634893d4", "name": "Acme Corp" }, "payload": null, "channel": { "uuid": "eea6ed79-a996-40e7-b599-d3651544b07a", "name": "name of channel", "backend": "whatsapp_cloud" } } ``` ```http POST https://api.reseller.connexease.com/accounts//webhooks/ ``` -------------------------------- ### Fetch Feedbacks by Date Range Source: https://help.connexease.com/dev/endpoints Retrieve feedback data within a specified date range and type. Query parameters include type, channel, start_date, and end_date. ```http GET /reports/feedbacks/type=nps&start_date=2019-01-01T00:00:00.000001Z&end_date=2019-01-07T23:59:59.000001Z HTTP/1.1 ``` ```http HTTP/1.1 200 OK ``` ```http HTTP/1.1 400 Bad Request ``` ```http HTTP/1.1 401 Unauthorized ``` -------------------------------- ### Embed Connexease Mini with New Code Source: https://help.connexease.com/dev/connexease-mini Replace your existing embed code with this new version to enable additional features. This script loads necessary CSS and JavaScript files for the Mini product. ```javascript !function(){ let e="https://mini.connexease.com", t=document.getElementsByTagName("script")[0], s=document.createElement("script"), a=document.createElement("script"), n=document.createElement("link"); a.type="text/javascript", a.async="true", a.src=`${e}/assets/crawler.min.js`, s.type="text/javascript", s.async="true", s.src=`${e}/assets/mini.min.js`, n.rel="stylesheet", n.href=`${e}/assets/mini.min.css`, document.head.appendChild(n), document.head.appendChild(s), document.head.appendChild(a), t.parentNode.insertBefore(a, t), t.parentNode.insertBefore(s, t) }(); ``` -------------------------------- ### Fetch Feedbacks Source: https://help.connexease.com/dev/endpoints Fetches feedback data between specified dates, with options to filter by type and channel. ```APIDOC ## GET /reports/feedbacks/ ### Description Fetching feedbacks between specified dates. ### Method GET ### Endpoint /reports/feedbacks/ ### Query Parameters - **type** (string) - `emoji`, `nps` (All types if not given.) - **channel** (string) - Channel UUID. (All channels if not given.) - **start_date** (string) - ISO 8601 formatted date time string for start date. - **end_date** (string) - ISO 8601 formatted date time string for end date. ### Request Example ```json { "example": "GET /reports/feedbacks/type=nps&start_date=2019-01-01T00:00:00.000001Z&end_date=2019-01-07T23:59:59.000001Z HTTP/1.1\n\n" } ``` ### Response #### Success Response (200) - **Status** (string) - OK #### Response Example ```json { "example": "HTTP/1.1 200 OK\n\n" } ``` ``` -------------------------------- ### Authentication Source: https://help.connexease.com/dev/reseller All Reseller API endpoints require a Bearer token for authentication. This token identifies your reseller account and authorizes requests. It should be included in the Authorization header. ```APIDOC ## Authentication ### Description All Reseller API endpoints require a **Bearer token** that is provisioned for you by the Connexease support team. This token identifies your reseller account and authorizes server-to-server requests. ### Method Not Applicable (Header configuration) ### Endpoint Not Applicable (Header configuration) ### Request Headers - **Authorization** (string) - Required - Include the token as `Bearer `. ### Notes This token does not expire by default, but can be rotated by contacting support. Keep it secret — it has full access to all accounts under your reseller profile. ``` -------------------------------- ### Webhook: customer.updated Source: https://help.connexease.com/dev/webhooks Triggered when an agent updates a customer's information. ```APIDOC ## POST customer.updated ### Description Sends updated customer profile information. ### Request Example { "hook": "customer.updated", "account": { "uuid": "2fbcadf6-c91a-4d1f-9ed0-d4efsf6d5362", "name": "Acme Ltd" }, "channel": { "uuid": "9cbee452-db65-4437-8825-844ca1dcfc1e", "name": "Supported", "backend": "whatsapp" }, "payload": { "uuid": "d8f32499-1673-456a-9ae1-0e9fcaea3999", "name": "Mike", "mail": null, "phone_number": "+905211341620", "crm": null } } ``` -------------------------------- ### Verify Webhook Requests in Python Source: https://help.connexease.com/dev/webhooks Functions to generate an HMAC-SHA256 digest and verify the X-Connexease-Webhook-Sign header in a Django view. ```python import base64 import hashlib import hmac def make_digest(data, key): key = bytes(key, 'UTF-8') data = bytes(data, 'UTF-8') digester = hmac.new(key, data, hashlib.sha256) signature1 = digester.digest() signature2 = base64.b64encode(signature1) return str(signature2, 'UTF-8') ``` ```python import json from django.http import HttpResponse def connexease_webhooks(request): secret_key = 'awesome-secret-key' sign = request.META.get('X-Connexease-Webhook-Sign') channel_uuid = json.loads(request.body).get('channel').get('uuid') generated_digest = make_digest(channel_uuid, secret_key) if generated_digest != sign: return HttpResponse('Webhook-Sign Could Not Verified!') ``` -------------------------------- ### Webhook: message.created Source: https://help.connexease.com/dev/webhooks Triggered when a conversation is replied to by a customer or an agent. ```APIDOC ## POST message.created ### Description Sends information about a new message created in a conversation. ### Request Example { "hook": "message.created", "account": { "uuid": "2fbcadf6-c91a-4d1f-9ed4-d4ef5f6d1362", "name": "Acme Ltd" }, "channel": { "uuid": "9cbee132-db65-4437-8825-844ca1dcfc1e", "name": "Live Support", "backend": "live_chat" }, "payload": { "id": 377, "channel_identifier": "172CBFF7C637CEA6913C36E0CA1E9CB7", "conversation_uuid": "b09d6c2f-0af6-b4e0-b4e0-3987475fe766", "agent": { "uuid": "f00b6c2f-0af6-47a2-b4e0-82bf2fa2c8a4", "first_name": "", "last_name": "", "mail": "[email protected]" }, "customer": { "uuid": "487947db-f7e9-4b31-955a-3987475fe766", "name": null, "mail": null, "phone_number": null }, "type": "media", "content": null, "data": { "language": "turkish", "interactive": { "reply_id": "2" } }, "media_url": "https://allinone-cdn.tusla.com.tr/badcbb6f-942d-49ad-b50b-0564bcd0f157aX2ORz.jpg", "sent_at": "2018-05-23 08:14:55.300273+00:00", "create_at": "2018-05-23 08:14:55.749446+00:00" } } ``` -------------------------------- ### POST /accounts/{account_uuid}/webhooks/ Source: https://help.connexease.com/dev/reseller Registers webhooks for a specific account. This is used to receive notifications for events such as channel creation. ```APIDOC ## POST /accounts/{account_uuid}/webhooks/ ### Description After creating an account, register the webhooks your system needs for that account. At a minimum, you likely want `channel.created` to be notified when a channel is successfully connected through the onboarding dialog. ### Method POST ### Endpoint `https://api.reseller.connexease.com/accounts//webhooks/` ### Parameters #### Path Parameters - **account_uuid** (string) - Required - The UUID of the account for which to set up webhooks. ### Request Body - **hook** (string) - Required - The trigger for the webhook (e.g., `channel.created`). - **account** (object) - Required - Information about the account. - **uuid** (string) - The account UUID. - **name** (string) - The account name. - **payload** (any) - Optional - Additional payload data. - **channel** (object) - Optional - Information about the channel, required for channel-specific triggers. - **uuid** (string) - The channel UUID. - **name** (string) - The channel name. - **backend** (string) - The backend system for the channel (e.g., `whatsapp_cloud`). ### Request Example (for `channel.created`) ```json { "hook": "channel.created", "account": { "uuid": "eabd44ac-9639-4f6d-8885-abec634893d4", "name": "Acme Corp" }, "payload": null, "channel": { "uuid": "eea6ed79-a996-40e7-b599-d3651544b07a", "name": "name of channel", "backend": "whatsapp_cloud" } } ``` ### Notes - `channel.created` is a **channel-independent** trigger, meaning it applies to the account as a whole rather than a specific channel. For this reason, `channels` must be an empty array when using it. Only one webhook per trigger is allowed for channel-independent triggers. - For channel-specific triggers (e.g. `message.created`), you can scope them to one or more channels by passing their UUIDs in the `channels` array. See webhook document for a list of available triggers. ``` -------------------------------- ### Clear Connexease Mini Auto Login Data Source: https://help.connexease.com/dev/connexease-mini Execute this code to remove the stored login information for automatic login. ```javascript window.Mini._clearAuth() ``` -------------------------------- ### Authenticate API Requests Source: https://help.connexease.com/dev/reseller Include the provided Bearer token in the HTTP header for all server-to-server requests. ```http Authorization: Bearer ``` -------------------------------- ### Customer Updated Webhook Request Source: https://help.connexease.com/dev/webhooks Payload sent when an agent modifies customer information. ```json { "hook": "customer.updated", "account": { "uuid": "2fbcadf6-c91a-4d1f-9ed0-d4efsf6d5362", "name": "Acme Ltd" }, "channel": { "uuid": "9cbee452-db65-4437-8825-844ca1dcfc1e", "name": "Supported", "backend": "whatsapp" }, "payload": { "uuid": "d8f32499-1673-456a-9ae1-0e9fcaea3999", "name": "Mike", "mail": null, "phone_number": "+905211341620", "crm": null } } ``` -------------------------------- ### Message Created Webhook Request Source: https://help.connexease.com/dev/webhooks Payload sent when a conversation receives a new message from a customer or agent. ```json { "hook": "message.created", "account": { "uuid": "2fbcadf6-c91a-4d1f-9ed4-d4ef5f6d1362", "name": "Acme Ltd" }, "channel": { "uuid": "9cbee132-db65-4437-8825-844ca1dcfc1e", "name": "Live Support", "backend": "live_chat" }, "payload": { "id": 377, "channel_identifier": "172CBFF7C637CEA6913C36E0CA1E9CB7", "conversation_uuid": "b09d6c2f-0af6-b4e0-b4e0-3987475fe766", "agent": { "uuid": "f00b6c2f-0af6-47a2-b4e0-82bf2fa2c8a4", "first_name": "", "last_name": "", "mail": "[email protected]" }, "customer": { "uuid": "487947db-f7e9-4b31-955a-3987475fe766", "name": null, "mail": null, "phone_number": null }, "type": "media", "content": null, "data": { "language": "turkish", "interactive": { "reply_id": "2" } }, "media_url": "https://allinone-cdn.tusla.com.tr/badcbb6f-942d-49ad-b50b-0564bcd0f157aX2ORz.jpg", "latitude": null, "longitude": null, "sent_at": "2018-05-23 08:14:55.300273+00:00", "create_at": "2018-05-23 08:14:55.749446+00:00" } } ``` -------------------------------- ### Update Customer Custom Fields Source: https://help.connexease.com/dev/endpoints Use this endpoint to update a customer's custom fields. It supports successful, validation error, and authorization error responses. ```http POST /v2/customers/ HTTP/1.1 ``` ```http HTTP/1.1 200 OK ``` ```http HTTP/1.1 403 Forbidden ``` ```http HTTP/1.1 400 Bad Request ``` -------------------------------- ### Update Customer Custom Fields Source: https://help.connexease.com/dev/endpoints This endpoint allows for updating a customer's custom fields. ```APIDOC ## POST /v2/customers/ ### Description Updating a customer’s custom fields. ### Method POST ### Endpoint /v2/customers/ ### Request Example ```json { "example": "POST /v2/customers/ HTTP/1.1\n\n" } ``` ### Response #### Success Response (200) - **Status** (string) - OK #### Response Example ```json { "example": "HTTP/1.1 200 OK\n\n" } ``` ``` -------------------------------- ### Webhook: agent.status_changed Source: https://help.connexease.com/dev/webhooks Triggered when an agent's status changes. ```APIDOC ## POST agent.status_changed ### Description Notifies when an agent changes their availability status. ### Request Example { "hook": "agent.status_changed", "account": { "uuid": "2fbcadf6-c91a-4d1f-9ed0-d4efsf6d5362", "name": "Acme Ltd" }, "payload": { "uuid": "b3058476-6629-441b-8ffb-9974cb5f245f", "first_name": "", "last_name": "", "mail": "[email protected]", "status": "AVAILABLE | BREAK_TIME | DO_NOT_ASSIGN_ME" } } ``` -------------------------------- ### Webhook: message.state_changed Source: https://help.connexease.com/dev/webhooks Triggered when the state of a message changes (e.g., delivered, failed, deleted). ```APIDOC ## POST message.state_changed ### Description Notifies when a message state is updated. ### Request Example { "hook": "message.state_changed", "account": { "uuid": "4eed5ccb-fa39-4d47-89e7-42a121e89b68", "name": "Acme Ltd" }, "channel": { "uuid": "5d890115-2f40-46be-b852-2669e74396ef", "name": "WA-Dialog360", "backend": "360_dialog" }, "payload": { "id": 187, "channel_identifier": "gBEGkFNXYEgpAgkB1ZCh29XhEG0", "conversation_uuid": "f6e5b656-a4e8-41c6-b9ef-63b9474915ae", "state": "failed | delivered | deleted", "agent": { "uuid": "b3058476-6629-441b-8ffb-9974cb5f245f", "first_name": "", "last_name": "", "mail": "[email protected]" }, "customer": { "uuid": "9b686ee8-324b-4dae-8c1f-1f8d2cd3f08b", "name": null, "mail": null, "phone_number": "+901231231231", "crm": null }, "sent_at": "2021-12-09 08:54:31.322826+00:00", "create_at": "2021-12-09 08:54:31.337290+00:00" } } ``` -------------------------------- ### Agent Status Changed Webhook Request Source: https://help.connexease.com/dev/webhooks Payload sent when an agent's availability status is updated. ```json { "hook": "agent.status_changed", "account": { "uuid": "2fbcadf6-c91a-4d1f-9ed0-d4efsf6d5362", "name": "Acme Ltd" }, "payload": { "uuid": "b3058476-6629-441b-8ffb-9974cb5f245f", "first_name": "", "last_name": "", "mail": "[email protected]", "status": "AVAILABLE | BREAK_TIME | DO_NOT_ASSIGN_ME" } } ``` -------------------------------- ### Message State Changed Webhook Request Source: https://help.connexease.com/dev/webhooks Payload sent when the delivery or processing state of a message changes. ```json { "hook": "message.state_changed", "account": { "uuid": "4eed5ccb-fa39-4d47-89e7-42a121e89b68", "name": "Acme Ltd" }, "channel": { "uuid": "5d890115-2f40-46be-b852-2669e74396ef", "name": "WA-Dialog360", "backend": "360_dialog" }, "payload": { "id": 187, "channel_identifier": "gBEGkFNXYEgpAgkB1ZCh29XhEG0", "conversation_uuid": "f6e5b656-a4e8-41c6-b9ef-63b9474915ae", "state": "failed | delivered | deleted", "agent": { "uuid": "b3058476-6629-441b-8ffb-9974cb5f245f", "first_name": "", "last_name": "", "mail": "[email protected]" }, "customer": { "uuid": "9b686ee8-324b-4dae-8c1f-1f8d2cd3f08b", "name": null, "mail": null, "phone_number": "+901231231231", "crm": null }, "sent_at": "2021-12-09 08:54:31.322826+00:00", "create_at": "2021-12-09 08:54:31.337290+00:00" } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.