Options
All
  • Public
  • Public/Protected
  • All
Menu

Class to handle digital contact related API calls

Hierarchy

  • DigitalContactService

Index

Constructors

Properties

APPROVE_DRAFT_MESSAGE: string = '/dfo/3.0/contacts/{contactId}/message-drafts/{messageDraftId}/approval'
CREATE_DRAFT_MESSAGE: string = '/dfo/3.0/contacts/{contactId}/message-drafts'
DELETE_DRAFT_MESSAGE: string = '/dfo/3.0/contacts/{contactId}/message-drafts/{messageDraftId}'
DELETE_MESSAGE_BY_ID: string = '/dfo/3.0/messages/{messageId}/delete'
DIGITAL_QR_REPLACE_VARIABLES: string = '/dfo/3.0/quick-responses/{quickResponseId}/replace-variables'
DIGITAL_QUICK_REPLIES_OUTBOUND: string = '/dfo/3.0/quick-responses'
FOCUS_DEFOCUS_CONTACT: string = '/dfo/3.0/contacts/{contactId}/focus'
HIDE_MESSAGE_BY_ID: string = '/dfo/3.0/messages/{messageId}/hide'
LOAD_RELATED_CASES: string = '/dfo/3.0/contacts/{contactId}/detail/pagination'
QUICK_RESPONSE_REPLACE_VARIABLES: string = '/rich-message-settings/1.0/quick-responses/{quickResponseId}/replace-variables'
REJECT_DRAFT_MESSAGE: string = '/dfo/3.0/contacts/{contactId}/message-drafts/{messageDraftId}/refusal'
RELATED_MESSAGES: string = '/dfo/3.0/contacts/{contactId}/related-messages'
UPDATE_DRAFT_MESSAGE: string = '/dfo/3.0/contacts/{contactId}/message-drafts/{messageDraftId}'
adminService: AdminService
auth: CXoneAuth
logger: CcfLogger = ...
urlUtilsService: UrlUtilsService = ...
utilService: HttpUtilService = ...

Methods

  • approveDraftMessage(contactId: string, messageDraftId: string): Promise<HttpResponse>
  • Method to approveDraftMessage

    example

    Parameters

    • contactId: string
    • messageDraftId: string

    Returns Promise<HttpResponse>

    response from API

  • changeAssignedUser(contactId: string, cxoneUserId: string): Promise<HttpResponse>
  • Method to assign customer contact to User

    example
    changeAssignedUser('123332', '645337')
    

    Parameters

    • contactId: string

      Contact Id of the digital contact

    • cxoneUserId: string

    Returns Promise<HttpResponse>

    • HttpResponse | CXoneSdkError
  • changeCustomerContactStatus(caseId: string, status: string): Promise<HttpResponse>
  • Method to change status of digital contact

    example

    Parameters

    • caseId: string

      Case Id of the digital contact

    • status: string

      Status to be set to the digital contact

    Returns Promise<HttpResponse>

  • Method to assign customer contact to routing queue

    example

    Parameters

    • contactId: string

      Contact Id of the digital contact

    • skillId: string

      Id of the skill queue where the contact it to be assigned

    Returns Promise<HttpResponse | CXoneSdkError>

  • deFocusContact(contactIdToDefocus: string): Promise<HttpResponse>
  • Method to de-focus a digital contact

    example
    • deFocusContact()

    Parameters

    • contactIdToDefocus: string

    Returns Promise<HttpResponse>

    response - Focus DEL API

  • deleteDraftMessage(contactId: string, messageDraftId: string): Promise<HttpResponse>
  • Method to deleteDraftMessage

    example

    Parameters

    • contactId: string
    • messageDraftId: string

    Returns Promise<HttpResponse>

    response from API

  • Method to delete a message - argument - messageId

    example
    • deleteMessage(messageId)

    Parameters

    • messageId: string

      message id of the message

    Returns Promise<HttpResponse>

    response - Delete API

  • Method to get digital contact's quick response replace variables when hasVariables flag comes as true

    example
    • fetchQuickResponseReplaceVariable('12ynj23', {contact: {contactNumber: '12345'}, externalVariables: []})

    Parameters

    Returns Promise<HttpResponse>

    • return the content of replace variables of quick response
  • Method to focus a digital contact

    example
    • focusContact(caseId)

    Parameters

    • contactId: string

    Returns Promise<HttpResponse>

    response - Focus POST API

  • getCaseHistory(contactId: string, pageNumber: number, pageSize: number): Promise<unknown>
  • Method to get history data for a case interaction

    example
    getCaseHistory('12345',1,10)
    

    Parameters

    • contactId: string

      Contact Id of the digital contact

    • pageNumber: number

      page number

    • pageSize: number

      page Size

    Returns Promise<unknown>

    • returns the history object with events
  • getDigitalContactDetails(contactId: string): Promise<HttpResponse>
  • Method to get contact details based on user slot API digital contact Id

    example

    Parameters

    • contactId: string

    Returns Promise<HttpResponse>

  • Method to get whole message content with html formatting

    example
    • getMessageById

    Parameters

    • messageId: string

      message id of the message

    Returns Promise<HttpResponse>

    • detailed message response
  • getQuickReplies(contactId: string, page?: number, size?: string | number, search?: string): Promise<CXoneDigitalQuickReply[]>
  • Method to get quick replies data

    example
    getQuickReplies('234567', 1, 10, '')
    

    Parameters

    • contactId: string

      Contact Id of the digital contact

    • page: number = 1

      start index for pagination

    • size: string | number = 1000

      total records to be fetched

    • search: string = ''

      This is content or title to be searched

    Returns Promise<CXoneDigitalQuickReply[]>

    • return the list of Quick replies
  • Method to get quick responses for outbound data

    example
    getQuickRepliesForOutboundContact(1, 10, '')
    

    Parameters

    • page: number = 1

      start index for pagination

    • size: string | number = 1000

      total records to be fetched

    • search: string = ''

      This is content or title to be searched

    Returns Promise<CXoneDigitalOutboundQuickReply>

    • return the list of Quick replies
  • getRelatedMessages(contactId: string): Promise<HttpResponse>
  • Method to get all related message threads for a public channel digital contact

    example

    Parameters

    • contactId: string

    Returns Promise<HttpResponse>

  • Method to get digital contact quick reply replace variables

    example
    getReplaceQuickResponseVariables(44)
    

    Parameters

    • quickReplyId: string

      Unique identification for quick reply

    Returns Promise<CXoneDigitalReplaceVariables>

    • return the content of replace variable
  • Method to get DFO chat replace variables

    example
    getReplaceVariables('234567', 44)
    

    Parameters

    • contactId: string

      Contact Id of the digital contact

    • quickReplyId: string

      Unique identification for quick reply

    Returns Promise<CXoneDigitalReplaceVariables>

    • return the content of replace variable
  • hideUnhideMessage(messageData: { isHidden: boolean; msgId: string }): Promise<HttpResponse>
  • Method to hide/unhide whole message

    example
    • hideUnhideMessage

    Parameters

    • messageData: { isHidden: boolean; msgId: string }
      • isHidden: boolean
      • msgId: string

    Returns Promise<HttpResponse>

    • detailed message response
  • loadPreviousNextCases(contactId: string): Promise<HttpResponse>
  • Method to fetch previous and next related cases of current digital contact

    example
    • loadPreviousNextCases('2345678')

    Parameters

    • contactId: string

      Contact Id of the digital contact

    Returns Promise<HttpResponse>

  • Method to send reply

    example

    postOutboundReply(postOutboundReply, channelId, xTraceId)

    Parameters

    • sendReplyRequest: CXoneDigitalReplyRequest

      message object

    • channelId: string

      channel Id

    • xTraceId: string

      xTraceId to trace the message

    Returns Promise<HttpResponse>

    response from /dfo/3.0/channels/channel_id/outbound API

  • refuseDraftMessage(contactId: string, messageDraftId: string): Promise<HttpResponse>
  • Method to refuseDraftMessage

    example

    Parameters

    • contactId: string

      contact Id

    • messageDraftId: string

      draft message id

    Returns Promise<HttpResponse>

    response from API

  • Method to send bulk reply

    example
    • sendBulkReply(['12345'], 'test', '457677')

    Parameters

    • selectedContactIds: string[]

      Selected contact IDs

    • messageContent: string

      Message content

    • cxoneUserId: string

      Agent ID of logged in user

    Returns Promise<CXoneSdkError | BulkReplyResponse>

  • subscribeToEventHub(relationObjectId: string, subscriptionType?: string): Promise<HttpResponse>
  • Method to subscribe to event hub for the event not coming fromm web socket

    example

    Parameters

    • relationObjectId: string
    • subscriptionType: string = 'contact'

    Returns Promise<HttpResponse>

  • unassignCustomerContact(contactId: string): Promise<HttpResponse>
  • Method to unassign customer contact

    example

    Parameters

    • contactId: string

    Returns Promise<HttpResponse>

  • updateMessageReadStatus(messageId: string): Promise<unknown>
  • Method to mark a digital case as read when it is focused

    example
    • markMessageAsRead(messageId)

    Parameters

    • messageId: string

    Returns Promise<unknown>

    response - whether the isRead field was successfully updated or not

Generated using TypeDoc