tencent cloud

Feedback

Overview of Event Notifications

Last updated: 2023-12-21 11:33:40
    It takes some time to complete the operations such as initiating document transcoding and real-time recording. You can use the server API to register the callback interface. The Tencent Interactive Whiteboard (TIW) can notify the applications in time through the callback interface when events such as the change of document transcoding progress and the start of real-time recording trigger.
    TIW supports notification of the following types of events:
    

    Event Callback Authentication

    When your backend receives the callback of real-time recording or document transcoding, it can verify the legitimacy of the signature to ensure that the callback message is indeed from the Tencent Cloud backend. The signature algorithm is as follows:
    Sign = md5(CallbackKey+ExpireTime)
    CallbackKey: This is an authentication key which can be set through the TIW console or using the API interface for real-time recording or document transcoding.
    ExpireTime: This refers to the signature expiration time. If the time specified by the expire_time value in a message notification has already expired, then the notification can be deemed invalid, thus preventing the network replay attacks. The format is a decimal Unix timestamp, namely the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT).
    For example:
    CallbackKey = Xz4ZgayTr7rMgWQrH
    ExpireTime = 1588040109
    
    Sign = md5(Xz4ZgayTr7rMgWQrH1588040109) = a2dabb362a9b811c0e26953a6276a41c
    If a callback key has been set, it has ExpireTime and Sign parameter when you reveive a callback request. You can calculate and verify whether the request comes from Tencent Cloud based on these two values and the callback key you set.

    Event Callback Protocol

    Request: The event callback initiated by TIW is in the form of an HTTP POST request. The request body is in JSON format, and the content is:
    Parameter Name
    Type
    Description
    Timestamp
    Integer
    Unix timestamp generated by events, whose unit is second.
    SdkAppId
    Integer
    TIW application SdkAppId that triggers the event.
    ExpireTime
    Integer
    The Unix timestamp for the signature expiration time with the unit being second. If the current time is later than the expiration time, the request can be deemed invalid by the backend.
    Sign
    String
    Callback signature. You may verify the consistency of the signature according to the method described in the event callback authentication, thereby confirming whether the request is from Tencent Cloud.
    EventType
    String
    Type of event.
    EventData
    JSON
    Specific event information, detailed in the event documentation.
    For instance, the callback format for a change of document transcoding progress is as follows:
    {
    "EventData": {
    "ResultUrl": "",
    "Pages": 21,
    "Progress": 10,
    "Resolution": "960x540",
    "TaskId": "gaqvbm16jr2q4uhm23rb",
    "Title": "Example.pptx"
    },
    "EventType": "PPT2H5ProgressChanged",
    "ExpireTime": 1588040109,
    "SdkAppId": 1400000001,
    "Sign": "a2dabb362a9b811c0e26953a6276a41c",
    "Timestamp": 1590045522
    }
    Response: HTTP STATUS CODE = 200. When the server ignores the specific content of the response packet, for the sake of a more amicable protocol, it is recommended that JSON: {"error_code":0} is in the response from clients.
    The event notification has the retry capability. The retry interval is 5 seconds, and the retry can be done for a total of 5 times. To avoid the impact of retries on your server and network bandwidth, please maintain normal return packets. Conditions where retry is triggered are as follows:
    No return packet for response for a long time (typically, 10 seconds).
    The HTTP STATUS code in the response is not 200.
    
    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