1.1.6 • Published 2 years ago
intelli-chat-sdk v1.1.6
Intellicon chat sdk for accessing Intellicon Chat (for ECMAScript supported environments only)
Install
npm install intelli-chat-sdk
| yarn add intelli-chat-sdk
then import into your file
import sdk from 'intelli-chat-sdk'
Following actions are available to interact with Intellicon chat with their arguments and details
Connect with Intellicon Server using
sdk.connect(user, token, callback); user = An object having (unique) id and name of customer token = token string (can get using provided API) callback = function with two arguments `event` and `data` that will called whenever any defined event occured
To get user interactions
sdk.getUserInteractions(offset); offset = how many conversations you want to skip or already loaded
Create a new to Intellicon chat
sdk.newInteraction(message, type); - if `message` is simple text than `type` is text - if `message` is (publically accessible) media URL than `type` can be 'image'|'audio'|'document'|'video'
Send a message to Intellicon chat
sdk.sendMessage(interactionId, message, type); - interactionId = _id in interaction object - if `message` is simple text than `type` is text - if `message` is (publically accessible) media URL than `type` can be 'image'|'audio'|'document'|'video'
Get messages of an interaction
sdk.getMessages(interactionId, offset); - interactionId = _id in interaction object - offset = how many messages you want to skip or already loaded
Close an interaction
sdk.closeInteraction(interactionId); - interactionId = _id in interaction object