Start Session Call
Start a video call session and get Agora credentials.
Endpoint
- Method: POST
- URL:
/v1/coach/sessions/{id}/start-call
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Path Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| id | string | Session ID | Yes |
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