Skip to content

crisp-im/node-crisp-api

Repository files navigation

Crisp API Wrapper

Test and Build Build and Release Version Downloads

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

Copyright 2023 Crisp IM SAS. 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);
    });
})
  .then(function() {
    console.error("Requested to listen to sent messages");
  })
  .catch(function(error) {
    console.error("Failed listening to sent messages:", 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.


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);
    • Remove A Message In Conversation [user, plugin]: Reference

      • CrispClient.website.removeMessageInConversation(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.removeMessageInConversation(websiteID, sessionID, fingerprint);
    • 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);
    • List Conversation Files [user, plugin]: Reference

      • CrispClient.website.listConversationFiles(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.listConversationFiles(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);
    • Get Verify Status For Conversation [user, plugin]: Reference

      • CrispClient.website.getVerifyStatusForConversation(websiteID, sessionID)

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

      • CrispClient.website.updateVerifyStatusForConversation(websiteID, sessionID, verified)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        var verified = true;
        
        CrispClient.website.updateVerifyStatusForConversation(websiteID, sessionID, verified);
    • 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);
    • Request User Feedback For Conversation [user, plugin]: Reference

      • CrispClient.website.requestUserFeedbackForConversation(websiteID, sessionID)

      • See Example
        var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
        var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
        
        CrispClient.website.requestUserFeedbackForConversation(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(