Skip to main content

stream-record

Start Session Recording

Endpoint

  • Method: POST
  • URL: /v1/coach/sessions/{id}/start-recording

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Path Parameters

ParameterTypeDescriptionRequired
idstringSession IDYes

Success Response

{
"success": true,
"message": "تم بدء التسجيل بنجاح",
"data": {
"recording_id": "123",
"status": "recording"
},
"statusCode": 200
}

Error Responses

Session Not Found (404)

{
"success": false,
"message": "الجلسة غير موجودة",
"data": [],
"statusCode": 404
}

Already Recording (400)

{
"success": false,
"message": "يتم التسجيل بالفعل",
"data": [],
"statusCode": 400
}

Unauthorized (401)

{
"success": false,
"message": "غير مصرح",
"data": [],
"statusCode": 401
}

Stream Session Recording

Access the recorded video of a completed session.

Get Session Recording

Retrieve a temporary URL to stream the session recording.

Endpoint

  • Method: GET
  • URL: /v1/coach/sessions/{id}/stream-record

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Path Parameters

ParameterTypeDescriptionRequired
idstringSession IDYes

Success Response

{
"success": true,
"message": "تم جلب البيانات بنجاح",
"data": {
"url": "https://example.com/temporary-url-to-video.mp4"
},
"statusCode": 200
}

Error Response

Session Not Found (404)
{
"success": false,
"message": "لم يتم العثور على الجلسة",
"data": null,
"statusCode": 404
}
No Permission (404)
{
"success": false,
"message": "لا يوجد صلاحية لمشاهدة التسجيل",
"data": null,
"statusCode": 404
}
No Videos Exist (404)
{
"success": false,
"message": "لا يوجد تسجيلات للجلسة",
"data": null,
"statusCode": 404
}
File Not Found (404)
{
"success": false,
"message": "ملف التسجيل غير موجود",
"data": null,
"statusCode": 404
}

Important Notes

  • Access to session recordings is restricted based on user permissions
  • Recordings are only available for completed sessions
  • Temporary URLs expire after 2 hours
  • URLs are cached to improve performance
  • Access is controlled by:
    • User type (Customer/Coach)
    • Session settings
    • Time elapsed since session completion
    • Allowed viewing time period
  • Recordings are stored in MP4 format
  • Each session may have multiple recording segments
  • The system automatically provides the first available MP4 file

Important Notes

  • The start recording endpoint initiates the recording of a session
  • Only the assigned coach can start the recording
  • Recording can only be started once per session
  • The recording status is tracked in real-time
  • The recording ID is returned for future reference
  • Recording automatically stops when the session ends
  • Recording data is stored securely and can be accessed later