HTML Files
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.
Encrypted token used to retrieve the HTML file.
HTML file retrieved successfully.
The HTML file content.
<html><body><h1>Example HTML</h1></body></html>
Bad Request - Returned if the token
parameter is missing or empty. Ensure that the token is provided in the query string.
Not Found - Returned if the HTML file cannot be retrieved. This may be due to an invalid token or if the file does not exist.
Internal Server Error - Returned if an unexpected error occurred on the server. Check the error details for further information.
GET /helper/html-files/ HTTP/1.1
Host: api.aikynetix.app
Accept: */*
<html><body><h1>Example HTML</h1></body></html>
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.
The HTML file to upload. Must have the content type 'text/html'.
The session ID to associate with the uploaded HTML file.
File uploaded successfully.
Bad Request - Returned if required fields are missing (e.g., no file provided, session ID missing), if the file type is invalid (only HTML files are allowed), or if the admin UID is invalid.
Not Found - Returned if the session ID does not exist in Firestore.
Unprocessable Entity - Returned if the HTML file processing (e.g., encryption) fails.
Internal Server Error - Returned if an unexpected error occurs on the server.
POST /helper/html-files/ HTTP/1.1
Host: api.aikynetix.app
Authorization: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 40
"html_file='text'&session_id='text'"
{
"message": "text",
"token": "text"
}
Last updated
Was this helpful?