Helper

Retrieve HTML File

get

Retrieves an HTML file stored in Firebase using an encrypted token passed as a query parameter.

Query Parameter

  • token (string, required): Encrypted token representing the user, session, and file name. This token is used to locate and decrypt the corresponding HTML file.

Response (HTTP 200)

On success, returns the content of the HTML file with a Content-Type of text/html.

<html><body><h1>Example HTML</h1></body></html>

Error Handling

  • 400 Bad Request: Returned if the token query parameter is missing or empty.

  • 404 Not Found: Returned if the HTML file cannot be retrieved (e.g., invalid token or file not found).

  • 500 Internal Server Error: Returned if an unexpected error occurs on the server.

Security

No authentication is required for this endpoint.

Query parameters
tokenstringRequired

Encrypted token used to retrieve the HTML file.

Responses
chevron-right
200

HTML file retrieved successfully.

application/json
Responsestring

The HTML file content.

Example: <html><body><h1>Example HTML</h1></body></html>
get
/helper/html-files/

Upload HTML File

post

Uploads an HTML file to Firebase for a specific session. The file must be provided as form-data with a key html_file and have a content type of 'text/html'. Additionally, the session_id must be included in the form-data to associate the file with a session.

Form Data

  • html_file (file, required): The HTML file to be uploaded. Only files with content type 'text/html' are accepted.

  • session_id (string, required): The session ID associated with the uploaded HTML file.

Response (HTTP 201)

On success, returns a JSON object containing:

  • message (string): A confirmation message indicating that the file was uploaded successfully.

  • token (string): An encrypted token representing the file and session information.

Error Handling

  • 400 Bad Request: Returned if required fields are missing (e.g. no file or session ID provided), if the file type is not 'text/html', or if the admin UID is invalid.

  • 404 Not Found: Returned if the session ID does not exist in Firestore. This indicates that the session ID provided does not match any existing session in the database.

  • 422 Unprocessable Entity: Returned if the HTML file processing (e.g., encryption) fails.

  • 500 Internal Server Error: Returned if an unexpected error occurs on the server.

Security

A valid API-KEY token must be provided in the Authorization header.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Body
html_filestringRequired

The HTML file to upload. Must have the content type 'text/html'.

session_idstringRequired

The session ID to associate with the uploaded HTML file.

Responses
post
/helper/html-files/

Retrieve Session Comments

get

Retrieves the report comments for a specific session.

Path Parameter

  • session_id (string, required): The unique identifier of the session for which comments are requested.

Response Structure (HTTP 200)

On success, the response is a JSON object containing language-specific comments. For example:

  • text_summary (object): Contains summary comments in different languages.

    • en (string): Summary in English.

    • ru (string): Summary in Russian.

  • text_contact_angle (object): Contact angle comments.

  • text_push_angle (object): Push angle comments.

  • text_knee_ankle (object): Knee-ankle comments.

  • text_hip_angle (object): Hip angle comments.

  • text_left_ankle_angle (object): Left ankle angle comments.

  • text_left_knee_angle (object): Left knee angle comments.

  • text_right_ankle_angle (object): Right ankle angle comments.

  • text_right_knee_angle (object): Right knee angle comments.

Error Handling

  • 400 Bad Request: Invalid request parameters.

  • 401 Unauthorized: Missing or invalid access token.

  • 403 Forbidden: Insufficient privileges (admin access required).

  • 404 Not Found: Comments not found for the given session.

  • 500 Internal Server Error: An unexpected error occurred on the server.

Security

A valid API-KEY token must be provided in the Authorization header.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Path parameters
session_idanyRequired
Responses
chevron-right
200

Session comments retrieved successfully.

application/json
get
/helper/sessions/{session_id}/report-comments/

Update Session Comments

post

Updates the report comments for a specific session. The request body must include the comment fields for various aspects of the session (e.g., summary, contact angle, push angle, etc.) in multiple languages.

Request Body (JSON)

The following fields are expected (all fields are objects with language keys):

  • text_summary (object): Summary comments (e.g., {'en': 'English text', 'ru': 'Russian text'}).

  • text_contact_angle (object): Contact angle comments.

  • text_push_angle (object): Push angle comments.

  • text_knee_ankle (object): Knee ankle comments.

  • text_hip_angle (object): Hip angle comments.

  • text_left_ankle_angle (object): Left ankle angle comments.

  • text_left_knee_angle (object): Left knee angle comments.

  • text_right_ankle_angle (object): Right ankle angle comments.

  • text_right_knee_angle (object): Right knee angle comments.

Response Structure (HTTP 200)

On success, the response is a JSON object with:

  • message (string): A confirmation message indicating that comments were updated.

Error Handling

  • 400 Bad Request: If the input data is missing or invalid.

  • 401 Unauthorized: If the access token is missing or invalid.

  • 403 Forbidden: If the user does not have admin privileges.

  • 500 Internal Server Error: If an unexpected error occurs on the server.

Security

A valid API-KEY token must be provided in the Authorization header.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Path parameters
session_idanyRequired
Body
Responses
chevron-right
200

Comments updated successfully.

application/json
post
/helper/sessions/{session_id}/report-comments/

Delete Report Comments

delete

Deletes all report comments for a given session.

Request

  • Path Parameter:

    • session_id (string, required): The unique identifier of the session whose report comments will be deleted.

Response Structure (HTTP 200)

On success, the response is a JSON object with:

  • message (string): A success message indicating that the comments have been deleted.

Error Handling

  • 400 Bad Request: Indicates that the request parameters are invalid or that an error occurred during deletion.

  • 401 Unauthorized: The access token is missing or invalid.

  • 403 Forbidden: The user does not have admin privileges to delete report comments.

  • 404 Not Found: The session or report comments were not found.

  • 500 Internal Server Error: An unexpected error occurred on the server.

Security

A valid API-KEY token must be provided in the Authorization header.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Path parameters
session_idanyRequired
Responses
chevron-right
200

Comments deleted successfully.

application/json
delete
/helper/sessions/{session_id}/report-comments/

Last updated

Was this helpful?