Technical Services
Non Insurance Services
Document Components
Print Management
Sidebar On this page

What Is Print Management

This document provides an overview of the Print Management Service in insureMO. It also introduces the basic information about associated services and how they interact with each other.

Print Management Service establishes a relationship between business fields and print fields. It manages print status, the number of prints, and historical data.

As a back-end service, GIMO has developed the front-end for Print Management Service. If other projects need to use this function, they can directly call the API of the Print Management Service or develop their own front-end page.

Print Management architecture

This Print Management Service consists of the following APIs:

  • Generate print tasks
  • Update print tasks
  • Execute print tasks
  • Obtain results
  • Query print task information
  • Query print task history
  • Print multiple tasks
  • Merge multiple task results

With these APIs, users can perform various operations related to print management in insureMO.

Where to Use Print Management

Scenario 1: If you have already utilized the document generation service to generate a document but require an application to manage business fields, such as policy numbers and claim numbers, as well as the interconnections between multiple document generation tasks, the Print Management Service can be employed.

Scenario 2: When you have already used the Word document generation service.

How to Use Print Management

Steps:

1
  1. Upload and manage template
  • Click Sign in to log in to insureMO Portal with your personal account.

    info

    If you do not have a personal insureMO account, click Sign up to register one.

  • Click Catalog at the top of the home page.

  • In the left pane of Catalog page, navigate to Utility & AI > Outout & Document Management to find the Print Management Service service card.

  • Select Template Maintain in the navigation pane of the left side of the page.

  • Click Upload Template on the page. 1 1

  1. Manage print task
  • Select Printing Generation Task in the navigation pane of the left side of the page.

  • Click create task to generate new print task 1
    1

  • Edit print task

  • Execute print task

  • Download print task result

    1
  1. Search print task history
  • Select Print Task History in the navigation pane of the left side of the page.
  • Click the print task id and you will see the print task history. 1

PS: We support word-docgen-service, docgen-service, and jasper-docgen-service. Please make sure the template type is right. And don’t use the jasper as your new template, because we will not support this type as we already have jasper2 (jasper version 6.20.6+).

For default the template type is jasper.

  • Word-docgen-service: the template type is word.
  • Docgen-service: the template type is jasper, the jasper version is 6.4.3.
  • Jasper-docgen-service, the template type is jasper2, the jasper version is 6.20.6. 1

Security

  • Some customers need the password for their pdf, and print task supports the password setting in word-docgen-service and jasper-docgen-service.

For jasper-docgen-service

  • We support two parameters: export_file_password and export_file_owner_password. The export_file_password is the pdf read password, and export_file_owner_password is the pdf edit password.

For word-docgen-service

  • We support one parameter: export_file_password and the export_file_password is the pdf read password.

Mappings of Print Management and Word Docgen Service:

  • For word-docgen-service, we can call the service api directly or call it by the print management api.
    • There is a parameter mapping between these two services.
    • The print_data in print management api is mapping in print/template api of the word-docgen-service.
    • The print_template_parameter in print management api is the instructions in print/template api of the word-docgen-service.
    • The export_file_type in print management api is the outputFormat in print/template api of the word-docgen-service. Please note that the word docgen only supports word and pdf now.
      Jasper-docgen-service supports pdf,docx,xlsx,csv and html.

Develop Steps:

  1. Upload the template in webpage or by API:
    • {{insuremo_gw_url}}/mo-fo/1.0/print/v3/template/upload
  2. Call api to generate a pdf(or other format)
    • {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/create
    • {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/execute
      • This api will return the pdf content as base64 format in targetfilecontent,you don’t need to call the next api to get the result
    • {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/generate
      • This api can create one print task and execute it,it is the merge of last two apis
  3. Get the result on webpage or by api 1
  • {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/get-result-by-id

Deploy Templates:

We now support the packaging and publishing functions for templates.

  1. You need to manage your templates in the portal environment.
  2. Ask the siteops team to copy the print-template-data-job under the mo-template workspace to your DevOps CI/CD service.
  3. After that, you can use this service to package all the templates of the current tenant.
  4. When you click Deploy, these templates will be published to the corresponding target environment under the current tenant.

Audit Template Upload Record

Input the \print-management-service and transaction_name: upload_template and you can check the template upload record. If the content is base64, you can use a tool transfer the base64 to zip file.

Migrate from jasper 6.4.3 to jasper 6.20.0

  • jasper 6.4.3 is not support by the insureMO now, and we plan to remove the docgen-service in the non-prod environment. So, for anyone whose template type is jasper, the printtask will be failed in ptdev since the service is offline now.

  • Please follow the guide to change the template from jasper 6.4.3 to jasper 6.20.0, and reimport to print management and test the whole feature.

  • The template type is jasper, which means the jasper version is 6.4.3. The jasper2 means the jasper version is 6.20.0 and up.

  • img.png
  1. Download the template in the print management and template maintain page.
  2. Open the template by jasper studio 6.20.0 and up: you can download it here: https://community.jaspersoft.com/download-jaspersoft/community-edition/
  3. Make sure the template pdf generation feature works well in local. Then, upload the template to print management again and make sure the template type is jasper2. Finally, test the whole feature in your environment and check the task status and pdf.

Base URLs: {{insuremo_gw_url}}/mo-fo/1.0/print/v3

Changes from V2 to V3

Template Engine

  • V3 supports a configurable template engine routing via config center, in addition to the default print_doc_type based routing.
  • V3 adds html as a new template type (Vender=3).

Response Format

  • For generate API, V3 clears print_data in the response to reduce payload size.
  • For generate and execute APIs, when the print task has an error, V3 returns a structured error code via ModelWithCode instead of a generic 599 error.

V2 → V3 API Mapping

V2 API PathV3 API Path
POST {{insuremo_gw_url}}/mo-fo/1.0/print/v2/template/uploadPOST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/template/upload
GET {{insuremo_gw_url}}/mo-fo/1.0/print/v2/template/downloadGET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/template/download
POST {{insuremo_gw_url}}/mo-fo/1.0/print/v2/printtask/query-manyPOST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/query-many
GET {{insuremo_gw_url}}/mo-fo/1.0/print/v2/printtask/query-oneGET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/query-one
GET {{insuremo_gw_url}}/mo-fo/1.0/print/v2/printtask/get-result-by-idGET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/get-result-by-id
GET {{insuremo_gw_url}}/mo-fo/1.0/print/v2/printtask/get-his-by-taskidGET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/get-his-by-taskid
POST {{insuremo_gw_url}}/mo-fo/1.0/print/v2/printtask/executePOST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/execute
POST {{insuremo_gw_url}}/mo-fo/1.0/print/v2/printtask/execute-allPOST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/execute-all
POST {{insuremo_gw_url}}/mo-fo/1.0/print/v2/printtask/createPOST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/create
POST {{insuremo_gw_url}}/mo-fo/1.0/print/v2/printtask/updatePOST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/update
POST {{insuremo_gw_url}}/mo-fo/1.0/print/v2/printtask/generatePOST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/generate

How to get token

Please refer to this document: insureMO Identity Management - Get Token.

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/template/upload

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/template/upload

Body Parameters

name: "TestDemo"
version: "0"
catalog: "TestDemo"
description: ""
template: ""
template_type: "jasper"

Params

NameLocationTypeRequiredDescription
bodybodyobjectnonone
» namebodystringyestemplate_name
» versionbodystringnoversion
» catalogbodystringnocatalog
» descriptionbodystringnodescription
» templatebodystring(binary)notemplate
» template_typebodystringnotemplate_type,jasper,jasper2,word,html

Response Examples

200 Response

{
"code": "string",
"errors": [
{
"code": "string",
"message": "string",
"message_params": [
"string"
]
}
],
"message": "string",
"message_params": [
"string"
],
"trace_id": "string"
}

Responses

HTTP Status CodeMeaningDescriptionData schema
200OKnoneErrorResponseModel
499UnknownnoneErrorResponseModel
599UnknownnoneErrorResponseModel

GET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/template/download

GET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/template/download

Request Param

NamePositionTypeRequiredDescription
template_namequerystringnonone
versionquerystringnonone
base64querystringnonone
tenant_codequerystringnonone
Authorizationheaderstringnonone
x-mo-target-tenantheaderstringnotarget tenant code

Response

200 Response

{}

Response

Status CodeStatus CodeMeaningDescriptionData Model
200OKSuccessInline

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/query-many

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/query-many

V3 Change: Tenant filtering uses x-mo-target-tenant (TargetTenantCode) directly. The super tenant bypass is removed.

Request Param

NamePositionTypeRequiredDescription
page_sizequerystringYesnone
page_noquerystringYesnone
print_task_idquerystringnonone
business_idquerystringnonone
business_id2querystringnonone
business_id3querystringnonone
business_typequerystringnonone
task_generate_time_startquerystringnonone
task_generate_time_endquerystringnonone
print_statusquerystringnonone
print_status_idquerystringnonone
orderquerystringnonone
tenant_codequerystringnonone
x-mo-target-tenantheaderstringyestarget tenant code
x-mo-user-identityheaderstringnonone

Response

Success

{
"code": "i_common_success",
"message": "request success",
"trace_id": "3238a6e096a10ecf6497d40e2df4758d",
"total": 3302,
"page_size": 10,
"current_page": 1,
"data": [
{
"print_task_id": "c0cd5b34-910c-4e76-a2c6-aac89cadb458",
"print_status": "Printed Successfully",
"print_status_id": 2,
"print_time": "2024-03-27T00:01:05Z",
"print_finish_time": "2024-03-27T00:01:06Z",
"tenant_code_v2": "smktest",
"business_type": "BusinessType2",
"business_id": "businessID1",
"business_id2": "",
"business_id3": "",
"business_id4": null,
"org_code": "OrgCode2",
"dynamic_data": "DynamicData,testonline",
"print_operator": "printerchen1",
"print_count": 1,
"print_task_generate_date": "2024-03-27T00:01:05Z",
"print_task_generate_operator": "chen"
}
]
}

Fail Response

{
"code": "e_print_input_parameter",
"message": "page_size <= 0",
"trace_id": ""
}

Response

Status CodeStatus CodeMeaningDescriptionData Model
200OKSuccessInline
499UnknownFail ResponseInline

GET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/query-one

GET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/query-one

V3 Change: Permission check uses TargetTenantCode strict match instead of TenantCode + CanAccessAllTenant. Error response uses resp.ErrorWithCodeMsg for more structured error format.

Request Param

NamePositionTypeRequiredDescription
print_task_idquerystringyesnone
return_data_formatquerystringnoset to “status” to return only basic status fields
x-mo-target-tenantheaderstringyestarget tenant code

Response

Success

{
"code": "i_common_success",
"message": "request success",
"trace_id": "57594bbd262317162710865023ad0d32",
"data": {
"print_task_id": "bc2bd138-2196-4ec0-93b2-5d98384944e3",
"print_status": "Printed Successfully",
"print_status_id": 2,
"print_time": "2024-03-22T03:31:59Z",
"print_finish_time": "2024-03-22T03:32:00Z",
"tenant_code_v2": "smktest",
"print_doc_type": null,
"template_name": "TestDemo",
"template_version": null,
"print_data_content_type": "json",
"export_file_password": null,
"export_file_owner_password": "",
"export_file_type": "pdf",
"export_file_name": "558560782793687040.pdf",
"storage_config": "not_store",
"async_or_sync": "sync",
"print_data": "{\"docPrintModel\":{...}}",
"print_template_parameter": null,
"business_type": "BusinessType2",
"business_id": "businessID1",
"business_id2": "",
"business_id3": "",
"business_id4": null,
"org_code": "OrgCode2",
"dynamic_data": "DynamicData,testonline",
"print_operator": "printerchen1",
"print_count": 21,
"print_task_generate_date": "2024-03-21T00:01:08Z",
"print_task_generate_operator": "chen",
"err_msg": "",
"tenant_code": "smktest",
"cloud_disk_config": ""
}
}

Fail Response

{
"code": "e_print_input_parameter",
"message": "TenantCode not match with target tenant code,you don't have permission to update this printtask!",
"trace_id": ""
}

Response

Status CodeStatus CodeMeaningDescriptionData Model
200OKSuccessInline
499UnknownFail ResponseInline

GET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/get-result-by-id

GET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/get-result-by-id

V3 Change: Permission check uses TargetTenantCode strict match.

Request Param

NamePositionTypeRequiredDescription
print_task_idquerystringyesnone
base64querystringnobase64, default is false, will download the file
x-mo-target-tenantheaderstringyestarget tenant code

Response

Success (base64=true)

{
"code": "i_common_success",
"message": "request success",
"trace_id": "...",
"data": {
"data": "JVBERi0xLjUK..."
}
}

Success (base64=false or not set)

Returns binary file stream with headers:

  • Content-Type: application/octet-stream
  • Content-Disposition: attachment; filename=<export_file_name>

Fail Response

{
"code": "e_print_input_parameter",
"message": "TenantCode not match with target tenant code!",
"trace_id": ""
}

Response

Status CodeStatus CodeMeaningDescriptionData Model
200OKSuccessInline
499UnknownFail ResponseInline

Return Body

Status Code 499

NameTypeRequiredConstraintDescription
» codestringtruenonenone
» messagestringtruenonenone
» trace_idstringtruenonenone

GET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/get-his-by-taskid

GET {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/get-his-by-taskid

V3 Change: V3 adds TargetTenantCode permission check on history query (V2 history controller had no tenant check).

Request Param

NamePositionTypeRequiredDescription
print_task_idquerystringyesnone
x-mo-target-tenantheaderstringyestarget tenant code

Response

Success

{
"code": "i_common_success",
"message": "request success",
"trace_id": "7422cfd12159af807d71aaa35350ad85",
"data": [
{
"print_task_id": "001ad9c5-8a5d-4ee8-8e02-9bb9b0d56eed",
"print_status": "Printed Successfully",
"print_status_id": 2,
"print_time": "2024-01-14T01:01:47Z",
"print_finish_time": "2024-01-14T01:01:47Z",
"tenant_code_v2": "smktest",
"business_type": "BusinessType2",
"business_id": "businessID1",
"business_id2": null,
"business_id3": null,
"business_id4": null,
"org_code": "OrgCode2",
"dynamic_data": "DynamicData,testonline",
"print_operator": "chen",
"print_count": 1,
"print_task_generate_date": "2024-01-14T01:01:47Z",
"print_task_generate_operator": "chen",
"printTaskHisId": "f52cb869-7982-42f3-ad77-6a474c8bb3c9",
"insert_by": "chen",
"insert_time": "2024-01-14T01:01:47Z",
"insert_reason": "execute"
}
]
}

Fail Response

{
"code": "e_print_input_parameter",
"message": "TenantCode not match with target tenant code!",
"trace_id": ""
}

Response

Status CodeStatus CodeMeaningDescriptionData Model
200OKSuccessInline
499UnknownFail ResponseInline

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/execute

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/execute

V3 Changes:

  • Permission check uses TargetTenantCode strict match.
  • Supports html template type (Vender=3) in addition to jasper/word/jasper2.
  • Uses configurable template engine routing via config center.
  • When print task has error, returns structured error code via ModelWithCode with e_print_failed code.
  • Async execution uses copyBasicParamForAsync to prevent gin.Context recycle panic.

Body Request Param

{
"print_task_id": "001ad9c5-8a5d-4ee8-8e02-9bb9b0d56eed"
}

Request Param

NamePositionTypeRequiredDescription
x-mo-target-tenantheaderstringyestarget tenant code
bodybodyobjectnonone
» print_task_idbodystringYesnone

Response

Success

{
"code": "i_common_success",
"message": "request success",
"trace_id": "204d41519e8f20446459b176ea5c271b",
"data": {
"print_task_id": "001ad9c5-8a5d-4ee8-8e02-9bb9b0d56eed",
"print_status": "Printed Successfully",
"print_status_id": 2,
"print_time": "2024-03-27T00:01:05Z",
"print_finish_time": "2024-03-27T00:01:06Z",
"tenant_code_v2": "smktest",
"export_file_type": "pdf",
"export_file_name": "558560782793687040.pdf",
"storage_config": "store",
"async_or_sync": "sync",
"err_msg": "",
"tenant_code": "smktest",
"cloud_disk_config": "{...}"
}
}

Error in Printing (V3 returns structured error code)

{
"code": "e_print_failed",
"message": "trace:xxx,error message from docgen service",
"trace_id": "...",
"data": {
"print_task_id": "001ad9c5-8a5d-4ee8-8e02-9bb9b0d56eed",
"print_status": "Error In Printing",
"print_status_id": 3,
"err_msg": "trace:xxx,error detail..."
}
}

Fail Response

{
"code": "e_print_input_parameter",
"message": "TenantCode not match with target tenant code!",
"trace_id": ""
}

Response

Status CodeStatus CodeMeaningDescriptionData Model
200OKSuccessInline
499UnknownFail ResponseInline

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/execute-all

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/execute-all

V3 Changes: Same as execute — uses TargetTenantCode, supports html type, configurable engine routing.

Body Request Param

[
{"print_task_id": "001ad9c5-8a5d-4ee8-8e02-9bb9b0d56eed"},
{"print_task_id": "c0cd5b34-910c-4e76-a2c6-aac89cadb458"}
]

Request Param

NamePositionTypeRequiredDescription
x-mo-target-tenantheaderstringyestarget tenant code
bodybodyarraynonone
» print_task_idbodystringYesnone

Response

Success

{
"status": "ok"
}

Fail Response

{
"code": "e_print_input_parameter",
"message": "TenantCode not match with target tenant code!",
"trace_id": ""
}

Response

Status CodeStatus CodeMeaningDescriptionData Model
200OKSuccessInline
499UnknownFail ResponseInline

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/create

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/create

V3 Changes:

  • TenantCode and TenantCodeV2 are set from TargetTenantCode instead of TenantCode.
  • CheckInputParameter for non-word PrintTemplateParameter adds extra validation (checks for "" and null values and clears them).
if you are using the GIMO, please input the parameter like this:
business_id2: proposalNo
business_id3: policyNo
business_id4: endoNo
business_id5: idNo

Body Request Param

{
"business_type": "BusinessType2",
"business_id": "121212121",
"business_id2": "business_id2",
"business_id3": "business_id3",
"business_id4": "business_id4",
"org_code": "OrgCode2",
"print_operator": "smktest",
"template_name": "WordTemplate_delete1",
"template_version": 0,
"print_data": {"name":"chen"},
"dynamic_data": "{\"name\":\"chen\"}",
"export_file_name": "worddemopdf.pdf",
"export_file_type": "pdf",
"export_file_password": "123456!",
"export_file_owner_password": "ownerPwd123!",
"print_data_content_type": "json",
"async_or_sync": "sync",
"storage_config": "store",
"print_doc_type": "word",
"print_template_parameter": [
{
"instructionType": "Transform",
"variableName": "Covers",
"expression": "var Covers = [...]; ...",
"expressionResultType": "list",
"transformResultPath": "Covers"
}
]
}

Request Param

NamePositionTypeRequiredDescription
x-mo-target-tenantheaderstringyestarget tenant code
bodybodyobjectnonone
» business_typebodystringnonone
» business_idbodystringnonone
» business_id2bodystringnonone
» business_id3bodystringnonone
» business_id4bodystringnonone
» org_codebodystringnonone
» print_operatorbodystringYesnone
» template_namebodystringYesnone
» template_versionbodyintegerYesnone
» print_databodyobjectYesJSON object
» dynamic_databodystringYesnone
» export_file_namebodystringYesnone
» export_file_typebodystringYesnone
» export_file_passwordbodystringnonone
» export_file_owner_passwordbodystringnonone
» print_data_content_typebodystringYesnone
» async_or_syncbodystringYesnone
» storage_configbodystringYesnone
» print_doc_typebodystringYesjasper, jasper2, word, or html
» print_template_parameterbody[object]nonone
»» instructionTypebodystringYesnone
»» variableNamebodystringYesnone
»» expressionbodystringYesnone
»» expressionResultTypebodystringYesnone
»» transformResultPathbodystringYesnone

Response

Success

{
"code": "i_common_success",
"message": "request success",
"trace_id": "705716c38bc6c19c6a86dc2f9a982024",
"data": {
"print_task_id": "084a958a-b6fc-4ad8-9761-5d2f4a4fa9ea",
"print_status": "Not Printed",
"print_status_id": 1,
"print_time": null,
"print_finish_time": null,
"tenant_code_v2": "smktest",
"print_doc_type": "word",
"template_name": "WordTemplate_delete1",
"template_version": 0,
"print_data_content_type": "json",
"export_file_password": "123456!",
"export_file_owner_password": "ownerPwd123!",
"export_file_type": "pdf",
"export_file_name": "worddemopdf.pdf",
"storage_config": "store",
"async_or_sync": "sync",
"print_data": "{...}",
"print_template_parameter": "[...]",
"business_type": "BusinessType2",
"business_id": "121212121",
"business_id2": "business_id2",
"business_id3": "business_id3",
"business_id4": "business_id4",
"org_code": "OrgCode2",
"dynamic_data": "{\"name\":\"chen\"}",
"print_operator": "smktest",
"print_count": null,
"print_task_generate_date": "2024-03-27T03:38:54.429321841Z",
"print_task_generate_operator": null,
"err_msg": null,
"tenant_code": "smktest",
"cloud_disk_config": null
}
}

Fail Response

{
"code": "e_print_input_parameter",
"message": "get parameter: templateName are empty !",
"trace_id": ""
}

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/update

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/update

V3 Changes:

  • Permission check uses TargetTenantCode strict match with resp.ErrorWithCodeMsg.
  • DocgenSecurity is always overwritten (V2 only updates when password fields are non-empty).

Body Request Param

{
"print_task_id": "f7a52c93-3ae6-4537-9ec2-cfab80ef1877",
"business_type": "BusinessType2",
"business_id": "121212121",
"business_id2": "business_id2",
"business_id3": "business_id3",
"business_id4": "business_id4",
"org_code": "OrgCode2",
"print_operator": "smktest",
"template_name": "WordTemplate_delete1",
"template_version": 0,
"print_data": {"name":"chen"},
"dynamic_data": "{\"name\":\"chen\"}",
"export_file_name": "worddemopdf.pdf",
"export_file_type": "pdf",
"export_file_password": "123456!",
"export_file_owner_password": "ownerPwd123!",
"print_data_content_type": "json",
"async_or_sync": "sync",
"storage_config": "store",
"print_doc_type": "word",
"print_template_parameter": [
{
"instructionType": "Transform",
"variableName": "Covers",
"expression": "var Covers = [...]; ...",
"expressionResultType": "list",
"transformResultPath": "Covers"
}
]
}

Request Param

NamePositionTypeRequiredDescription
x-mo-target-tenantheaderstringyestarget tenant code
bodybodyobjectnonone
» print_task_idbodystringYesnone
» business_typebodystringYesnone
» business_idbodystringYesnone
» business_id2bodystringYesnone
» business_id3bodystringYesnone
» business_id4bodystringYesnone
» org_codebodystringYesnone
» print_operatorbodystringYesnone
» template_namebodystringYesnone
» template_versionbodyintegerYesnone
» print_databodyobjectYesJSON object
» dynamic_databodystringYesnone
» export_file_namebodystringYesnone
» export_file_typebodystringYesnone
» export_file_passwordbodystringYesnone
» export_file_owner_passwordbodystringYesnone
» print_data_content_typebodystringYesnone
» async_or_syncbodystringYesnone
» storage_configbodystringYesnone
» print_doc_typebodystringYesjasper, jasper2, word, or html
» print_template_parameterbody[object]Yesnone
»» instructionTypebodystringYesnone
»» variableNamebodystringYesnone
»» expressionbodystringYesnone
»» expressionResultTypebodystringYesnone
»» transformResultPathbodystringYesnone

Response

Success

{
"code": "i_common_success",
"message": "request success",
"trace_id": "0900d2773cdf0d3c54ad6b49269aff21",
"data": {
"print_task_id": "f7a52c93-3ae6-4537-9ec2-cfab80ef1877",
"print_status": "Printed Successfully",
"print_status_id": 2,
"print_time": "2024-03-25T06:53:32Z",
"print_finish_time": "2024-03-25T06:53:32Z",
"tenant_code_v2": "smktest",
"print_doc_type": "word",
"template_name": "WordTemplate_delete1",
"template_version": 0,
"print_data_content_type": "json",
"export_file_password": "123456!",
"export_file_owner_password": "ownerPwd123!",
"export_file_type": "pdf",
"export_file_name": "worddemopdf.pdf",
"storage_config": "store",
"async_or_sync": "sync",
"print_data": "{...}",
"print_template_parameter": "[...]",
"business_type": "BusinessType2",
"business_id": "121212121",
"business_id2": "business_id2",
"business_id3": "business_id3",
"business_id4": "business_id4",
"org_code": "OrgCode2",
"dynamic_data": "{\"name\":\"chen\"}",
"print_operator": "smktest",
"print_count": 1,
"print_task_generate_date": "2024-03-25T06:53:24Z",
"print_task_generate_operator": null,
"err_msg": null,
"tenant_code": "smktest",
"cloud_disk_config": "{...}"
}
}

Fail Response

{
"code": "e_print_input_parameter",
"message": "TenantCode not match with target tenant code,you don't have permission to update this printtask!",
"trace_id": ""
}

Response

Status CodeStatus CodeMeaningDescriptionData Model
200OKSuccessInline
499UnknownFail ResponseInline

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/generate

POST {{insuremo_gw_url}}/mo-fo/1.0/print/v3/printtask/generate

Create the printtask and execute directly to generate File.

V3 Changes:

  • Supports html template type (Vender=3).
  • Response clears print_data field (set to empty string) to reduce payload size. V2 returns the full decompressed print_data.
  • When print task has error, returns structured error code via ModelWithCode with e_print_failed code and ReturnBase data, instead of a generic 599 error with full printTask.
  • Uses configurable template engine routing via config center.
if you are using the GIMO, please input the parameter like this:
business_id2: proposalNo
business_id3: policyNo
business_id4: endoNo
business_id5: idNo

Body request param

{
"business_type": "BusinessType2",
"business_id": "121212121",
"business_id2": "business_id2",
"business_id3": "business_id3",
"business_id4": "business_id4",
"org_code": "OrgCode2",
"print_operator": "smktester",
"template_name": "DataMODemo",
"template_version": 0,
"print_data": {
"Policydetails": [
{
"DateofSigning": "44065",
"NameofInsured": "TestInsured",
"PolicyNumber": "FS912020",
"PolicyType": "BuyerW&I"
}
]
},
"dynamic_data": "{\"name\":\"12345678\"}",
"export_file_name": "jasper2.pdf",
"export_file_type": "pdf",
"export_file_password": "123456!",
"export_file_owner_password": "ownerPwd123!",
"print_data_content_type": "json",
"async_or_sync": "sync",
"storage_config": "store",
"print_doc_type": "jasper2"
}

Request Param

NamePositionTypeRequiredDescription
x-mo-target-tenantheaderstringyestarget tenant code
bodybodyobjectnonone
» business_typebodystringnonone
» business_idbodystringnonone
» business_id2bodystringnonone
» business_id3bodystringnonone
» business_id4bodystringnonone
» org_codebodystringnonone
» print_operatorbodystringYesnone
» template_namebodystringYesnone
» template_versionbodyintegerYesnone
» print_databodyobjectYesJSON object
» dynamic_databodystringnonone
» export_file_namebodystringYesnone
» export_file_typebodystringYespdf, docx, xlsx, csv, html
» export_file_passwordbodystringnonone
» export_file_owner_passwordbodystringnonone
» print_data_content_typebodystringYesnone
» async_or_syncbodystringYessync or async
» storage_configbodystringYesstore or not_store
» print_doc_typebodystringYesjasper, jasper2, word, or html
» print_template_parameterbody[object]nonone

Response example

200 Response (V3: print_data is cleared in response)

{
"code": "i_common_success",
"message": "request success",
"trace_id": "...",
"data": {
"print_task_id": "084a958a-b6fc-4ad8-9761-5d2f4a4fa9ea",
"print_status": "Printed Successfully",
"print_status_id": 2,
"print_time": "2024-03-27T03:38:55Z",
"print_finish_time": "2024-03-27T03:38:56Z",
"tenant_code_v2": "smktest",
"print_doc_type": "jasper2",
"template_name": "DataMODemo",
"template_version": 0,
"print_data_content_type": "json",
"export_file_password": "123456!",
"export_file_owner_password": "ownerPwd123!",
"export_file_type": "pdf",
"export_file_name": "jasper2.pdf",
"storage_config": "store",
"async_or_sync": "sync",
"print_data": "",
"print_template_parameter": null,
"business_type": "BusinessType2",
"business_id": "121212121",
"business_id2": "business_id2",
"business_id3": "business_id3",
"business_id4": "business_id4",
"org_code": "OrgCode2",
"dynamic_data": "{\"name\":\"12345678\"}",
"print_operator": "smktester",
"print_count": 1,
"print_task_generate_date": "2024-03-27T03:38:54Z",
"print_task_generate_operator": null,
"err_msg": "",
"tenant_code": "smktest",
"cloud_disk_config": "{...}"
}
}

Error in Printing (V3 structured error response)

{
"code": "e_print_failed",
"message": "trace:xxx,error from docgen service",
"trace_id": "...",
"data": {
"print_task_id": "...",
"print_status": "Error In Printing",
"print_status_id": 3,
"err_msg": "trace:xxx,error detail...",
"print_count": 1,
"tenant_code": "smktest",
"cloud_disk_config": ""
}
}

Fail Response

{
"code": "e_print_input_parameter",
"message": "the template not exist,please check your template and version!",
"trace_id": ""
}

Response Result

Status CodeStatus Code MeaningDescDataModel
200OKOKPrintTask (with print_data cleared)
499Unknown499ErrorResponseModel
599Unknown599ErrorResponseModel

Feedback
Was this page helpful?
|
Provide feedback