Skip to main content

Start Session Call

Start a video call session and get Agora credentials.

Endpoint​

  • Method: POST
  • URL: /v1/customer/sessions/{id}/start-call

Request Headers​

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Path Parameters​

ParameterTypeDescriptionRequired
idstringSession IDYes

Success Response​

{
"success": true,
"message": "تم جلب البيانات بنجاح",
"data": {
"token": "agora_token",
"chat_token": "agora_chat_token",
"channel_name": "channel_hash",
"session_timer": 300000,
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"avatar": "url",
"number": "SESS-123456",
"date": "25/03/2024 , 14:00",
"elapsed_time": 0,
"duration": 3600000,
"category_name": "Life Coaching",
"session_chats": []
},
"statusCode": 200
}

Error Response​

Session Not Found (404)​

{
"success": false,
"message": "لم يتم العثور على السجل",
"data": [],
"statusCode": 404
}

Session Already Started (400)​

{
"success": false,
"message": "الجلسة بدأت بالفعل",
"data": null,
"statusCode": 400
}

Important Notes​

  • This endpoint is used to start a video call session using Agora
  • The response includes:
    • Agora tokens for video and chat
    • Channel name for the call
    • Session timing information
    • Coach details
    • Session chat history
  • The session timer is in milliseconds
  • The duration is also in milliseconds
  • Session chats are sorted by creation time