How to enable message integration
Assuming that single sign-on has been integrated (such as integration based on WeCom, DingTalk, WeLink, Feishu, or Organization Structure Sync API which is equivalent to enabling single sign-on), the HAP system supports pushing application messages to external systems, and can also be customized by the HAP team to integrate with external systems [custom development will incur additional charges].
To actively receive application messages from HAP:
-
If not based on integration with WeCom, DingTalk, WeLink, Feishu, or Organization Structure Sync API, you need to mount the following configuration file in advance:
/data/hap/script/volume/sso/extend.json:{"relation": true}Add the following to
docker-compose.yamlvolumescorresponding microservice application:- ./volume/sso/extend.json:/usr/local/MDPrivateDeployment/sso/extend.json -
Create the configuration file required to receive application messages:
/data/hap/script/volume/integrate/appextensions.json:{"WebhookUrl": "https://api.yourdomain.com/message/webhook","FinishTodoWebhookUrl": "https://api.yourdomain.com/todo/webhook","WebhookHeaders": {}}Configuration Parameters:
- WebhookUrl: Required, the API endpoint for receiving messages.
- FinishTodoWebhookUrl: Optional, the API endpoint for receiving to-do messages. No need to configure if to-do status sync is not required.
- WebhookHeaders: Optional, custom request headers for authentication and other purposes.
-
Message Body Specification
HAP sends JSON data to
WebhookUrlviaPOSTwithapplication/jsonformat.Message Push Format:
{"messageId": "Message Id","message": "Message Content","messageType": 11,"messageTypeV2": 11,"appId": "App Id","appName": "App Name","attachments": ["Attachment Link|Attachment Name"],"redirectUrl": "Redirect URL","targets": ["User Id"],"projectId": "Organization Id","createUserId": "Creator","processId": "Process Id"}Field Description messageType11: Worksheet system message, 12: Mentions in worksheet discussion, 13: Replies in worksheet discussion, 14: To-do message in workflow (fill in, approval, system message with sending record), 15: Workflow system message without sending record messageTypeV211: Worksheet system message, 12: Mentions in worksheet discussion, 13: Replies in worksheet discussion, 14: To-do message in workflow (fill in, approval), 15: Workflow system message without sending record, 16: Workflow system message with sending record attachmentsImages can be used directly; document types currently only serve as a reminder of the number of attachments (cannot be downloaded directly) redirectUrlCorresponding to the landing page for message processing in the HAP system targetsThird-party user ID in single sign-on createUserIdThird-party user ID in single sign-on; empty for system-triggered messages processIdOnly available for workflow messages Completed To-do Push Format:
{"messageId": "Message Id","projectId": "Organization Id","userId": "Operator","processId": "Process Id"} -
Mount the configuration file
appextensions.jsonto the microservice container at/usr/local/MDPrivateDeployment/integrate/appextensions.json.Add the following to the
docker-compose.yamlvolumesof the microservice application:- ./volume/integrate/appextensions.json:/usr/local/MDPrivateDeployment/integrate/appextensions.json -
Restart the HAP microservice application