Options
All
  • Public
  • Public/Protected
  • All
Menu

Class to handle Customer Card API calls

Hierarchy

  • CustomerCardService

Index

Constructors

Properties

DELETE_CUSTOMER_CUSTOM_FIELD: string = '/dfo/3.0/customers/{customerId}/custom-fields/{customFieldIdent}'
EXECUTE_WORKFLOW_URI: string = '/InContactAPI/services/v27.0/agent-integration/configuration/{configurationId}/workflow/{workflowId}'
GET_CRM_DATA_FOR_TRANSFERED_CONTACT: string = '/InContactAPI/services/v30.0/agent-integration/workflow-execution/interaction/{cacheKey}'
auth: CXoneAuth
customerSearchScrollToken: string = ''
logger: Logger = ...
searchText: string = ''
urlUtilsService: UrlUtilsService = ...
utilService: HttpUtilService = ...

Methods

  • Method to create a Customer note in customer card

    example

    Parameters

    • customerId: string
    • note: string

    Returns Promise<CXoneSdkError | CustomerCardNote>

    • API Returns Response JSON with created note object
  • Method to delete linked custom field on customer card

    example
    deleteCustomField({ ident: 'city', customerId: 'email_bharath@gmail.com' });
    

    Parameters

    Returns Promise<HttpResponse>

    • API Returns Response code with success or failure
  • Method to delete a Customer note in customer card

    example

    Parameters

    • customerId: string
    • noteId: string

    Returns Promise<HttpResponse | CXoneSdkError>

    • API Returns Response JSON with deleted empty note object
  • Method to edit a Customer note in customer card

    example

    Parameters

    • customerId: string
    • noteId: string
    • note: string

    Returns Promise<CXoneSdkError | CustomerCardNote>

    • API Returns Response JSON with updated note object
  • getAgentDigitalContactHistory(ownerAssignee: string): Promise<AssertsShape<{ authorEndUserIdentity: any; channelId: default<string, AnyObject, string>; channelName: default<string, AnyObject, string>; contactId: default<string, AnyObject, string>; createdAt: RequiredStringSchema<string, AnyObject>; customFields: default<default<Assign<ObjectShape, { ident: default<string, AnyObject, string>; isEditable: default<boolean, AnyObject, boolean>; isRequired: default<boolean, AnyObject, boolean>; isVisibleInCustomerCard: default<boolean, AnyObject, boolean>; isVisibleInRightPanel: default<boolean, AnyObject, boolean>; label: default<string, AnyObject, string>; selectedValue: default<string, AnyObject, string>; type: default<string, AnyObject, string>; value: default<string, AnyObject, string>; values: OptionalArraySchema<AnySchema<any, any, any>, any, any[]> }>, AnyObject, TypeOfShape<Assign<ObjectShape, { ident: default<string, AnyObject, string>; isEditable: default<boolean, AnyObject, boolean>; isRequired: default<boolean, AnyObject, boolean>; isVisibleInCustomerCard: default<boolean, AnyObject, boolean>; isVisibleInRightPanel: default<boolean, AnyObject, boolean>; label: default<string, AnyObject, string>; selectedValue: default<string, AnyObject, string>; type: default<string, AnyObject, string>; value: default<string, AnyObject, string>; values: OptionalArraySchema<AnySchema<any, any, any>, any, any[]> }>>, AssertsShape<Assign<ObjectShape, { ident: default<string, AnyObject, string>; isEditable: default<boolean, AnyObject, boolean>; isRequired: default<boolean, AnyObject, boolean>; isVisibleInCustomerCard: default<boolean, AnyObject, boolean>; isVisibleInRightPanel: default<boolean, AnyObject, boolean>; label: default<string, AnyObject, string>; selectedValue: default<string, AnyObject, string>; type: default<string, AnyObject, string>; value: default<string, AnyObject, string>; values: OptionalArraySchema<AnySchema<any, any, any>, any, any[]> }>>>, AnyObject, TypeOfShape<Assign<ObjectShape, { ident: default<string, AnyObject, string>; isEditable: default<boolean, AnyObject, boolean>; isRequired: default<boolean, AnyObject, boolean>; isVisibleInCustomerCard: default<boolean, AnyObject, boolean>; isVisibleInRightPanel: default<boolean, AnyObject, boolean>; label: default<string, AnyObject, string>; selectedValue: default<string, AnyObject, string>; type: default<string, AnyObject, string>; value: default<string, AnyObject, string>; values: OptionalArraySchema<AnySchema<any, any, any>, any, any[]> }>>[], AssertsShape<Assign<ObjectShape, { ident: default<string, AnyObject, string>; isEditable: default<boolean, AnyObject, boolean>; isRequired: default<boolean, AnyObject, boolean>; isVisibleInCustomerCard: default<boolean, AnyObject, boolean>; isVisibleInRightPanel: default<boolean, AnyObject, boolean>; label: default<string, AnyObject, string>; selectedValue: default<string, AnyObject, string>; type: default<string, AnyObject, string>; value: default<string, AnyObject, string>; values: OptionalArraySchema<AnySchema<any, any, any>, any, any[]> }>>[]>; direction: RequiredStringSchema<string, AnyObject>; endUser: any; endUserRecipients: any; id: RequiredStringSchema<string, AnyObject>; inboundCount: default<number, AnyObject, number>; inboxAssignee: default<number, AnyObject, number>; inboxAssigneeLastAssignedAt: default<Date, AnyObject, Date>; inboxAssigneeUser: any; interactionId: default<string, AnyObject, string>; outboundCount: default<number, AnyObject, number>; ownerAssigneeUser: any; recipients: default<default<Assign<ObjectShape, { idOnExternalPlatform: RequiredStringSchema<string, AnyObject>; isPrimary: RequiredBooleanSchema<boolean, AnyObject>; isPrivate: RequiredBooleanSchema<boolean, AnyObject>; name: RequiredStringSchema<string, AnyObject> }>, AnyObject, TypeOfShape<Assign<ObjectShape, { idOnExternalPlatform: RequiredStringSchema<string, AnyObject>; isPrimary: RequiredBooleanSchema<boolean, AnyObject>; isPrivate: RequiredBooleanSchema<boolean, AnyObject>; name: RequiredStringSchema<string, AnyObject> }>>, AssertsShape<Assign<ObjectShape, { idOnExternalPlatform: RequiredStringSchema<string, AnyObject>; isPrimary: RequiredBooleanSchema<boolean, AnyObject>; isPrivate: RequiredBooleanSchema<boolean, AnyObject>; name: RequiredStringSchema<string, AnyObject> }>>>, AnyObject, TypeOfShape<Assign<ObjectShape, { idOnExternalPlatform: RequiredStringSchema<string, AnyObject>; isPrimary: RequiredBooleanSchema<boolean, AnyObject>; isPrivate: RequiredBooleanSchema<boolean, AnyObject>; name: RequiredStringSchema<string, AnyObject> }>>[], AssertsShape<Assign<ObjectShape, { idOnExternalPlatform: RequiredStringSchema<string, AnyObject>; isPrimary: RequiredBooleanSchema<boolean, AnyObject>; isPrivate: RequiredBooleanSchema<boolean, AnyObject>; name: RequiredStringSchema<string, AnyObject> }>>[]>; routingQueueId: default<string, AnyObject, string>; skillId: default<number, AnyObject, number>; skillName: default<string, AnyObject, string>; status: RequiredStringSchema<string, AnyObject>; statusUpdatedAt: default<Date, AnyObject, Date>; threadId: RequiredStringSchema<string, AnyObject>; threadIdOnExternalPlatform: RequiredStringSchema<string, AnyObject> }>[]>
  • Method to fetch Agent Digital Contact History

    example
    • Pass 1 parameter ownerAssignee

    Parameters

    • ownerAssignee: string

    Returns Promise<AssertsShape<{ authorEndUserIdentity: any; channelId: default<string, AnyObject, string>; channelName: default<string, AnyObject, string>; contactId: default<string, AnyObject, string>; createdAt: RequiredStringSchema<string, AnyObject>; customFields: default<default<Assign<ObjectShape, { ident: default<string, AnyObject, string>; isEditable: default<boolean, AnyObject, boolean>; isRequired: default<boolean, AnyObject, boolean>; isVisibleInCustomerCard: default<boolean, AnyObject, boolean>; isVisibleInRightPanel: default<boolean, AnyObject, boolean>; label: default<string, AnyObject, string>; selectedValue: default<string, AnyObject, string>; type: default<string, AnyObject, string>; value: default<string, AnyObject, string>; values: OptionalArraySchema<AnySchema<any, any, any>, any, any[]> }>, AnyObject, TypeOfShape<Assign<ObjectShape, { ident: default<string, AnyObject, string>; isEditable: default<boolean, AnyObject, boolean>; isRequired: default<boolean, AnyObject, boolean>; isVisibleInCustomerCard: default<boolean, AnyObject, boolean>; isVisibleInRightPanel: default<boolean, AnyObject, boolean>; label: default<string, AnyObject, string>; selectedValue: default<string, AnyObject, string>; type: default<string, AnyObject, string>; value: default<string, AnyObject, string>; values: OptionalArraySchema<AnySchema<any, any, any>, any, any[]> }>>, AssertsShape<Assign<ObjectShape, { ident: default<string, AnyObject, string>; isEditable: default<boolean, AnyObject, boolean>; isRequired: default<boolean, AnyObject, boolean>; isVisibleInCustomerCard: default<boolean, AnyObject, boolean>; isVisibleInRightPanel: default<boolean, AnyObject, boolean>; label: default<string, AnyObject, string>; selectedValue: default<string, AnyObject, string>; type: default<string, AnyObject, string>; value: default<string, AnyObject, string>; values: OptionalArraySchema<AnySchema<any, any, any>, any, any[]> }>>>, AnyObject, TypeOfShape<Assign<ObjectShape, { ident: default<string, AnyObject, string>; isEditable: default<boolean, AnyObject, boolean>; isRequired: default<boolean, AnyObject, boolean>; isVisibleInCustomerCard: default<boolean, AnyObject, boolean>; isVisibleInRightPanel: default<boolean, AnyObject, boolean>; label: default<string, AnyObject, string>; selectedValue: default<string, AnyObject, string>; type: default<string, AnyObject, string>; value: default<string, AnyObject, string>; values: OptionalArraySchema<AnySchema<any, any, any>, any, any[]> }>>[], AssertsShape<Assign<ObjectShape, { ident: default<string, AnyObject, string>; isEditable: default<boolean, AnyObject, boolean>; isRequired: default<boolean, AnyObject, boolean>; isVisibleInCustomerCard: default<boolean, AnyObject, boolean>; isVisibleInRightPanel: default<boolean, AnyObject, boolean>; label: default<string, AnyObject, string>; selectedValue: default<string, AnyObject, string>; type: default<string, AnyObject, string>; value: default<string, AnyObject, string>; values: OptionalArraySchema<AnySchema<any, any, any>, any, any[]> }>>[]>; direction: RequiredStringSchema<string, AnyObject>; endUser: any; endUserRecipients: any; id: RequiredStringSchema<string, AnyObject>; inboundCount: default<number, AnyObject, number>; inboxAssignee: default<number, AnyObject, number>; inboxAssigneeLastAssignedAt: default<Date, AnyObject, Date>; inboxAssigneeUser: any; interactionId: default<string, AnyObject, string>; outboundCount: default<number, AnyObject, number>; ownerAssigneeUser: any; recipients: default<default<Assign<ObjectShape, { idOnExternalPlatform: RequiredStringSchema<string, AnyObject>; isPrimary: RequiredBooleanSchema<boolean, AnyObject>; isPrivate: RequiredBooleanSchema<boolean, AnyObject>; name: RequiredStringSchema<string, AnyObject> }>, AnyObject, TypeOfShape<Assign<ObjectShape, { idOnExternalPlatform: RequiredStringSchema<string, AnyObject>; isPrimary: RequiredBooleanSchema<boolean, AnyObject>; isPrivate: RequiredBooleanSchema<boolean, AnyObject>; name: RequiredStringSchema<string, AnyObject> }>>, AssertsShape<Assign<ObjectShape, { idOnExternalPlatform: RequiredStringSchema<string, AnyObject>; isPrimary: RequiredBooleanSchema<boolean, AnyObject>; isPrivate: RequiredBooleanSchema<boolean, AnyObject>; name: RequiredStringSchema<string, AnyObject> }>>>, AnyObject, TypeOfShape<Assign<ObjectShape, { idOnExternalPlatform: RequiredStringSchema<string, AnyObject>; isPrimary: RequiredBooleanSchema<boolean, AnyObject>; isPrivate: RequiredBooleanSchema<boolean, AnyObject>; name: RequiredStringSchema<string, AnyObject> }>>[], AssertsShape<Assign<ObjectShape, { idOnExternalPlatform: RequiredStringSchema<string, AnyObject>; isPrimary: RequiredBooleanSchema<boolean, AnyObject>; isPrivate: RequiredBooleanSchema<boolean, AnyObject>; name: RequiredStringSchema<string, AnyObject> }>>[]>; routingQueueId: default<string, AnyObject, string>; skillId: default<number, AnyObject, number>; skillName: default<string, AnyObject, string>; status: RequiredStringSchema<string, AnyObject>; statusUpdatedAt: default<Date, AnyObject, Date>; threadId: RequiredStringSchema<string, AnyObject>; threadIdOnExternalPlatform: RequiredStringSchema<string, AnyObject> }>[]>

    • API Returns Digital contact History details for the Agent
  • getAgentVoiceContactHistory(contactHistoryRequest: CXoneAgentVoiceContactHistoryRequest): Promise<AssertsShape<{ agentId: default<string, AnyObject, string>; contactId: default<string, AnyObject, string>; contactStart: default<string, AnyObject, string>; dispositionNotes: default<string, AnyObject, string>; firstName: default<string, AnyObject, string>; fromAddr: default<string, AnyObject, string>; isOutbound: default<boolean, AnyObject, boolean>; lastName: default<string, AnyObject, string>; lastUpdateTime: default<string, AnyObject, string>; mediaType: default<string, AnyObject, string>; primaryDispositionId: default<number, AnyObject, number>; skillId: default<string, AnyObject, string>; skillName: default<string, AnyObject, string>; tags: any; teamId: default<string, AnyObject, string>; toAddr: default<string, AnyObject, string>; totalDurationSeconds: default<number, AnyObject, number> }>[]>
  • Method to fetch Agent Contact History

    example
    • Pass 2 parameter inboxAssignee & updatedSinceHours for fetching contact history for particular days span.

    Parameters

    Returns Promise<AssertsShape<{ agentId: default<string, AnyObject, string>; contactId: default<string, AnyObject, string>; contactStart: default<string, AnyObject, string>; dispositionNotes: default<string, AnyObject, string>; firstName: default<string, AnyObject, string>; fromAddr: default<string, AnyObject, string>; isOutbound: default<boolean, AnyObject, boolean>; lastName: default<string, AnyObject, string>; lastUpdateTime: default<string, AnyObject, string>; mediaType: default<string, AnyObject, string>; primaryDispositionId: default<number, AnyObject, number>; skillId: default<string, AnyObject, string>; skillName: default<string, AnyObject, string>; tags: any; teamId: default<string, AnyObject, string>; toAddr: default<string, AnyObject, string>; totalDurationSeconds: default<number, AnyObject, number> }>[]>

    • API Returns contact History details for the Agent
  • getCRMDataForTransferedContact(crmInteractionId: string): Promise<unknown>
  • Method to get the CRM data for transfered contact

    example

    Parameters

    • crmInteractionId: string

      CRM record interaction id

    Returns Promise<unknown>

    • API Returns Response JSON with CRM data for transfered contact
  • getCRMDataForTransferedContactFromPolling(crmInteractionId: string): Promise<unknown>
  • Method to keep alive cacheKey

    example

    getCRMDataForTransferedContactFromPolling(crmInteractionId)

    Parameters

    • crmInteractionId: string

      CRM record interaction id

    Returns Promise<unknown>

  • Method to fetch custom field definition

    example

    Returns Promise<CXoneCustomerCardCustomFields>

    • API Returns Response JSON of Custom field definition
  • getCustomerDetails(customerinfo: CustomerRequest): Promise<AssertsShape<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>[]>
  • Method to fetch Customer details by Full Name

    example

    Parameters

    • customerinfo: CustomerRequest

    Returns Promise<AssertsShape<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>[]>

    • API Returns Response JSON with specific Customer Details
  • getCustomerDetailsById(customerId: string): Promise<AssertsShape<{ customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>
  • Method to fetch Customer details by Id

    example

    Parameters

    • customerId: string

    Returns Promise<AssertsShape<{ customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>

    • API Returns Response JSON with specific Customer Details
  • Method to fetch Customer details by Id

    example

    Parameters

    • Id: { currentPageIndex: number; customerId: string }

      Customer Id of the Customer

      • currentPageIndex: number
      • customerId: string

    Returns Promise<CustomerCardNoteResponse>

    • API Returns Response JSON with list of Customer Notes
  • isNewSearchRequest(newSearchText?: string): boolean
  • Used to check if the current request is a new search request or the already searched request

    Parameters

    • Optional newSearchText: string

      search string

    Returns boolean

    boolean stating if true that means its a new search request

  • searchCustomer(searchedText: string, externalIds: string[], scrollToken?: string): Promise<AssertsShape<{ data: default<default<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>, AnyObject, TypeOfShape<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>, AssertsShape<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>>, AnyObject, TypeOfShape<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>[], AssertsShape<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>[]>; scrollToken: default<string, AnyObject, string> }>>
  • Method to search customers by Full Name

    example
    • searchCustomer(John Doe)

    Parameters

    • searchedText: string

      search field text to search details of the customer

    • externalIds: string[]
    • Optional scrollToken: string

    Returns Promise<AssertsShape<{ data: default<default<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>, AnyObject, TypeOfShape<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>, AssertsShape<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>>, AnyObject, TypeOfShape<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>[], AssertsShape<Assign<ObjectShape, { customFields: any; firstName: default<string, AnyObject, string>; fullName: default<string, AnyObject, string>; id: default<string, AnyObject, string>; identities: any; image: default<string, AnyObject, string>; surname: default<string, AnyObject, string> }>>[]>; scrollToken: default<string, AnyObject, string> }>>

    • API Returns Response JSON with searched customer list
  • updateCustomFields(customFields: CustomerCardCustomFieldDetails): Promise<HttpResponse>
  • Method to update all custom fields

    example

    Parameters

    • customFields: CustomerCardCustomFieldDetails

    Returns Promise<HttpResponse>

    • API Returns Response code with success or failure

Generated using TypeDoc