tencent cloud

Feedback

Last updated: 2024-04-01 18:07:37
    Note
    TCCC is the global variable accessed directly after the SDK is loaded.

    Common Structure

    AgentStatus

    Agent status.
    Field
    Description
    free
    Idle
    busy
    In line
    arrange
    After-call-work
    notReady
    Busy
    rest
    On break

    ServerType

    Endpoint service type, the endpoint type used for describing phone sessions.
    Field
    Description
    staffSeat
    Web agent type
    staffPhoneSeat
    Agent's mobile type
    miniProgramSeat
    Mini program type
    staffExtensionSeat
    Telephone type

    CommonSDKResponse

    Parameter
    Type
    Required
    Remarks
    options
    status
    'success' |'error'
    Yes
    Result of SDK API call. Returns 'success' on success, and 'error' on failure.
    errorMsg
    string
    No
    Error message, returned when status is 'error'

    Call (API Functions of Telephone Customer Service and Audio Customer Service)

    Inbound call

    tccc.Call.startOutboundCall(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    phoneNumber
    String
    Yes
    Contact Number
    phoneDesc
    String
    No
    Number remarks, which will replace the number displayed in the call bar
    uui
    String
    No
    User-defined data, which can be returned by pushing through Telephone CDR data push after input
    skillGroupId
    String
    No
    The bound outbound number in the skill group
    callerPhoneNumber
    String
    No
    Outbound number
    servingNumberGroupIds
    String[]
    No
    Number ID list
    phoneEncodeType
    'number'
    No
    Currently, only 'number' is supported, forcing the use of actual numbers when number mapping is enabled.

    tccc.Call.startOutboundCall(options): Promise<CallResponse>

    The description of CallResponse is as follows:
    Parameter
    Type
    Required
    Remarks
    response
    sessionId
    String
    Yes
    Session ID
    calleeLocation
    String
    No
    Called number's location
    calleePhoneNumber
    String
    Yes
    Contact Number
    callerPhoneNumber
    String
    Yes
    The calling number used for making an outbound call
    serverType
    String
    Yes
    Type of the endpoint used for making an outbound call. Optional values are: staffSeat, staffPhoneSeat, and staffExtensionSeat. For details, see Session Service Type.
    remark
    String
    No
    Called number remarks

    Answers a call.

    tccc.Call.accept(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID, obtained from the tccc.events.callIn event

    Ends a conversation.

    tccc.Call.hungUp(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Deleting a Session

    tccc.Call.deleteCall(options)

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Mutes.

    tccc.Call.muteMic(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Unmutes.

    tccc.Call.unmuteMic(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Is It Currently Muted

    tccc.Call.isMicMuted(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Initiating an Internal Call

    tccc.Call.startInternalCall(): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    calleeUserId
    String
    Yes
    Called agent account
    useMobile
    Boolean
    No
    Whether to call their mobile phone or not

    Transferring a Session

    tccc.Call.transfer(): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID
    skillGroupId
    String
    No
    Transfers to a specified skill group.
    userId
    String
    No
    Transfers to a specified agent.

    Call hold

    tccc.Call.hold(): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Canceling Call Hold

    tccc.Call.unHold(): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Sending Extension Number

    tccc.Call.sendDigits(): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID
    dtmfText
    String
    No
    The extension number to be sent

    Chat (Online Customer Service API Functions)

    Answers a call.

    tccc.Chat.accept(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Ending a Session

    tccc.Chat.end(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Transferring a Session

    tccc.Chat.transfer(): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID
    skillGroupId
    String
    No
    Transfers to a specified skill group.
    userId
    String
    No
    Transfers to a specified agent.

    Video (Video Customer Service API Functions)

    Answers a call.

    tccc.Video.accept(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Ends a conversation.

    tccc.Video.end(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Mutes.

    tccc.Video.muteMic(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Unmutes.

    tccc.Video.unmuteMic(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Disabling the Camera

    tccc.Video.muteVideo(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Enabling the Camera

    tccc.Video.unmuteVideo(options): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Transferring a Session

    tccc.Video.transfer(): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID
    skillGroupId
    String
    No
    Transfers to a specified skill group.
    userId
    String
    No
    Transfers to a specified agent.

    Agent (Agent Status API Functions)

    For more agent status enumeration types, refer to Agent Status.

    Going Online

    tccc.Agent.online(): void

    Going Offline

    tccc.Agent.offline(): void

    Setting Agent Status

    tccc.Agent.setStatus(optoins): Promise<CommonSDKResponse>

    Parameter
    Type
    Required
    Remarks
    options
    status
    String
    Yes
    Agent status, valid values:
    free: Idle
    rest: On break
    arrange: After-call-work
    notReady: Busy
    stopNotReady: Stops showing busy
    restReason
    String
    No
    On break reason

    Obtaining Agent Status

    tccc.Agent.getStatus():AgentStatus

    Devices (Device API Functions)

    Checking Whether the Browser Is Supported

    tccc.Devices.isBrowserSupported(): boolean

    Note
    TCCC Web SDK supports Google Chrome 56 and Microsoft Edge 80 or later.

    Returning to Microphone List

    tccc.Devices.getMicrophones(): Promise<MediaDeviceInfo []>

    Returning to Speaker List

    tccc.Devices.getSpeakers(): Promise<MediaDeviceInfo []>

    UI (User Interface API Functions)

    Hiding All SDK UIs

    tccc.UI.hide(): void

    Showing All SDK UIs

    tccc.UI.show(): void

    Showing Floating Button

    tccc.UI.showfloatButton(): void

    Hiding Floating Button

    tccc.UI.hidefloatButton(): void

    Showing Workspace

    tccc.UI.showWorkbench(): void

    Hiding Workspace

    tccc.UI.hideWorkbench(): void

    Events

    Listening to Events

    tccc.on(event, callback)

    Canceling Event Listening

    tccc.off(event, callback)

    Completing SDK Initialization

    tccc.events.ready

    Triggered when SDK initialization is complete, at which point the API can be called safely.

    Incoming Session

    tccc.events.callIn

    Types of incoming sessions include:
    phone: Telephone session
    im: Online session
    voip: Audio session
    video: Video session
    internal: Internal session

    Incoming Telephone Session

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID
    type
    'phone'
    Yes
    Telephone session type
    timeout
    Number
    Yes
    Session access timeout duration, with 0 representing no timeout
    calleePhoneNumber
    String
    Yes
    Contact Number
    callerPhoneNumber
    String
    No
    Caller Number
    callerLocation
    String
    No
    Caller's location
    remark
    String
    No
    Remarks
    ivrPath
    {key: String, label: String}[]
    -
    User's IVR key path. key represents the corresponding key, and label represents the corresponding key tag.
    protectedCallee
    String
    No
    When mapping is enabled, the number represents the called party.
    protectedCaller
    String
    No
    When mapping is enabled, the number represents the caller.
    serverType
    'staffSeat' | 'staffPhoneSeat' | 'staffExtensionSeat'
    Yes
    Indicates the type of the agent the call goes to. staffSeat: Default value, indicating Web agent StaffPhoneSeat: Agent's mobile MiniProgramSeat: Mini program agent staffExtensionSeat: Telephone bound to the agent

    Incoming Online Session

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID
    type
    'phone'
    Yes
    Telephone session type
    timeout
    Number
    Yes
    Session access timeout duration, with 0 representing no timeout
    nickname
    String
    Yes
    User's nickname
    avatar
    String
    No
    User's profile photo
    remark
    String
    No
    Remarks
    peerSource
    String
    No
    Channel source
    channelName
    String
    No
    Custom parameter
    clientData
    String
    No
    User-defined parameter

    Incoming Audio Session

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID
    type
    'voip'
    Yes
    Audio session type
    timeout
    Number
    Yes
    Session access timeout duration, with 0 representing no timeout
    callee
    String
    Yes
    Channel entry
    calleeRemark
    String
    No
    Channel entry remarks
    userId
    String
    Yes
    User's openId
    nickname
    String
    No
    Users will get a WeChat nickname after authorization.
    avatar
    String
    No
    Users will receive a WeChat profile photo after authorization.
    remark
    String
    No
    Remarks
    peerSource
    String
    No
    Caller's location
    ivrPath
    {key: String, label: String}[]
    No
    User's IVR key path. key represents the corresponding key, and label represents the corresponding key tag.
    clientData
    String
    No
    User-defined parameter

    Incoming Video Session

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID
    type
    'video'
    Yes
    Video session type
    timeout
    String
    Yes
    Session access timeout duration, with 0 representing no timeout
    userId
    String
    Yes
    User's openId
    nickname
    String
    No
    Users will get a WeChat nickname after authorization.
    avatar
    String
    No
    Users will receive a WeChat profile photo after authorization.
    remark
    String
    No
    Remarks
    
    
    
    

    Incoming Internal Session

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID
    type
    'internal'
    Yes
    Internal session type
    timeout
    Number
    Yes
    Session access timeout duration, with 0 representing no timeout
    peerUserId
    String
    Yes
    Caller's account

    Agent Access Session

    tccc.events.userAccessed

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Session Timeout Transfer Event

    tccc.events.autoTransfer

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Session End Event

    tccc.events.sessionEnded

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID
    closeBy
    String
    Yes
    Indicates the hang-up party:
    client: Hang up by user
    seat: Hang up by agent
    admin: Hang up by system
    timer: Hang up by timer
    mainReason
    String
    No
    Only exists in telephone type, and when the hang-up party is "admin", indicating the reason for hang-up.
    subReason
    String
    No
    Only exists in telephone type, and when the hang-up party is "admin", indicating the detailed reason for hang-up.

    Successful Outbound Call Event

    tccc.events.callOuted

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Outbound Call Answering Event

    tccc.events.calloutAccepted

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Session Transfer Event

    tccc.events.transfer

    Parameter
    Type
    Required
    Remarks
    options
    sessionId
    String
    Yes
    Session ID

    Agent Status Change Event

    tccc.events.statusChanged

    Parameter
    Type
    Required
    Remarks
    
    options
    status
    No
    For details, refer to Agent Status.
    

    Automatic Speech Recognition Event

    tccc.events.asr

    Parameter
    Type
    Required
    Remarks
    
    options
    sessionId
    String
    Yes
    Session ID
    
    result
    ASR recognition result
    Yes
    Automatic Speech Recognition result structure
    
    flow
    'IN' | 'OUT'
    Yes
    Recognition direction
    IN: User side
    OUT: Agent side
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support