Class: Proctoring::Api::V1::HundredMs::ServicesController

Inherits:
Proctoring::ApplicationController show all
Defined in:
app/controllers/proctoring/api/v1/hundred_ms/services_controller.rb

Instance Method Summary collapse

Methods inherited from Proctoring::ApplicationController

#authenticate_api_token, #authenticate_app_token

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/proctoring/api/v1/hundred_ms/services_controller.rb', line 9

def create
  hundred_ms_response = JSON.parse(request.raw_post)

  case hundred_ms_response['type']
  when 'recording.success'
    data = hundred_ms_response['data']
    room_name = data['room_name']
    invitation_code = room_name.split('-').first
    ProctoringStorageHelper.initiate_processing(invitation_code)
  end

  render json: { success: true }
end