MobileApp

Update Basic Details

Changed on

Function: update_basic_details Type: API Endpoint (POST)

Purpose: Updates the basic details of an existing template in the database. Validates the input data to ensure all required fields are present and updates the template's information if it exists.

URL: POST /templates/update_basic_details

Request Body:

  • template_code (str, required): The unique code of the template to update.
  • template_name (str, required): The new name for the template.
  • format (str, required): The output format of the template.
  • email_subject (str, required): The subject of the email associated with the template.
  • email_body (str, required): The body content of the email.
  • email_cc (List[str], optional): A list of CC email addresses.
  • email_bcc (List[str], optional): A list of BCC email addresses.
  • status (bool, required): The active status of the template.
  • storage_type (int, required): Storage backend — 0 Internal Azure, 1 SharePoint, 2 Amazon S3, 3 Customer Azure.
  • storage_config (dict, optional): Non-secret per-provider storage settings (incl. credential_profile).
  • file_path (str, optional): The file path of the template.
  • file_name (str, optional): The file name of the template.
  • modified_by (str, required): The user who modified the template.
  • modified_on (datetime, required): The timestamp of when the template was modified.

Response:

  • Returns a JSON object containing the updated template details and a success message if the update is successful.
  • Returns an error message if the template is not found or any required field is missing.

Exceptions:

  • Raises JSONResponse with a 400 status code if any required field is missing or the template is not found.
  • Raises JSONResponse with a 500 status code for any internal server errors.
post/api/MobileApp/templates/update_basic_details

Request

Request body

template_codestring required
template_namestring required
report_typeinteger
formatstring required
email_subjectstring required
email_bodystring required
email_ccstring[] nullable
email_bccstring[] nullable
statusboolean required
storage_typeinteger
storage_configobject nullable
is_containerboolean nullable
file_pathstring nullable
file_namestring nullable
modified_bystring required
modified_onstring date-time required

Response

Successful Response

unknown required

Changes