Class: Api::SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- Api::SessionsController
- Defined in:
- app/controllers/api/sessions_controller.rb
Overview
REST endpoint for session management. The TUI client uses this to obtain a session ID before subscribing to the WebSocket channel.
Instance Method Summary collapse
-
#create ⇒ JSON
Creates a new conversation session.
-
#current ⇒ JSON
Returns the most recent session or creates one if none exist.
Instance Method Details
#create ⇒ JSON
Creates a new conversation session.
POST /api/sessions
20 21 22 23 |
# File 'app/controllers/api/sessions_controller.rb', line 20 def create session = Session.create! render json: {id: session.id}, status: :created end |