Frequently Asked Question

Register - Upload a template to the system.
Last Updated 8 days ago

Register API

Overview

The Register API allows users to register or update document templates. It stores the template data in base64 format along with metadata such as the user ID, template name, and timestamps.

Version

1.000

Endpoint

/docugen/register

Authentication

This API requires authentication using an API key. The key should be passed in the X_API_Key header.

Request Parameters

Parameter Type Description
f string Function identifier (1 character)
t string Template name (max 40 characters)
d string Template data in BASE64 format

Response

The API returns a JSON object with the following structure:

Field Type Description
status string "ok" if successful, or an error message
template string The name of the registered/updated template (only if successful)
function string The function identifier (only if successful)
data string The size of the template data in bytes (only if successful)

Example Response (Success)


{
  "status": "ok",
  "template": "example_template",
  "function": "A",
  "data": "1024 bytes"
}

Example Response (Error)


{
  "status": "Error saving template"
}

Error Handling

  • If there's an error saving the template: {"status": "Error saving template"}
  • If there's an authentication error: {"status": "[validation status]"}

Notes

  • The API will create a new template if it doesn't exist, or update an existing one if it does.
  • The template data is stored in BASE64 format.
  • The API records both the creation and last update timestamps for each template.

Security

  • Ensure that the API key is kept secure and not exposed in client-side code.
  • Input parameters are filtered to ensure they meet expected formats and lengths.

Limitations

  • The template name is limited to 40 characters.
  • The function identifier is limited to 1 character.
  • The API doesn't provide a way to delete templates, only create or update them.
This website relies on temporary cookies to function, but no personal data is ever stored in the cookies.
OK
Powered by GEN UK CLEAN GREEN ENERGY

Loading ...