tencent cloud

Feedback

Webhook for agent assignment

Last updated: 2024-09-03 17:36:37

    Function Description

    Administrators can use this interface to obtain information related to requests for transferring to human customer service and assign agents based on business logic.

    Please Note

    To enable this webhook, it must be configured in the Desk management panel with a webhook URL set up, and the customer service allocation method set to Assigned by Webhook.
    The direction of the webhook is an HTTPS POST request initiated by the Instant Messaging IM backend to the App backend.
    Upon receiving the webhook request, the App backend must verify that the SDKAppID parameter in the request URL matches its own SDKAppID.
    For additional security-related considerations, please refer to the "Webhook Overview: Security Considerations" document.

    Scenarios That May Trigger This Webhook

    This webhook may be triggered when a user in a session initiates a request to transfer to human customer service, and the application is configured to assign agents by webhook.

    Timing of the Webhook

    When the application is set to assign agents by webhook, this webhook is triggered by the IM backend when a user in the session initiates a request for transferring to human customer service.

    Interface Description

    Webhook URL Example

    In the following example, the App's configured webhook URL is https://www.example.com.

    Example:

    Request Parameter Description

    Parameter
    Description
    https
    The request protocol is HTTPS, and the method is POST
    www.example.com
    Callback URL
    SdkAppid
    The SDKAppID assigned in the Instant Messaging IM console when creating the application
    CallbackCommand
    Fixed as ChatBot.OnAssignAgent
    contenttype
    Fixed value as JSON
    ClientIP
    Client IP, format such as: 127.0.0.1
    OptPlatform
    Client platform, see the "Webhook Overview: Webhook Protocol" for
    the meaning of parameters in OptPlatform

    Request Package Example

    {
    "CallbackCommand": "ChatBot.OnAssignAgent", //Webhook command
    "SessionId":"aa-bb-cc-dd", //SessionID of the conversation
    "ClientUserId":"123", // User ID of the client triggering the request for human assistance
    "EventTime": 1670574414123 //Timestamp
    }

    Request Package Field Description

    Field
    Type
    Description
    CallbackCommand
    String
    Webhook command
    SessionId
    String
    SessionID of the conversation
    ClientUserId
    String
    User ID of the client triggering the request for human assistance
    EventTime
    String
    Timestamp of the event in milliseconds

    Response Package Example

    After synchronizing data, the App backend sends a webhook response package.
    {
    "ActionStatus": "OK",
    "ErrorInfo": "",
    "ErrorCode": 0,
    "AgentGroupId": 6521, //Agent Group ID sent from your end
    "AgentIdList": ["penn_svc","dramon_svc"] //List of agent sent from your end
    }

    Response Package Field Description

    Field
    Type
    Attribute
    Description
    ActionStatus
    String
    Required
    Result of the request processing:
    OK for success
    FAIL for failure
    ErrorCode
    Integer
    Required
    Error code:
    0 for successful processing and sends RspData back to the smart robot
    1 for failure, RspData is ignored
    AgentGroupId
    Integer
    Optional
    ID of the agent group returned from your end; if only this field is provided, the IM backend will assign agent from this agent group
    AgentIdList
    Array
    Optional
    List of agents returned from your end; if specified, one agent from the list will be assigned based on availability rules
    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