MobileApp
Create Template Pages
Changed onFunction: create_template_pages Type: API Endpoint (POST)
Purpose: Creates new template pages in the database for the provided template data. It assigns a unique report_seq to each report and adds the new pages to the database.
URL: POST /templates/create_template_pages
Headers:
- Customer_Key (str, required): Encoded customer key for authorization.
Request Body:
- template_data (TemplatePagesRequest): The data for the template, including application code, report code, template name, and other details.
Process:
- Decode and validate the Customer_Key.
- Iterate through each item in template_data.
- Generate a unique report_seq for each report.
- Check if a report already exists for the report code.
- If not existing, create new template pages and add them to the database.
- Commit changes for each report separately.
Response:
- Returns a success message if the template pages are created successfully.
- Returns error messages if the customer key is invalid, the template code is invalid, or a database error occurs.
Error Handling:
- Catches exceptions and returns a 500 error with the exception message.
post/api/MobileApp/templates/create_template_pages
Request
- Base URLhttps://api.leapsurgebi.com (the document declares no server; this is the origin it was published from)
- AuthOAuth 2PasswordToken URL/auth/token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Customer-Keystring required
Request body
Response
Successful Response
unknown required
Changes
- info
endpoint added
- info