The Gateway Message Interface illustrate
- Access method: The gateway provides a message-related interface.Please go to the gateway to subscribe to the interface for using the interface.
- Developer background :https://openplatform-portal.dg-work.cn/portal/#/
- Gateway callback request:
Content-Type:application/x-www-form-urlencoded;charset=UTF-8
- the message event of the tenant where the application is located will be registered, and the registration party will not receive messages from other tenants.If it is a self-built app, this interface will register themessage event of government tenantsauthorized by app.
- Callback address of callbackUrl message only supports ip
In addition, when requesting this interface, the message gateway will send a message of verifying connectivity to callbackUrl. The callback interface must be “POST”, and the message “body” is as follows
{
"eventTag": "MOZI_VDS_TENANT_CHANGE|ORGANIZATION_ADD_UPDATE",
"dispatchId": "0e276c97-c3f9-44c2-88ab-335123991c45"
}
Callback example for registration party:
{
"errcode": "0",
"errmsg": "成功"
}
Request example of message callback:
{
"dispatchId": "0e276c97-c3f9-44c2-88ab-335123991c45",
"sourceMessageId": "原消息id,订阅方请忽略",
"callbackMessageId": "转发后的消息id,订阅方请忽略",
"content": {...}
}
Example for return results of message callback:
{
"errcode": "0",
"errmsg": "成功"
}
Troubleshooting for registration failure
1.All callback interfaces must be POST
2. Registration callback and Return results must be:
{
"errcode": "0",
"errmsg": "成功"
}
Callback strategy: If the registration callback fails,the interval will be incremented, calling a total of 16 times with a total of 4 hours (which is the same as the mq retry rule). If all the 16 times fail, you can refer to the failed list through the api.
Access of Gateway message to eventTag
Classification | Function | eventTag | Example of message content |
---|---|---|---|
Contacts | Add/update organization | MOZI_VDS_TENANT_CHANGE|ORGANIZATION_ADD_UPDATE | { “tag”: “员工/组织变动类别”, “tenantId”: “租户ID”, “organizationCodes”: “组织的CODE列表”, “employeeCodes”: “员工的CODE列表” } |
Organize and change parent group | MOZI_VDS_TENANT_CHANGE|ORGANIZATION_PARENT_CHANGED | ||
Delete organization | MOZI_VDS_TENANT_CHANGE|ORGANIZATION_REMOVE | ||
Add/update organization | MOZI_VDS_TENANT_CHANGE|EMPLOYEE_ADD_UPDATE | ||
Delete staff | MOZI_VDS_TENANT_CHANGE|EMPLOYEE_LEAVE | ||
Associated staff to the organization | MOZI_VDS_TENANT_CHANGE|ORGANIZATION_ATTACH_EMPLOYEE | ||
Dissociated staff to the organization | MOZI_VDS_TENANT_CHANGE|ORGANIZATION_DETACH_EMPLOYEE | ||
Mozi account change | Modify account name | MOZI_BUC_ACCOUNT_MODIFY_REALM|change_account_name | { “Namespace”: “账号类型,默认是local”, “AccountType”: “账号类型-数字”, “Account”: “账号名”, “RealmId”: “租户ID-long型”, “AccountId”: “账号ID-long型”, “EmployeeCode”: “员工CODE”, “Source”: “消息源头”, “TimeStamp”: “时间戳-long” } |
Freeze account | MOZI_BUC_ACCOUNT_MODIFY_REALM|frozen | ||
Unfreeze account | MOZI_BUC_ACCOUNT_MODIFY_REALM|unfrozen | ||
Open platform application notification | App update | openplatform_app_update|openplatform_app_update_tag | { “appName”: “应用名称”, “realmId”: “租户ID”, “updateType”: “” } |
Notification Center | Event of sending Message successfully | notification_send_event|SendSuccessMsg | { “bizMsgId”:”消息id”, “tenantId”:”租户ID”, “status”:”success”, “successTime”:”成功时间,毫秒时间戳” } |
Receipt event of client message | notification_client_ack|SuccessAcceptMsg | { “msgId”:”消息id”, “tenantId”:”租户ID”, “bizChannel”:”通知类型”, “ackTime”:”接收时间,毫秒时间戳” } |
|
Sending message successfully | notification_client_ack|nc-outBound-msg_pushed | { “msgType”: “消息场景”, “msgApp”: “发送方appname”, “receivers”: [“1001”],//接收者,业务方的传入 “bizMsgId”:”业务方传入的消息id” } |
|
Failing to send message | notification_client_ack|nc-outBound-msg_fail | { “msgType”: “消息场景”, “msgApp”: “发送方appname”, “receivers”: [“1001”],//接收者,业务方的传入 “bizMsgId”:”业务方传入的消息id” } |
|
User message has been withdrawn | notification_client_ack|nc-outBound-msg_revoked | { “msgType”: “消息场景”, “msgApp”: “发送方appname”, “receivers”: [“1001”],//接收者,业务方的传入 “bizMsgId”:”业务方传入的消息id” } |
|
User message has been read | notification_client_ack|nc-outBound-msg_read | { “msgType”: “消息场景”, “msgApp”: “发送方appname”, “receivers”: [“1001”],//接收者,业务方的传入 “bizMsgId”:”业务方传入的消息id” } |
|
DING Event | DING sends a failure event and returns to the failed user ID | ding_create_event|FAILED_ACCOUNT_ID | { “tag”:””, “tenantId”:”租户ID”, “accountId”:”失败用户ID” } |