/node-crisp-api

:zap: Crisp API Node Wrapper

Primary LanguageJavaScriptMIT LicenseMIT

Crisp API Wrapper

Test and Build NPM Downloads

The Crisp API Node wrapper. Authenticate, send messages, fetch conversations, access your agent accounts from your JavaScript code.

Copyright 2021 Crisp IM SARL. See LICENSE for copying information.

Installation

npm install --save crisp-api

Authentication

To authenticate against the API, obtain your authentication token keypair by following the REST API Authentication guide. You'll get a token keypair made of 2 values.

Keep your token keypair values private, and store them safely for long-term use.

Then, add authentication parameters to your client instance right after you create it:

var Crisp = require("crisp-api");
var CrispClient = new Crisp();

// Authenticate to API with your plugin token (identifier, key)
// eg. CrispClient.authenticate("7c3ef21c-1e04-41ce-8c06-5605c346f73e", "cc29e1a5086e428fcc6a697d5837a66d82808e65c5cce006fbf2191ceea80a0a");
CrispClient.authenticateTier("plugin", identifier, key);

// Now, you can use authenticated API sections.

Overview

You may follow the REST API Quickstart guide, which will get you running with the REST API in minutes.

var Crisp = require("crisp-api");
var CrispClient = new Crisp();

CrispClient.authenticateTier("plugin", identifier, key);

CrispClient.website.listConversations(websiteID, 1)
  .then(function(conversations) {
    console.log("Listed conversations:", conversations);
  })
  .catch(function(error) {
    console.error("Error listing conversations:", error);
  });

Examples

Create your own bot!

var Crisp = require("crisp-api");
var CrispClient = new Crisp();

CrispClient.authenticateTier("plugin", identifier, key);

// Notice: make sure to authenticate before listening for an event
CrispClient.on("message:send", function(message) {
  CrispClient.website.sendMessageInConversation(
    message.website_id, message.session_id,

    {
      type    : "text",
      content : "I'm a bot",
      from    : "operator", // or user
      origin  : "chat"
    }
  )
    .then(function(message) {
      console.log("Message sent:", message);
    })
    .catch(function(error) {
      console.error("Error sending message:", error);
    });
});

Resource Methods

All the available Crisp API resources are fully implemented. Programmatic methods names are named after their label name in the REST API Reference.

All methods that you will most likely need when building a Crisp integration are prefixed with a star symbol (⭐).

⚠️ Note that, depending on your authentication token tier, which is either user or plugin, you may not be allowed to use all methods from the library. When in doubt, refer to the library method descriptions below. Most likely, you are using a plugin token.

Resource Methods Index

Website
Plugin
Media
Bucket
RTM Events

Website

  • Website Conversations

    • ⭐ List Conversations [user, plugin]: Reference

      • CrispClient.website.listConversations(websiteID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listConversations(websiteID, pageNumber);
    • List Suggested Conversation Segments [user, plugin]: Reference

      • CrispClient.website.listSuggestedConversationSegments(websiteID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listSuggestedConversationSegments(websiteID, pageNumber);
    • Delete Suggested Conversation Segment [user, plugin]: Reference

      • CrispClient.website.deleteSuggestedConversationSegment(websiteID, segment)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var segment = "bug";
        
        CrispClient.website.deleteSuggestedConversationSegment(websiteID, segment);
    • List Suggested Conversation Data Keys [user, plugin]: Reference

      • CrispClient.website.listSuggestedConversationDataKeys(websiteID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listSuggestedConversationDataKeys(websiteID, pageNumber);
    • Delete Suggested Conversation Data Key [user, plugin]: Reference

      • CrispClient.website.deleteSuggestedConversationDataKey(websiteID, key)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var key = "price";
        
        CrispClient.website.deleteSuggestedConversationDataKey(websiteID, key);
  • Website Conversation

    • ⭐ Create A New Conversation [user, plugin]: Reference

      • CrispClient.website.createNewConversation(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.createNewConversation(websiteID);
    • Check If Conversation Exists [user, plugin]: Reference

      • CrispClient.website.checkConversationExists(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.checkConversationExists(websiteID, sessionID);
    • ⭐ Get A Conversation [user, plugin]: Reference

      • CrispClient.website.getConversation(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.getConversation(websiteID, sessionID);
    • Remove A Conversation [user, plugin]: Reference

      • CrispClient.website.removeConversation(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.removeConversation(websiteID, sessionID);
    • Initiate A Conversation With Existing Session [user, plugin]: Reference

      • CrispClient.website.initiateConversationWithExistingSession(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.initiateConversationWithExistingSession(websiteID, sessionID);
    • ⭐ Get Messages In Conversation [user, plugin]: Reference

      • CrispClient.website.getMessagesInConversation(websiteID, sessionID, timestampBefore)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var timestampBefore = 1641206011000;
        
        CrispClient.website.getMessagesInConversation(websiteID, sessionID, timestampBefore);
    • ⭐ Send A Message In Conversation [user, plugin]: Reference

      • CrispClient.website.sendMessageInConversation(websiteID, sessionID, message)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var message = {
          "type": "text",
          "from": "operator",
          "origin": "chat",
          "content": "Hey there! Need help?"
        };
        
        CrispClient.website.sendMessageInConversation(websiteID, sessionID, message);
    • Get A Message In Conversation [user, plugin]: Reference

      • CrispClient.website.getMessageInConversation(websiteID, sessionID, fingerprint)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var fingerprint = 524653764345;
        
        CrispClient.website.getMessageInConversation(websiteID, sessionID, fingerprint);
    • Update A Message In Conversation [user, plugin]: Reference

      • CrispClient.website.updateMessageInConversation(websiteID, sessionID, fingerprint, content)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var fingerprint = 524653764345;
        
        var content = "Hey there! Need help?";
        
        CrispClient.website.updateMessageInConversation(websiteID, sessionID, fingerprint, content);
    • Compose A Message In Conversation [user, plugin]: Reference

      • CrispClient.website.composeMessageInConversation(websiteID, sessionID, compose)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var compose = {
          "type": "start",
          "from": "operator"
        };
        
        CrispClient.website.composeMessageInConversation(websiteID, sessionID, compose);
    • ⭐ Mark Messages As Read In Conversation [user, plugin]: Reference

      • CrispClient.website.markMessagesReadInConversation(websiteID, sessionID, read)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var read = {
          "from": "operator",
          "origin": "urn:crisp.im:slack:0",
          "fingerprints": [
            "5719231201"
          ]
        };
        
        CrispClient.website.markMessagesReadInConversation(websiteID, sessionID, read);
    • ⭐ Mark Messages As Delivered In Conversation [user, plugin]: Reference

      • CrispClient.website.markMessagesDeliveredInConversation(websiteID, sessionID, delivered)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var delivered = {
          "from": "operator",
          "origin": "urn:crisp.im:slack:0",
          "fingerprints": [
            "5719231201"
          ]
        };
        
        CrispClient.website.markMessagesDeliveredInConversation(websiteID, sessionID, delivered);
    • Update Conversation Open State [user, plugin]: Reference

      • CrispClient.website.updateConversationOpenState(websiteID, sessionID, opened)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var opened = true;
        
        CrispClient.website.updateConversationOpenState(websiteID, sessionID, opened);
    • ⭐ Get Conversation Routing Assign [user, plugin]: Reference

      • CrispClient.website.getConversationRoutingAssign(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.getConversationRoutingAssign(websiteID, sessionID);
    • ⭐ Assign Conversation Routing [user, plugin]: Reference

      • CrispClient.website.assignConversationRouting(websiteID, sessionID, assign)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var assign = {
          "assigned": {
            "user_id": "a4c32c68-be91-4e29-8a05-976e93abbe3f"
          }
        };
        
        CrispClient.website.assignConversationRouting(websiteID, sessionID, assign);
    • ⭐ Get Conversation Metas [user, plugin]: Reference

      • CrispClient.website.getConversationMetas(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.getConversationMetas(websiteID, sessionID);
    • ⭐ Update Conversation Metas [user, plugin]: Reference

      • CrispClient.website.updateConversationMetas(websiteID, sessionID, metas)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var metas = {
          "nickname": "John Doe",
          "email": "john.doe@acme-inc.com",
          "segments": [
            "happy",
            "customer",
            "love"
          ],
          "data": {
            "type": "customer",
            "signup": "finished"
          }
        };
        
        CrispClient.website.updateConversationMetas(websiteID, sessionID, metas);
    • Get An Original Message In Conversation [user, plugin]: Reference

      • CrispClient.website.getOriginalMessageInConversation(websiteID, sessionID, originalID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var originalID = "2325a3c0-9b47-4fc6-b00e-111b752e44cd";
        
        CrispClient.website.getOriginalMessageInConversation(websiteID, sessionID, originalID);
    • List Conversation Pages [user, plugin]: Reference

      • CrispClient.website.listConversationPages(websiteID, sessionID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var pageNumber = 1;
        
        CrispClient.website.listConversationPages(websiteID, sessionID, pageNumber);
    • List Conversation Events [user, plugin]: Reference

      • CrispClient.website.listConversationEvents(websiteID, sessionID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var pageNumber = 1;
        
        CrispClient.website.listConversationEvents(websiteID, sessionID, pageNumber);
    • Get Conversation State [user, plugin]: Reference

      • CrispClient.website.getConversationState(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.getConversationState(websiteID, sessionID);
    • ⭐ Change Conversation State [user, plugin]: Reference

      • CrispClient.website.changeConversationState(websiteID, sessionID, state)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var state = "unresolved";
        
        CrispClient.website.changeConversationState(websiteID, sessionID, state);
    • Get Conversation Participants [user, plugin]: Reference

      • CrispClient.website.getConversationParticipants(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.getConversationParticipants(websiteID, sessionID);
    • Save Conversation Participants [user, plugin]: Reference

      • CrispClient.website.saveConversationParticipants(websiteID, sessionID, participants)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var participants = {
          "participants": [
            {
              "type": "email",
              "target": "jane.doe@acme-inc.com"
            }
          ]
        };
        
        CrispClient.website.saveConversationParticipants(websiteID, sessionID, participants);
    • Get Block Status For Conversation [user, plugin]: Reference

      • CrispClient.website.getBlockStatusForConversation(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.getBlockStatusForConversation(websiteID, sessionID);
    • Block Incoming Messages For Conversation [user, plugin]: Reference

      • CrispClient.website.blockIncomingMessagesForConversation(websiteID, sessionID, blocked)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var blocked = true;
        
        CrispClient.website.blockIncomingMessagesForConversation(websiteID, sessionID, blocked);
    • Request Email Transcript For Conversation [user, plugin]: Reference

      • CrispClient.website.requestEmailTranscriptForConversation(websiteID, sessionID, to, email)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var email = {
          "to": "operator",
          "email": "valerian@crisp.chat"
        };
        
        CrispClient.website.requestEmailTranscriptForConversation(websiteID, sessionID, to, email);
    • Request Chatbox Binding Purge For Conversation [user, plugin]: Reference

      • CrispClient.website.requestChatboxBindingPurgeForConversation(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.requestChatboxBindingPurgeForConversation(websiteID, sessionID);
    • List Browsing Sessions For Conversation [user, plugin]: Reference

      • CrispClient.website.listBrowsingSessionsForConversation(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.listBrowsingSessionsForConversation(websiteID, sessionID);
    • Initiate Browsing Session For Conversation [user, plugin]: Reference

      • CrispClient.website.initiateBrowsingSessionForConversation(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.initiateBrowsingSessionForConversation(websiteID, sessionID);
    • Send Action To An Existing Browsing Session [user, plugin]: Reference

      • CrispClient.website.sendActionToExistingBrowsingSession(websiteID, sessionID, browsingID, action)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var browsingID = "browsing_05a9392d-ff3f-45e7-b021-1179c45668fa";
        
        var action = "start";
        
        CrispClient.website.sendActionToExistingBrowsingSession(websiteID, sessionID, browsingID, action);
    • Assist Existing Browsing Session [user, plugin]: Reference

      • CrispClient.website.assistExistingBrowsingSession(websiteID, sessionID, browsingID, assist)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var browsingID = "browsing_05a9392d-ff3f-45e7-b021-1179c45668fa";
        
        var assist = {
          "action": "mouse",
          "mouse": {
            "x": 0,
            "y": 784
          }
        };
        
        CrispClient.website.assistExistingBrowsingSession(websiteID, sessionID, browsingID, assist);
    • Initiate New Call Session For Conversation [user, plugin]: Reference

      • CrispClient.website.initiateNewCallSessionForConversation(websiteID, sessionID, mode)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var mode = "audio";
        
        CrispClient.website.initiateNewCallSessionForConversation(websiteID, sessionID, mode);
    • Get Ongoing Call Session For Conversation [user, plugin]: Reference

      • CrispClient.website.getOngoingCallSessionForConversation(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.getOngoingCallSessionForConversation(websiteID, sessionID);
    • Abort Ongoing Call Session For Conversation [user, plugin]: Reference

      • CrispClient.website.abortOngoingCallSessionForConversation(websiteID, sessionID, callID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var callID = "call_35a0c062-72fa-4095-a2a0-f9911d47ee56";
        
        CrispClient.website.abortOngoingCallSessionForConversation(websiteID, sessionID, callID);
    • Transmit Signaling On Ongoing Call Session [user, plugin]: Reference

      • CrispClient.website.transmitSignalingOnOngoingCallSession(websiteID, sessionID, callID, payload)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var callID = "call_35a0c062-72fa-4095-a2a0-f9911d47ee56";
        
        var payload = {
          "type": "sdp",
          "payload": {}
        };
        
        CrispClient.website.transmitSignalingOnOngoingCallSession(websiteID, sessionID, callID, payload);
    • Deliver Widget Button Action For Conversation [user]: Reference

      • CrispClient.website.deliverWidgetButtonActionForConversation(websiteID, sessionID, pluginID, sectionID, itemID, data, value)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        var sectionID = "8f8d3041-6698-43b8-a559-ae93211e6292";
        var itemID = "7631d7d8-4fe7-4ef8-9a36-31183dcd4785";
        
        var value = {
          "section_id": "payments",
          "item_id": "refund_on_stripe",
          "data": {
            "invoice": "D-1929-X"
          }
        };
        
        CrispClient.website.deliverWidgetButtonActionForConversation(websiteID, sessionID, pluginID, sectionID, itemID, data, value);
    • Deliver Widget Data Fetch Action For Conversation [user]: Reference

      • CrispClient.website.deliverWidgetDataFetchActionForConversation(websiteID, sessionID, pluginID, sectionID, itemID, data)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        var sectionID = "8f8d3041-6698-43b8-a559-ae93211e6292";
        var itemID = "7631d7d8-4fe7-4ef8-9a36-31183dcd4785";
        
        var data = {
          "section_id": "payments",
          "item_id": "unpaid_balance",
          "action": "fetch",
          "data": {}
        };
        
        CrispClient.website.deliverWidgetDataFetchActionForConversation(websiteID, sessionID, pluginID, sectionID, itemID, data);
    • Deliver Widget Data Edit Action For Conversation [user]: Reference

      • CrispClient.website.deliverWidgetDataEditActionForConversation(websiteID, sessionID, pluginID, sectionID, itemID, value)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        var sectionID = "8f8d3041-6698-43b8-a559-ae93211e6292";
        var itemID = "7631d7d8-4fe7-4ef8-9a36-31183dcd4785";
        
        var data = {
          "section_id": "payments",
          "item_id": "unpaid_balance",
          "action": "fetch",
          "data": {}
        };
        
        CrispClient.website.deliverWidgetDataFetchActionForConversation(websiteID, sessionID, pluginID, sectionID, itemID, data);
    • Schedule A Reminder For Conversation [user, plugin]: Reference

      • CrispClient.website.scheduleReminderForConversation(websiteID, sessionID, date, note)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var note = {
          "date": "2018-05-29T09:00:00Z",
          "note": "Call this customer."
        };
        
        CrispClient.website.scheduleReminderForConversation(websiteID, sessionID, date, note);
  • Website People (these are your end-users)

    • Get People Statistics [user, plugin]: Reference

      • CrispClient.website.getPeopleStatistics(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.getPeopleStatistics(websiteID);
    • List Suggested People Segments [user, plugin]: Reference

      • CrispClient.website.listSuggestedPeopleSegments(websiteID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listSuggestedPeopleSegments(websiteID, pageNumber);
    • Delete Suggested People Segment [user, plugin]: Reference

      • CrispClient.website.deleteSuggestedPeopleSegment(websiteID, segment)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var segment = "poweruser";
        
        CrispClient.website.deleteSuggestedPeopleSegment(websiteID, segment);
    • List Suggested People Data Keys [user, plugin]: Reference

      • CrispClient.website.listSuggestedPeopleDataKeys(websiteID, pageNumber)
    • Delete Suggested People Data Key [user, plugin]: Reference

      • CrispClient.website.deleteSuggestedPeopleDataKey(websiteID, key)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var key = "price";
        
        CrispClient.website.deleteSuggestedPeopleDataKey(websiteID, key);
    • List Suggested People Events [user, plugin]: Reference

      • CrispClient.website.listSuggestedPeopleEvents(websiteID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listSuggestedPeopleEvents(websiteID, pageNumber);
    • Delete Suggested People Event [user, plugin]: Reference

      • CrispClient.website.deleteSuggestedPeopleEvent(websiteID, text)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var text = "Removed item from basket";
        
        CrispClient.website.deleteSuggestedPeopleEvent(websiteID, text);
    • ⭐ List People Profiles [user, plugin]: Reference

      • CrispClient.website.listPeopleProfiles(websiteID, pageNumber, searchField, searchOrder, searchOperator, searchFilter, searchText)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listPeopleProfiles(websiteID, pageNumber, searchField, searchOrder, searchOperator, searchFilter, searchText);
    • ⭐ Add New People Profile [user, plugin]: Reference

      • CrispClient.website.addNewPeopleProfile(websiteID, peopleProfile)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var peopleProfile = {
          "email": "valerian@crisp.chat",
          "person": {
            "nickname": "Valerian Saliou"
          }
        };
        
        CrispClient.website.addNewPeopleProfile(websiteID, peopleProfile);
    • ⭐ Check If People Profile Exists [user, plugin]: Reference

      • CrispClient.website.checkPeopleProfileExists(websiteID, peopleID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        CrispClient.website.checkPeopleProfileExists(websiteID, peopleID);
    • ⭐ Get People Profile [user, plugin]: Reference

      • CrispClient.website.getPeopleProfile(websiteID, peopleID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        CrispClient.website.getPeopleProfile(websiteID, peopleID);
    • ⭐ Save People Profile [user, plugin]: Reference

      • CrispClient.website.savePeopleProfile(websiteID, peopleID, peopleProfile)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        var peopleProfile = {
          "email": "valerian@crisp.chat",
          "person": {
            "nickname": "Valerian Saliou"
          }
        };
        
        CrispClient.website.savePeopleProfile(websiteID, peopleID, peopleProfile);
    • ⭐ Update People Profile [user, plugin]: Reference

      • CrispClient.website.updatePeopleProfile(websiteID, peopleID, peopleProfile)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        var peopleProfile = {
          "email": "valerian@crisp.chat",
          "person": {
            "nickname": "Valerian Saliou"
          }
        };
        
        CrispClient.website.updatePeopleProfile(websiteID, peopleID, peopleProfile);
    • ⭐ Remove People Profile [user, plugin]: Reference

      • CrispClient.website.removePeopleProfile(websiteID, peopleID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        CrispClient.website.removePeopleProfile(websiteID, peopleID);
    • List People Conversations [user, plugin]: Reference

      • CrispClient.website.listPeopleConversations(websiteID, peopleID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        var pageNumber = 1;
        
        CrispClient.website.listPeopleConversations(websiteID, peopleID, pageNumber);
    • List People Campaigns [user]: Reference

      • CrispClient.website.listPeopleCampaigns(websiteID, peopleID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        var pageNumber = 1;
        
        CrispClient.website.listPeopleCampaigns(websiteID, peopleID, pageNumber);
    • Add A People Event [user, plugin]: Reference

      • CrispClient.website.addPeopleEvent(websiteID, peopleID, peopleEvent)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        var peopleEvent = {
          "text": "Added item to basket",
          "data": {
            "price": 10.99,
            "currency": "USD"
          },
          "color": "red"
        };
        
        CrispClient.website.addPeopleEvent(websiteID, peopleID, peopleEvent);
    • List People Events [user, plugin]: Reference

      • CrispClient.website.listPeopleEvents(websiteID, peopleID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        var pageNumber = 1;
        
        CrispClient.website.listPeopleEvents(websiteID, peopleID, pageNumber);
    • Get People Data [user, plugin]: Reference

      • CrispClient.website.getPeopleData(websiteID, peopleID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        CrispClient.website.getPeopleData(websiteID, peopleID);
    • Save People Data [user, plugin]: Reference

      • CrispClient.website.savePeopleData(websiteID, peopleID, peopleData)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        var peopleData = {
          "data": {
            "type": "customer",
            "signup": "finished"
          }
        };
        
        CrispClient.website.savePeopleData(websiteID, peopleID, peopleData);
    • Update People Data [user, plugin]: Reference

      • CrispClient.website.updatePeopleData(websiteID, peopleID, peopleData)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        var peopleData = {
          "data": {
            "signup": "finished"
          }
        };
        
        CrispClient.website.updatePeopleData(websiteID, peopleID, peopleData);
    • Get People Subscription Status [user, plugin]: Reference

      • CrispClient.website.getPeopleSubscriptionStatus(websiteID, peopleID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        CrispClient.website.getPeopleSubscriptionStatus(websiteID, peopleID);
    • Update People Subscription Status [user, plugin]: Reference

      • CrispClient.website.updatePeopleSubscriptionStatus(websiteID, peopleID, peopleSubscription)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var peopleID = "c5a2f70c-f605-4648-b47f-8c39d4b03a50";
        
        var peopleSubscription = {
          "email": true
        };
        
        CrispClient.website.updatePeopleSubscriptionStatus(websiteID, peopleID, peopleSubscription);
    • Export People Profiles [user]: Reference

      • CrispClient.website.exportPeopleProfiles(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.exportPeopleProfiles(websiteID);
    • Import People Profiles [user]: Reference

      • CrispClient.website.importPeopleProfiles(websiteID, profileImportSetup)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var profileImportSetup = {
          "url": "https://storage.crisp.chat/users/processing/import/aa0b64dd-9fb4-4db9-80d6-5a49eb84087b/19d956c7-0294-45ad-89e1-58ce45e7008f.csv",
          "mapping": [
            {
              "column": 1,
              "field": "email"
            },
            {
              "column": 2,
              "field": "person.nickname"
            }
          ],
          "options": {
            "column_separator": ";",
            "skip_header": true
          }
        };
        
        CrispClient.website.importPeopleProfiles(websiteID, profileImportSetup);

👉 Notice: The peopleID argument can be an email or the peopleID.

  • Website Base

    • Check If Website Exists [user, plugin]: Reference

      • CrispClient.website.checkWebsiteExists(domain)

      • See Example
        CrispClient.website.checkWebsiteExists(domain);
    • Create Website [user]: Reference

      • CrispClient.website.createWebsite(websiteData)

      • See Example
        CrispClient.website.createWebsite(websiteData);
    • Get A Website [user, plugin]: Reference

      • CrispClient.website.getWebsite(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.getWebsite(websiteID);
    • Delete A Website [user]: Reference

      • CrispClient.website.deleteWebsite(websiteID, verify)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var verify = "MySuperSecurePassword";
        
        CrispClient.website.deleteWebsite(websiteID, verify);
  • Website Settings

    • Get Website Settings [user, plugin]: Reference

      • CrispClient.website.getWebsiteSettings(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.getWebsiteSettings(websiteID);
    • Update Website Settings [user, plugin]: Reference

      • CrispClient.website.updateWebsiteSettings(websiteID, settings)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var settings = {
          "name": "Crisp",
          "domain": "crisp.chat",
          "logo": "https://storage.crisp.chat/users/avatar/website/8c842203-7ed8-4e29-a608-7cf78a7d2fcc/b6c2948d-b061-405e-91a9-2fdf855d1cc0.png",
          "contact": {
            "email": "contact@crisp.chat",
            "phone": "+33757905447"
          },
          "inbox": {
            "lock_removal": false,
            "force_operator_token": false
          },
          "emails": {
            "rating": true,
            "transcript": true,
            "enrich": true,
            "junk_filter": true
          },
          "chatbox": {
            "tile": "default",
            "wait_game": false,
            "last_operator_face": false,
            "ongoing_operator_face": true,
            "activity_metrics": true,
            "operator_privacy": false,
            "availability_tooltip": true,
            "hide_vacation": false,
            "hide_on_away": false,
            "hide_on_mobile": false,
            "position_reverse": false,
            "email_visitors": false,
            "phone_visitors": false,
            "force_identify": false,
            "ignore_privacy": false,
            "visitor_compose": false,
            "file_transfer": true,
            "helpdesk_link": true,
            "status_health_dead": true,
            "check_domain": false,
            "color_theme": "blue",
            "text_theme": "default",
            "welcome_message": "default",
            "locale": "en",
            "allowed_pages": [],
            "blocked_pages": [
              "status/*/",
              "docs.crisp.chat/*",
              "crisp.chat/terms/",
              "https://crisp.chat/privacy/"
            ],
            "blocked_countries": [
              "IT"
            ],
            "blocked_locales": [
              "fa",
              "he"
            ],
            "blocked_ips": [
              "8.8.8.8",
              "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
              "192.168.1.1/24"
            ]
          }
        };
        
        CrispClient.website.updateWebsiteSettings(websiteID, settings);
  • Website Operator

    • List Website Operators [user, plugin]: Reference

      • CrispClient.website.listWebsiteOperators(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.listWebsiteOperators(websiteID);
    • List Last Active Website Operators [user, plugin]: Reference

      • CrispClient.website.listLastActiveWebsiteOperators(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.listLastActiveWebsiteOperators(websiteID);
    • Flush Last Active Website Operators [user]: Reference

      • CrispClient.website.flushLastActiveWebsiteOperators(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.flushLastActiveWebsiteOperators(websiteID);
    • Send Email To Website Operators [user, plugin]: Reference

      • CrispClient.website.sendEmailToWebsiteOperators(websiteID, emailData)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var emailData = {
          "recipient": "owners",
          "subject": "Plugin limits reached",
          "message": "Hi, you've reached the Slack plugin limits. Please contact our support team."
        };
        
        CrispClient.website.sendEmailToWebsiteOperators(websiteID, emailData);
    • Get A Website Operator [user, plugin]: Reference

      • CrispClient.website.getWebsiteOperator(websiteID, userID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var userID = "a4c32c68-be91-4e29-8a05-976e93abbe3f";
        
        CrispClient.website.getWebsiteOperator(websiteID, userID);
    • Invite A Website Operator [user]: Reference

      • CrispClient.website.inviteWebsiteOperator(websiteID, email, role, verify)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var verify = {
          "email": "julien@crisp.chat",
          "role": "member",
          "verify": "MySuperSecurePassword"
        };
        
        CrispClient.website.inviteWebsiteOperator(websiteID, email, role, verify);
    • Change Operator Membership [user]: Reference

      • CrispClient.website.changeOperatorMembership(websiteID, userID, role, title)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var userID = "a4c32c68-be91-4e29-8a05-976e93abbe3f";
        
        var title = {
          "role": "owner",
          "title": "CTO"
        };
        
        CrispClient.website.changeOperatorMembership(websiteID, userID, role, title);
    • Unlink Operator From Website [user]: Reference

      • CrispClient.website.unlinkOperatorFromWebsite(websiteID, userID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var userID = "a4c32c68-be91-4e29-8a05-976e93abbe3f";
        
        CrispClient.website.unlinkOperatorFromWebsite(websiteID, userID);
  • Website Visitors

    • Count Visitors [user, plugin]: Reference

      • CrispClient.website.countVisitors(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.countVisitors(websiteID);
    • List Visitors [user, plugin]: Reference

      • CrispClient.website.listVisitors(websiteID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listVisitors(websiteID, pageNumber);
    • Pinpoint Visitors On A Map [user, plugin]: Reference

      • CrispClient.website.pinpointVisitorsOnMap(websiteID, centerLongitude, centerLatitude, centerRadius)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.pinpointVisitorsOnMap(websiteID, centerLongitude, centerLatitude, centerRadius);
    • Get Session Identifier From Token [user, plugin]: Reference

      • CrispClient.website.getSessionIdentifierFromToken(websiteID, tokenID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var tokenID = "d3c17241-1327-47d7-9d8e-b89ff7bd2904";
        
        CrispClient.website.getSessionIdentifierFromToken(websiteID, tokenID);
    • Count Blocked Visitors [user]: Reference

      • CrispClient.website.countBlockedVisitors(websiteID)
    • Count Blocked Visitors In Rule [user]: Reference

      • CrispClient.website.countBlockedVisitorsInRule(websiteID, rule)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.countBlockedVisitorsInRule(websiteID, rule);
    • Clear Blocked Visitors In Rule [user]: Reference

      • CrispClient.website.clearBlockedVisitorsInRule(websiteID, rule)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.clearBlockedVisitorsInRule(websiteID, rule);
  • Website Availability

    • Get Website Availability Status [user, plugin]: Reference

      • CrispClient.website.getWebsiteAvailabilityStatus(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.getWebsiteAvailabilityStatus(websiteID);
    • List Website Operator Availabilities [user, plugin]: Reference

      • CrispClient.website.listWebsiteOperatorAvailabilities(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.listWebsiteOperatorAvailabilities(websiteID);
  • Website Analytics

    • Acquire Analytics Points [user]: Reference

      • CrispClient.website.acquireAnalyticsPoints(websiteID, pointType, pointMetric, dateFrom, dateTo, dateSplit, classifier, filterPrimary, filterSecondary, filterTertiary)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.acquireAnalyticsPoints(websiteID, pointType, pointMetric, dateFrom, dateTo, dateSplit, classifier, filterPrimary, filterSecondary, filterTertiary);
    • List Analytics Filters [user]: Reference

      • CrispClient.website.listAnalyticsFilters(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listAnalyticsFilters(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo);
    • List Analytics Classifiers [user]: Reference

      • CrispClient.website.listAnalyticsClassifiers(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listAnalyticsClassifiers(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo);
  • Website Batch

    • Batch Resolve Conversations [user]: Reference

      • CrispClient.website.batchResolveConversations(websiteID, sessions)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.batchResolveConversations(websiteID, sessions);
    • Batch Read Conversations [user]: Reference

      • CrispClient.website.batchReadConversations(websiteID, sessions)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.batchReadConversations(websiteID, sessions);
    • Batch Remove Conversations [user]: Reference

      • CrispClient.website.batchRemoveConversations(websiteID, sessions)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var sessions = [
          "session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
          "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
        ];
        
        CrispClient.website.batchRemoveConversations(websiteID, sessions);
    • Batch Remove People [user]: Reference

      • CrispClient.website.batchRemovePeople(websiteID, people)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var sessions = [
          "session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
          "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
        ];
        
        CrispClient.website.batchRemoveConversations(websiteID, sessions);
  • Website Verify

    • Get Verify Settings [user, plugin]: Reference

      • CrispClient.website.getVerifySettings(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.getVerifySettings(websiteID);
    • Update Verify Settings [user, plugin]: Reference

      • CrispClient.website.updateVerifySettings(websiteID, settings)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var settings = {
          "enabled": true
        };
        
        CrispClient.website.updateVerifySettings(websiteID, settings);
    • Get Verify Key [user, plugin]: Reference

      • CrispClient.website.getVerifyKey(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.getVerifyKey(websiteID);
    • Roll Verify Key [user, plugin]: Reference

      • CrispClient.website.rollVerifyKey(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.rollVerifyKey(websiteID);
  • Website Campaigns

    • List Campaigns [user]: Reference

      • CrispClient.website.listCampaigns(websiteID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listCampaigns(websiteID, pageNumber);
    • List Campaign Tags [user]: Reference

      • CrispClient.website.listCampaignTags(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.website.listCampaignTags(websiteID);
    • List Campaign Templates [user]: Reference

      • CrispClient.website.listCampaignTemplates(websiteID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pageNumber = 1;
        
        CrispClient.website.listCampaignTemplates(websiteID, pageNumber);
    • Create A New Campaign Template [user]: Reference

      • CrispClient.website.createNewCampaignTemplate(websiteID, templateFormat, templateName)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var templateName = {
          "name": "HTML Template",
          "format": "html"
        };
        
        CrispClient.website.createNewCampaignTemplate(websiteID, templateFormat, templateName);
    • Check If Campaign Template Exists [user]: Reference

      • CrispClient.website.checkCampaignTemplateExists(websiteID, templateID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var templateID = "a4876300-4dae-47f7-8599-3bf9283f36c2";
        
        CrispClient.website.checkCampaignTemplateExists(websiteID, templateID);
    • Get A Campaign Template [user]: Reference

      • CrispClient.website.getCampaignTemplate(websiteID, templateID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var templateID = "a4876300-4dae-47f7-8599-3bf9283f36c2";
        
        CrispClient.website.getCampaignTemplate(websiteID, templateID);
    • Save A Campaign Template [user]: Reference

      • CrispClient.website.saveCampaignTemplate(websiteID, templateID, template)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var templateID = "a4876300-4dae-47f7-8599-3bf9283f36c2";
        
        var template = {
          "name": "HTML Template",
          "format": "html",
          "content": "<html><body><a href=\"{{url.unsubscribe}}\"></a></body></html>"
        };
        
        CrispClient.website.saveCampaignTemplate(websiteID, templateID, template);
    • Update A Campaign Template [user]: Reference

      • CrispClient.website.updateCampaignTemplate(websiteID, templateID, template)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var templateID = "a4876300-4dae-47f7-8599-3bf9283f36c2";
        
        var template = "<html><body><a href=\"{{url.unsubscribe}}\"></a></body></html>";
        
        CrispClient.website.updateCampaignTemplate(websiteID, templateID, template);
    • Remove A Campaign Template [user]: Reference

      • CrispClient.website.removeCampaignTemplate(websiteID, templateID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var templateID = "a4876300-4dae-47f7-8599-3bf9283f36c2";
        
        CrispClient.website.removeCampaignTemplate(websiteID, templateID);
  • Website Campaign

    • Create A New Campaign [user]: Reference

      • CrispClient.website.createNewCampaign(websiteID, campaignType, campaignName)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        var campaignName = {
          "type": "one-shot",
          "name": "Welcome!"
        };
        
        CrispClient.website.createNewCampaign(websiteID, campaignType, campaignName);
    • Check If Campaign Exists [user]: Reference

      • CrispClient.website.checkCampaignExists(websiteID, campaignID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        
        CrispClient.website.checkCampaignExists(websiteID, campaignID);
    • Get A Campaign [user]: Reference

      • CrispClient.website.getCampaign(websiteID, campaignID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        
        CrispClient.website.getCampaign(websiteID, campaignID);
    • Save A Campaign [user]: Reference

      • CrispClient.website.saveCampaign(websiteID, campaignID, campaign)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        
        var campaign = {
          "type": "one-shot",
          "format": "markdown",
          "name": "Welcome!",
          "sender": {
            "user_id": "aa0b64dd-9fb4-4db9-80d6-5a49eb84087b"
          },
          "recipients": {
            "type": "all"
          },
          "message": "*Hey there*, welcome on Crisp!",
          "options": {
            "deliver_to_chatbox": true,
            "deliver_to_email": true,
            "sender_name_website": false,
            "sender_email_reply": null,
            "tracking": true
          }
        };
        
        CrispClient.website.saveCampaign(websiteID, campaignID, campaign);
    • Update A Campaign [user]: Reference

      • CrispClient.website.updateCampaign(websiteID, campaignID, campaign)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        
        var campaign = {
          "message": "*Hey there*, welcome on Crisp folks!"
        };
        
        CrispClient.website.updateCampaign(websiteID, campaignID, campaign);
    • Remove A Campaign [user]: Reference

      • CrispClient.website.removeCampaign(websiteID, campaignID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        
        CrispClient.website.removeCampaign(websiteID, campaignID);
    • Dispatch A Campaign [user]: Reference

      • CrispClient.website.dispatchCampaign(websiteID, campaignID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        
        CrispClient.website.dispatchCampaign(websiteID, campaignID);
    • Resume A Campaign [user]: Reference

      • CrispClient.website.resumeCampaign(websiteID, campaignID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        
        CrispClient.website.resumeCampaign(websiteID, campaignID);
    • Pause A Campaign [user]: Reference

      • CrispClient.website.pauseCampaign(websiteID, campaignID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        
        CrispClient.website.pauseCampaign(websiteID, campaignID);
    • Test A Campaign [user]: Reference

      • CrispClient.website.testCampaign(websiteID, campaignID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        
        CrispClient.website.testCampaign(websiteID, campaignID);
    • List Campaign Recipients [user]: Reference

      • CrispClient.website.listCampaignRecipients(websiteID, campaignID, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        var pageNumber = 1;
        
        CrispClient.website.listCampaignRecipients(websiteID, campaignID, pageNumber);
    • List Campaign Statistics [user]: Reference

      • CrispClient.website.listCampaignStatistics(websiteID, campaignID, action, pageNumber)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var campaignID = "355d805f-a72f-457e-a3e5-5d01521f3cd8";
        var pageNumber = 1;
        
        CrispClient.website.listCampaignStatistics(websiteID, campaignID, action, pageNumber);

Plugin

  • Plugin Connect

    • ⭐ Get Connect Account [user, plugin]: Reference

      • CrispClient.plugin.getConnectAccount()

      • See Example
        CrispClient.plugin.getConnectAccount();
    • ⭐ Check Connect Session Validity [user, plugin]: Reference

      • CrispClient.plugin.checkConnectSessionValidity()

      • See Example
        CrispClient.plugin.checkConnectSessionValidity();
    • ⭐ List All Connect Websites [user, plugin]: Reference

      • CrispClient.plugin.listAllConnectWebsites(pageNumber, filterConfigured, dateSince)

      • See Example
        var pageNumber = 1;
        
        CrispClient.plugin.listAllConnectWebsites(pageNumber, filterConfigured, dateSince);
  • Plugin Subscription

    • List All Active Subscriptions [user]: Reference

      • CrispClient.plugin.listAllActiveSubscriptions()

      • See Example
        CrispClient.plugin.listAllActiveSubscriptions();
    • List Subscriptions For A Website [user]: Reference

      • CrispClient.plugin.listSubscriptionsForWebsite(websiteID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        
        CrispClient.plugin.listSubscriptionsForWebsite(websiteID);
    • Get Subscription Details [user]: Reference

      • CrispClient.plugin.getSubscriptionDetails(websiteID, pluginID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        
        CrispClient.plugin.getSubscriptionDetails(websiteID, pluginID);
    • Subscribe Website To Plugin [user]: Reference

      • CrispClient.plugin.subscribeWebsiteToPlugin(websiteID, pluginID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        
        var pluginID = "98454664-9f7d-4d95-a9ce-f37356f5e65a";
        
        CrispClient.plugin.subscribeWebsiteToPlugin(websiteID, pluginID);
    • Unsubscribe Plugin From Website [user]: Reference

      • CrispClient.plugin.unsubscribePluginFromWebsite(websiteID, pluginID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        
        CrispClient.plugin.unsubscribePluginFromWebsite(websiteID, pluginID);
    • Get Subscription Settings [user, plugin]: Reference

      • CrispClient.plugin.getSubscriptionSettings(websiteID, pluginID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        
        CrispClient.plugin.getSubscriptionSettings(websiteID, pluginID);
    • Save Subscription Settings [user, plugin]: Reference

      • CrispClient.plugin.saveSubscriptionSettings(websiteID, pluginID, settings)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        
        var settings = {
          "chatbox": {
            "25": "#bbbbbb"
          }
        };
        
        CrispClient.plugin.saveSubscriptionSettings(websiteID, pluginID, settings);
    • Update Subscription Settings [user, plugin]: Reference

      • CrispClient.plugin.updateSubscriptionSettings(websiteID, pluginID, settings)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        
        var settings = {
          "chatbox": {
            "25": "#bbbbbb"
          }
        };
        
        CrispClient.plugin.updateSubscriptionSettings(websiteID, pluginID, settings);
    • Forward Plugin Payload To Channel [user, plugin]: Reference

      • CrispClient.plugin.forwardPluginPayloadToChannel(websiteID, pluginID, payload)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        
        var payload = {
          "namespace": "bot:step",
          "payload": {
            "step": 1
          }
        };
        
        CrispClient.plugin.forwardPluginPayloadToChannel(websiteID, pluginID, payload);
    • Dispatch Plugin Event [user, plugin]: Reference

      • CrispClient.plugin.dispatchPluginEvent(websiteID, pluginID, payload)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
        
        var payload = {
          "name": "bot-is-running",
          "data": {
            "bot": "Sales",
            "email": "valerian@crisp.chat"
          }
        };
        
        CrispClient.plugin.dispatchPluginEvent(websiteID, pluginID, payload);

Media

  • Media Animation

    • List Animation Medias [user]: Reference
      • CrispClient.media.listAnimationMedias(pageNumber, listID, searchQuery)

      • See Example
        var listID = "f7fb43da-1cd8-49c1-ade0-9f5b71d034e3";
        var pageNumber = 1;
        
        CrispClient.media.listAnimationMedias(pageNumber, listID, searchQuery);

Bucket

  • Bucket URL

    • Generate Bucket URL [user, plugin]: Reference
      • CrispClient.bucket.generateBucketURL(data)

      • See Example
        CrispClient.bucket.generateBucketURL(data);

Realtime Events

You can bind to realtime events from Crisp, in order to get notified of incoming messages and updates in websites.

You won't receive any event if you don't explicitly subscribe to realtime events using CrispClient.on(), as the library doesn't connect to the realtime backend automatically.

Available events are listed below:

  • Session Events: Reference

    • Session Update Availability [user, plugin]:
      • session:update_availability
    • Session Update Verify [user, plugin]:
      • session:update_verify
    • Session Request Initiated [user, plugin]:
      • session:request:initiated
    • Session Set Email [user, plugin]:
      • session:set_email
    • Session Set Phone [user, plugin]:
      • session:set_phone
    • Session Set Address [user, plugin]:
      • session:set_address
    • Session Set Avatar [user, plugin]:
      • session:set_avatar
    • Session Set Nickname [user, plugin]:
      • session:set_nickname
    • Session Set Data [user, plugin]:
      • session:set_data
    • Session Sync Pages [user, plugin]:
      • session:sync:pages
    • Session Sync Events [user, plugin]:
      • session:sync:events
    • Session Sync Capabilities [user, plugin]:
      • session:sync:capabilities
    • Session Sync Geolocation [user, plugin]:
      • session:sync:geolocation
    • Session Sync System [user, plugin]:
      • session:sync:system
    • Session Sync Network [user, plugin]:
      • session:sync:network
    • Session Sync Timezone [user, plugin]:
      • session:sync:timezone
    • Session Sync Locales [user, plugin]:
      • session:sync:locales
    • Session Sync Rating [user, plugin]:
      • session:sync:rating
    • Session Set State [user, plugin]:
      • session:set_state
    • Session Set Block [user, plugin]:
      • session:set_block
    • Session Set Segments [user, plugin]:
      • session:set_segments
    • Session Set Opened [user, plugin]:
      • session:set_opened
    • Session Set Closed [user, plugin]:
      • session:set_closed
    • Session Set Participants [user, plugin]:
      • session:set_participants
    • Session Set Mentions [user, plugin]:
      • session:set_mentions
    • Session Set Routing [user, plugin]:
      • session:set_routing
    • Session Removed [user, plugin]:
      • session:removed
  • Message Events: Reference

    • Message Updated [user, plugin]:
      • message:updated
    • Message Send [user, plugin]:
      • message:send
    • Message Received [user, plugin]:
      • message:received
    • Message Compose Send [user, plugin]:
      • message:compose:send
    • Message Compose Receive [user, plugin]:
      • message:compose:receive
    • Message Acknowledge Read Send [user, plugin]:
      • message:acknowledge:read:send
    • Message Acknowledge Read Received [user, plugin]:
      • message:acknowledge:read:received
    • Message Acknowledge Delivered [user, plugin]:
      • message:acknowledge:delivered
    • Message Notify Unread Send [user, plugin]:
      • message:notify:unread:send
    • Message Notify Unread Received [user, plugin]:
      • message:notify:unread:received
  • People Events: Reference

    • People Profile Created [user, plugin]:
      • people:profile:created
    • People Profile Updated [user, plugin]:
      • people:profile:updated
    • People Profile Removed [user, plugin]:
      • people:profile:removed
    • People Bind Session [user, plugin]:
      • people:bind:session
    • People Sync Profile [user, plugin]:
      • people:sync:profile
    • People Import Progress [user]:
      • people:import:progress
    • People Import Done [user]:
      • people:import:done
  • Campaign Events: Reference

    • Campaign Progress [user]:
      • campaign:progress
    • Campaign Dispatched [user]:
      • campaign:dispatched
    • Campaign Running [user]:
      • campaign:running
  • Browsing Events: Reference

    • Browsing Request Initiated [user, plugin]:
      • browsing:request:initiated
    • Browsing Request Rejected [user, plugin]:
      • browsing:request:rejected
  • Call Events: Reference

    • Call Request Initiated [user, plugin]:
      • call:request:initiated
    • Call Request Rejected [user, plugin]:
      • call:request:rejected
  • Widget Events: Reference

    • Widget Action Processed [user]:
      • widget:action:processed
  • Status Events: Reference

    • Status Health Changed [user]:
      • status:health:changed
  • Website Events: Reference

    • Website Update Visitors Count [user, plugin]:
      • website:update_visitors_count
    • Website Update Operators Availability [user, plugin]:
      • website:update_operators_availability
    • Website Users Available [user, plugin]:
      • website:users:available
  • Bucket Events: Reference

    • Bucket URL Upload Generated [user, plugin]:
      • bucket:url:upload:generated
    • Bucket URL Avatar Generated [user, plugin]:
      • bucket:url:avatar:generated
    • Bucket URL Website Generated [user, plugin]:
      • bucket:url:website:generated
    • Bucket URL Campaign Generated [user, plugin]:
      • bucket:url:campaign:generated
    • Bucket URL Helpdesk Generated [user, plugin]:
      • bucket:url:helpdesk:generated
    • Bucket URL Status Generated [user, plugin]:
      • bucket:url:status:generated
    • Bucket URL Processing Generated [user, plugin]:
      • bucket:url:processing:generated
  • Media Events: Reference

    • Media Animation Listed [user]:
      • media:animation:listed
  • Email Events: Reference

    • Email Subscribe [user, plugin]:
      • email:subscribe
    • Email Track View [user, plugin]:
      • email:track:view
  • Plugin Events: Reference

    • Plugin Channel [user, plugin]:
      • plugin:channel
    • Plugin Event [user, plugin]:
      • plugin:event
    • Plugin Settings Saved [user, plugin]:
      • plugin:settings:saved