MobileApp

Function: update_template Type: API Endpoint (POST)

Purpose:
Updates an existing template in the database.

Request Body:
The request body should contain a JSON object with the following properties:

  • data: A list of template data objects, each with the following properties:
    • id: The ID of the template to update.
    • template_name: The new name of the template.
    • report_code: The report code of the template.
    • is_page: A boolean indicating whether this template is a page.
    • page_list: A list of page IDs if is_page is True.
    • status: A boolean indicating whether the template is active or not.
    • modified_by: The ID of the user who modified the template.
    • modified_on: The date and time when the template was modified.

Response:
The API returns a JSON object with a success message if the update is successful.

Exceptions:

  • Raises JSONResponse with a 400 status code if any of the template IDs do not exist.
  • Raises JSONResponse with a 500 status code for any internal server errors.
post/api/MobileApp/templates/update

Request

Request body

Response

Successful Response

unknown required

Changes