Transcript Routes
routes.transcript_routes.delete_transcript_route()
Deletes a transcript and its associated metadata from both the Voiceflow and the API’s internal databases.
URL:
- POST /delete_transcript
- Parameters:
- transcript_id (str) – The ID of the transcript to delete.
- session_id (str) – The ID of the session associated with the transcript.
- Returns: A message indicating the success of the deletion and the ID of the deleted transcript.
- Return type: JSON response (dict)
Status Codes:
- 200 OK: Transcript deleted successfully.
- 400 Bad Request: Invalid request payload or an error occurred.
- 401 Unauthorized: Assistant session could not be resolved.
routes.transcript_routes.get_transcript_dialog()
Retrieves dialog details from a specific transcript stored in the Voiceflow database.
URL:
- POST /get_transcript_dialog
- Parameters:
- transcript_id (str) – The ID of the transcript from which to retrieve the dialog.
- Returns: The dialog object from the specified transcript or an error message.
- Return type: JSON response (dict)
Status Codes:
- 200 OK: Transcript dialog retrieved successfully.
- 400 Bad Request: Invalid request payload or an error occurred.
- 401 Unauthorized: Assistant session could not be resolved.
routes.transcript_routes.get_transcripts()
Serves as a conduit to retrieve all transcripts associated with the assistant from the Voiceflow database.
URL:
- GET /get_transcripts
- Returns: A list of transcripts or an error message.
- Return type: JSON response (dict)
Status Codes:
- 200 OK: List of transcripts retrieved successfully.
- 400 Bad Request: An error occurred.
- 401 Unauthorized: Assistant session could not be resolved.
Notes
This endpoint primarily acts as a middleman utilizing the retrieve_transcripts method which is shared across several endpoints to standardize transcript retrieval.
Access Control:
- Requires Admin, Master, or Worker roles to retrieve transcripts.
routes.transcript_routes.get_user_transcripts()
Retrieves all transcripts related to a user and their selected assistant from the Voiceflow database.
URL:
- GET /get_user_transcripts
- Returns: A list of transcripts or an error message.
- Return type: JSON response (dict)
Status Codes:
- 200 OK: List of transcripts retrieved successfully.
- 400 Bad Request: Assistant could not be resolved or an error occurred.
- 401 Unauthorized: User session could not be resolved.
Notes
Transcripts are fetched based on the user and assistant sessions retrieved from cookies. The list is then filtered to include only those relevant to the current user.
routes.transcript_routes.update_transcript()
Updates specific fields of a transcript in the Voiceflow database based on provided data.
URL:
- POST /update_transcript
- Parameters:
- data (dict) – Key-value pairs representing the fields to be updated in the transcript.
- Returns: A message indicating the success of the update.
- Return type: JSON response (dict)
Status Codes:
- 200 OK: Transcript updated successfully.
- 400 Bad Request: Invalid request payload or an error occurred.
- 401 Unauthorized: Assistant session could not be resolved.
Access Control:
- Requires Admin, Master, or Worker roles to execute.