Documentation
zim In-app Chat
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • In-app Chat
  • Server APIs
  • Server callbacks
  • Callback on call invitation sent

Callback on call invitation sent

Last updated:2024-07-24 11:31

Overview

When a user sends a call invitation to other users, it represents the creation of a call.

Your server can receive the call creation callback from the ZIM server to obtain the details of the call invitation.

  1. If multiple users are called and one of them is logged out, the logged-out user is not included in the call creation callback.

  2. If all called users are logged out, the call creation callback is not returned.

  3. If the call inviation has been sent but the caller logs out or is indicated to be logged out by a heartbeat timeout, the business backend receives the call cancellation callback from the ZIM server. For more information, see Call cancel callback.

Callback description

  • Request method: POST.

    The callback data format is JSON, and you need to perform UrlDecode decoding on it.

  • Request URL: Configure the callback URL in the ZEGOCLOUD console.
  • Protocol: HTTPS/HTTP. HTTPS is recommended.

Callback parameters

Parameter Type Description
appid String The unique ID of an app.
event String The callback event. The return value is `call_create`.
nonce String A random number.
signature String The verification string. For more information, see Authenticating server-to-server callbacks.
timestamp Int The Unix timestamp of the server.
call_id String The ID of the caller.
user_ids Array The list of IDs of users to be called.
create_time Int The Unix timestamp of call invitation creation.
payload String The extended field for call creation.
caller String The user creating the call.
timeout Int The maximum time limit, in seconds, for waiting for a response from the called user.

We recommend that you convert some parameters into integers for logic processing, including appid and nonce.

Sample code

{
    "appid": "1",
    "event": "call_create",
    "nonce": "350176",
    "signature": "signature",
    "timestamp": 1499676978,
    "call_id": "3501761173612493269",
    "user_ids": ["abc","def"],
    "create_time": 1499676968,
    "payload": "payload",
    "caller": "caller",
    "timeout": 90
}

Return codes

If an HTTP status code 2XX (for example, 200) is returned, the callback succeeded. Otherwise, the callback failed.

Callback retry policy

If the ZEGOCLOUD server does not receive a response, or the HTTP status code received by the ZEGOCLOUD server is not 2xx (such as 200), it will retry with intervals of 2s, 4s, 8s, 16s, and 32s respectively. If the retry still fails after an interval of 32s, it will no longer retry.

Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code