# intellicon-interaction-manager

> ### Install

Latest version **1.1.6** (published 2024-07-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install intellicon-interaction-manager
pnpm add intellicon-interaction-manager
yarn add intellicon-interaction-manager
bun add intellicon-interaction-manager
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2024-07-05 |
| First published | 2020-10-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 84.2 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | M.Jaffer |
| Maintainers | jafferkazmi572 |

## Links

- npm: https://www.npmjs.com/package/intellicon-interaction-manager
- npm.io page: https://npm.io/package/intellicon-interaction-manager

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.20.0

## Recent versions

- 1.1.6 (latest) — 2024-07-05
- 1.1.5 — 2024-07-05
- 1.1.4 — 2022-11-30
- 1.1.3 — 2022-10-11
- 1.1.2 — 2022-09-28
- 1.1.1 — 2022-05-27
- 1.1.0 — 2022-05-23
- 1.0.69 — 2022-05-11
- 1.0.68 — 2022-01-25
- 1.0.67 — 2022-01-20
- 1.0.66 — 2022-01-20
- 1.0.65 — 2022-01-19
- 1.0.64 — 2022-01-19
- 1.0.63 — 2022-01-18
- 1.0.62 — 2022-01-18
- … 62 more at https://npm.io/package/intellicon-interaction-manager/versions

## README

## Interaction Manager Package for accessing Intellicon Chat internally

### Install

`npm install intellicon-interaction-manager`

##### then import into your file

    const ichat = require('intellicon-interaction-manager');
    
                            OR
                            
     import ichat from 'intellicon-interaction-manager'  //ES6

connect with Intellicon Interaction Manager using

`ichat.init(Auth Token , Base URL of Interaction Manager);`

**Auth Token is the accessing Token which is provided to access Intellicon Service**

**Base url is the Intellicon server path**

Following events are available to interact with Intellicon chat with their arguments and details

     message={
     interactionId, (required)
      author: {
        id, (required)
        name
     },
     channelMessageId, 
     message,
     messageType,  (required)
     forwarded,
     isChild,
     parentId,
     direction,
     recipient,  (required)
     extension,  (required)
     chennel,    (required)
     attachments: [   // if available
         {
            type,  // e.g. image,video,document etc
            data // object that contains data about attachment like image should have a url
         },
         ....
     ],
     extraPayload:{} //if available
    }
    
    ichat.sendMessage(message)

*********************************

    message={
     interactionId, (required)
      author: {
        id, (required)
        name
     },
     message  (required and should be valid JSON string),
     messageType,  (required and should be `template`)
     forwarded,
     isChild,
     parentId,
     direction,  (required should be 1)
     recipient,  (required)
     extension,  (required)
     chennel,    (required)
     extraPayload:{
        preview:  (required)
     } 
    }
    
    ichat.sendTemplateMessage(message)

*********************************

    interaction={
       caller:{ 
         id, (required)
         name
       },
       participants: [{
         id,  (required)
         name,  (required)
         role,  (required)
         joinDtTime,  (required)
         leaveDtTime:, (required if participant is leaving)
         status  (required)
       }],
       extension, (required if interaction is inbound)
       status,  (required)
       created: {
        year,   (required if interaction is inbound)
        month,  (required if interaction is inbound)
        day,    (required if interaction is inbound)
        hour,   (required if interaction is inbound) 
        minutes (required if interaction is inbound)
      },
      direction, (required)
      channel, (required)
      campaign: { id , name }
    }
    
    ichat.createInteraction(interaction)

*********************************

        interactionId, // _id of interaction (required)
        extension, // page id/account id/whatsapp number on which interaction arrived (required)
        chennel, // chennal like facebook,whatsapp etc (required)
        
        ichat.generatePublicURL(interactionId,extension,channel)

*********************************

        interactionId, // _id of interaction (required)
        data, // An object having data to be updated  (required)
        
        ichat.updateInteraction(interactionId,data)

*********************************

        interactionId, // _id of interaction (required)
        data, // An object having complete object of contact  (required)
        
        ichat.updateInteractionContact(interactionId,data)

*********************************

        id, // For whom you want history (required)
        args, // An object having any filters like channels etc
        
        ichat.findInteractionHistory(id,args)

*********************************

        interactionId, // _id of interaction (required)
        agentId, // id of agent who is opening the interaction
        agentName, // Name of agent who is opening the interaction
        
        ichat.reopenInteraction(interactionId,agentId,agentName)

*********************************

    interactionId, // _id of interaction (required)
    participants: [
        {
         id, (required)
         name, (required)
         role, (required)
         joinDtTime, (required)
         status (required)
        },
        {
        ...
        }
        ...
    ],
     
    ichat.addParticipants(interactionId, participants)

*********************************

    interactionId, // _id of interaction (required)
    
    ichat.findInteraction(interactionId)

*********************************

    filter, // filter object to be applied for finding interactions (required)
    offset, // number of interactions you want to skip (required)
    
    ichat.findInteractions(filter, offset)

*********************************

         id, // User's id whose open interatcions are going to find  (required)
         args, Object having filter like role etc(required if role is agent) 
         
         ichat.findOpenInteractions(id,args)

********************************

         id, // User's id whose open interatcions are going to find  (required)
         args, Object having filter like role etc(required if role is agent) 
         
         ichat.findOpenInteractionsChannelGroup(id,args)

********************************

         id, // User's id whose open interatcions are going to find  (required)
         channel, // For what channel interactions is going to find (required)
         args, Object having filter like role etc(required if role is agent) 
         
         ichat.findChannelOpenInteractions(id,channel,args)

*********************************

         query, // keyword for searching  (required)
         offset, // How many search results you have already loaded or want to skip
         
         ichat.searchInteractions(query,offset)

*********************************

         query, // keyword for searching  (required)
         offset, // How many search results you have already loaded or want to skip
         
         ichat.searchMessages(query,offset)

*********************************

         query, // keyword for searching  (required)
         offset, // How many search results you have already loaded or want to skip
         
         ichat.searchComments(query,offset)

*********************************

         interactionId, // _id of interaction  (required)
         interactionType, // Is it a Chat based interaction or comment based (required)
         
         ichat.viewSearchedInteraction(interactionId,interactionType)

*********************************

         interactionId, // _id of interaction  (required)
         messageId, // _id of message
         date, // createdAt of message
         
         ichat.viewSearchedMessageInteraction(interactionId,messageId,date)

*********************************

         interactionId, // _id of interaction  (required)
         commentId, // _id of comment
         date, // createdAt of comment
         
         ichat.viewSearchedCommentInteraction(interactionId,CommentId,date)

 *********************************

          id, // Agent's id whose open interatcions are ignored while finding  (required)
          offset, // number that skips the interactions   (required)
                  
          ichat.sharedInbox(id,offset)

********************************

          id, // Agent's id whose open interatcions are ignored while finding  (required)
          offset, // number that skips the interactions   (required) 
         
         ichat.sharedInboxChannelGroup(id,offset)

********************************

         id, // Agent's id whose open interatcions are ignored while finding  (required)
         channel, // For what channel interactions is going to find (required)
         offset, // number that skips the interactions   (required)  
         
         ichat.channelSharedInbox(id,channel,offset)

*********************************

    interactionId, // _id of interaction (required)
    participany:{
       id, (required)
       name, (required)
       role, (required)
       joinDtTime, (required)
       leaveDtTime:, (required if participant is leaving)
       status (required)
    }
    
    ichat.updatePartcipant(interactionId, participant)

*********************************

    interactoinId, // _id of interaction   (required)
    participantId, //Id of participant who is going to be removed  (required)
    
    ichat.removeParticipant(interactionId, participantId)

*********************************

    interactionId, // _id of interaction (required)
    ichat.closeInteraction(interactionId)

*********************************

    interactionId, // _id of interaction (required)
    ichat.wrapUpInteraction(interactionId)

*********************************

    interactionId, // _id of Interaction  (required)
    workCode:{
        id, (required)
        name, (required)
        description,
        category
    }
    
    ichat.addWorkCode(interactionId, workCode)

*********************************

    interatcionId, // _id of Interaction  (required)
     workCodeId, //Id of Work Code which is going to be removed  (required)
     
    ichat.removeWorkCode(interactionId, workCodeId)

*********************************

    interactionId, // _id of Interaction   (required)
    notes // Text of notes that you wants to update
                  
    ichat.postNotes(interactionId, notes)

*********************************

    interactionId, // _id of Interaction   (required)
    offset, //How to many messages you have already loaded, will be skiped  (required)
    
    ichat.getMessages(interactionId, offset)

*********************************

    interactionId, // _id of Interaction   (required)
    date, // previous messages from which date  (required)
    
    ichat.loadPreviousMessages(interactionId, date)

*********************************

    interactionId, // _id of Interaction   (required)
    date, // next messages from which date  (required)
    
    ichat.loadNextMessages(interactionId, date)

*********************************

    filter, // An object having attibutes which filters the data that will update  (required)
    data:{  (required)
       //properties which you want to update (see message payload of sendMessage event)
    }, 
    
    ichat.updateMessage(filter, data)

*********************************

    InteractionId, // _id of Interaction   (required)
    participantId, //particpant ID who have read messages   (required)
    
    ichat.markMessagesAsRead(interactionId, participantId)

*********************************

    comment:{
      interactionId, (required)
        channelCommentId
        comment,
        commentType, (required)
        recipient, (required)
        author: {
          id, (required)
          name
        },
        isChild,
        parentId,
        isDeleted,
        attachments: [   // if available
          {
            type,  // e.g. image,video,document etc
            data // url or data string
          },
            ....
        ],
        extraPayload:{} //if available
    }
    
    ichat.postComment(comment)

*********************************

    interactionId, // _id of Interaction  (required)
    offset, //How to many comments you have already loaded, will be skiped   (required)
   
    ichat.getComments(interactionId, offset)

*********************************

    interactionId, // _id of Interaction   (required)
    date, // previous comments from which date  (required)
    
    ichat.loadPreviousComments(interactionId, date)

*********************************

    interactionId, // _id of Interaction   (required)
    date, // next comments from which date  (required)
    
    ichat.loadNextComments(interactionId, date)

*********************************

     filter, // An object having attibutes which filters the data that will update  (required)
        data:{  (required)
           //properties which you want to update (see comment payload of postComment event)
        },
         
     ichat.updateComment(filter, data)

*********************************

     id, // _id of comment or interaction (required)
     likeType, // post OR comment what you want to like
     like, // like value true or false
         
     ichat.like(id, like,likeType)

     Note: For post like you require to provide id = _id of interaction and likeType = post
           and 
           For comment like you require to provide id = _id of comment and likeType = comment

*********************************

     commentId, // _id of comment  (required)
     hide, // hide value true or false
         
     ichat.hideComment(commentId, hide)

*********************************

     commentId, // _id of comment  (required)
         
     ichat.deleteComment(commentId)

*********************************

         id, // Bot's uuid in case of webChat or page id in case of social media or whatsapp number in case of whatsapp  (required)
         channel // Channel of interaction like webChat, whatsapp etc
         
         ichat.findBot(id,channel)

*********************************

         event, //  Event that have to be send (required)
         payload // Object containing values to process event
                                           
         ichat.postEvent(event,payload)

*********************************

         id, //logged in user id (required)
         offset, // How many visitors you have already loaded or want to skip
                                           
         ichat.findVisitors(id,offset)

*********************************

         interactionId, // _id of interaction (required)
         feedback, // feedback object that should have following keys
         {
            type, //  feedback type will be custom OR default (required)
            author, // id of author (required)
            authorType, // customer or agent (required)
            value, //feedback value like good , bad , emoji, etc (required)
            input, // can be same as value if type is default
            appId,  // id of which feedback app is used (required if type is custom)
          }
                                           
         ichat.postInteractionFeedback(interactionId, feedback)

*********************************

          data ={
              interactionId, // _id of interaction in which email is going to posted
              text, // email body text
              subject, //email subject,
              html, // complete html of the email
              direction, // for inbound email dircetion would be 0 and for oubtound it is 1
              extension, //email address you use for sending
              from, //Array of objects and each object will consist of name (if have otherwise can be null) and address (email address you use for sending)
              to,   //Array of objects and each object will consist of name (if have otherwise can be null) and address (email addresses you want to send email to)
              receivedAt, // email received date , null in case of outbound email
              attachments: [   // if available
              {
                type,  // e.g. image,video,document etc
                data // Object contains url or data string
              },
                ....
            ],
             status, // send | draft 
             reply, // true   (only use for replying an email)
             messageId, // message id of email whose reply this email is (only use for replying an email)
             forward, // true, if this is a forward email
         }
         
         ichat.postEmail(data)

*********************************

         interactionId, // _id of interaction for whom interaction emails you want to fetch
         offset, // how many emails you want to skip or already loaded of target interaction
                                           
         ichat.findInteractionEmails(interactionId, offset)

*********************************

         id, // customer id like email, whatsapp number depends upon channel
         currentInteractionDate, // createdAt date of (current opened) interaction from which you want previous interactions
         channel, // channel of interaction like email, whatsapp, fb_messenger etc
         offset, // how many interactions you want to skip or already loaded
                                           
         ichat.findCustomerPreviousInteractions(id, currentInteractionDate, channel, offset)

*********************************

         emailId, // _id of email you want to update
         date, // Object that contains values you want to update and values that can be updated can be seen in post email function
                                           
         updateEmail(emailId, data)

*********************************

         threadId, // thread id find in extra payload of interaction
         offset, // how many emails you want to skip or already loaded of target interaction
                                           
         ichat.findThreadEmails(threadId, offset)

*********************************

         emailId, // _id of email
                                           
         ichat.deleteEmail(emailId)

*********************************

         ticketNumber, // unqieue ticket number
         offset, // how many emails you want to skip or already loaded of target interaction
                                           
         ichat.findTicketEmails(ticketNumber, offset)

*********************************

        data ={
              ticketNumber,   // Unique Number of ticket
              interactionId, // interactionId of email whom reply is this email (only for reply)
              text, // email body text
              subject, //email subject,
              html, // complete html of the email
              direction, // for inbound email dircetion would be 0 and for oubtound it is 1
              extension, //email address you use for sending
              from, //Array of objects and each object will consist of name (if have otherwise can be null) and address (email address you use for sending)
              to,   //Array of objects and each object will consist of name (if have otherwise can be null) and address (email addresses you want to send email to)
              receivedAt, // email received date , null in case of outbound email
              attachments: [   // if available
              {
                type,  // e.g. image,video,document etc
                data // Object contains url or data string
              },
                ....
            ],
             status, // send | draft 
             reply, // true   (only use for replying an email)
             messageId, // message id of email whose reply this email is (only use for replying an email)
             forward, // true, if this is a forward email
            }
         ichat. postTicketEmail(data)

*********************************

         leadNumber, // unqieue lead number
         offset, // how many emails you want to skip or already loaded of target interaction
                                           
         ichat.findLeadEmails(leadNumber, offset)

*********************************

        data ={
              ticketNumber,   // Unique Number of lead
              interactionId, // interactionId of email whom reply is this email (only for reply)
              text, // email body text
              subject, //email subject,
              html, // complete html of the email
              direction, // for inbound email dircetion would be 0 and for oubtound it is 1
              extension, //email address you use for sending
              from, //Array of objects and each object will consist of name (if have otherwise can be null) and address (email address you use for sending)
              to,   //Array of objects and each object will consist of name (if have otherwise can be null) and address (email addresses you want to send email to)
              receivedAt, // email received date , null in case of outbound email
              attachments: [   // if available
              {
                type,  // e.g. image,video,document etc
                data // Object contains url or data string
              },
                ....
            ],
             status, // send | draft 
             reply, // true   (only use for replying an email)
             messageId, // message id of email whose reply this email is (only use for replying an email)
             forward, // true, if this is a forward email
            }
         ichat. postLeadEmail(data)

*********************************

         query, // keyword for searching  (required)
         filter, // An object having extra filters for email searching like threadId, interactionId etc
         offset, // How many search results you have already loaded or want to skip
         
         ichat.searchEmails(query,filter,offset)

---
_Source: https://npm.io/package/intellicon-interaction-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
