HTML Files

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
200

HTML file retrieved successfully.

application/json
Responsestring

The HTML file content.

Example: <html><body><h1>Example HTML</h1></body></html>
get
GET /helper/html-files/ HTTP/1.1
Host: api.aikynetix.app
Accept: */*
<html><body><h1>Example HTML</h1></body></html>

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
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
201

File uploaded successfully.

application/json
post
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?