Notice Message Produce¶
Create and send notice messages, and the message will appear in the pop-up window of the end-user interface. Before using this API, please note:
If the message ID already exists in the OU, only the message is sent; if it does not exist, a new message is created and sent.
Supports creating or sending multiple messages at the same time, and up to 100 messages can be sent at a time. But if any of them fails, all of them fail.
When you send existing messages, the content of existing messages cannot be modified through this API.
If some users do not exist or are not in the OU in the specified user ID, they will be automatically filtered and no errors will be reported, and messages will continue to be sent to the remaining users.
Prerequisites¶
The OU has obtained the application, or the application is a self-built application in the OU.
Request Format¶
POST https://{apigw-address}/app-portal/api/v3/notice-message/produce
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Required |
String |
OU ID. How to get orgId >> |
Request Parameters (Body)¶
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
messages |
Required |
MessageProduceDTO structure |
Message list. Supports creating or sending multiple messages at the same time, and up to 100 messages can be sent at a time. But if any of them fails, all of them fail. MessageProduceDTO Struct >> |
MessageProduceDTO structure ¶
Note:
appName
,features
,body
,header
, andtag
need to be provided in international structure format, see Internationalized name struct.If some user IDs in the
targets
do not exist or are not in the OU, they will be automatically filtered and no errors will be reported, and messages will continue to be sent to the remaining users.When sending existing messages, the existing messages cannot be modified or pushed to the sent user again, nor can the message be withdrawn through this API.
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
messageId |
Required |
String |
Message ID. If the message ID already exists in the OU, only the message will be sent, and the changes to the message content in the following parameters are invalid. If the message ID does not exist, a new message will be created and sent. |
messageType |
Optional |
Number |
Message type. If you need to create and send a new message, that is, |
appId |
Optional |
String |
The application accessKey associated with the message. If the application is an external application, it must be left blank. If only existing messages need to be sent, any value of this parameter is invalid. |
appName |
Optional |
Object |
The name of the external application, must be filled in when the associated application is an external application. At this time Note: If you need to associate multiple messages with an external application, you must ensure that the internationalized structure of each |
url |
Optional |
String |
A external link displayed in the message. The end user can jump to the URL by clicking the message title. If you specify |
linkedAppId |
Optional |
String |
The application ID associated with the message. |
linkedMenuCode |
Optional |
String |
The menu ID within the application that is associated with the message. |
linkedStates |
Optional |
String |
Other custom parameters in the URL. |
features |
Optional |
Object |
A multilingual description of the link, displayed in a pop-up window as a supplementary description of the link. If you need to display the description, specify at least one of |
body |
Optional |
Object |
Multilingual content of the message. If you need to display the message body, specify at least one of |
Header |
Optional |
Object |
Multilingual title of the message. If you need to display the message title, specify at least one of |
tag |
Optional |
List |
The message tags to be displayed. Supports multiple languages. If you need to display the tag, specify at least one of |
targetType |
Optional |
Map |
The type of the message receivers. If you need to create and send a new message, this parameter is required. The following values are supported:
If only existing messages need to be sent, any value of this parameter is invalid. |
targets |
Optional |
List |
List of user IDs sent by the message. When |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
Boolean |
Whether the message was sent successfully. |
Samples¶
Request Sample¶
url: https://{apigw-address}/app-portal-service/v2.2/notice-message/produce?orgId=your_org_id
method: POST
requestBody:
{
"messages": [
{
"messageId": "yourMessageId",
"messageType": 1,
"url": "http://xxx.com",
"targetType": 1,
"targets": ["u123", "u456"],
"appId": "yourAppAccessKey",
"appName": {
"defaultValue": "appName",
"i18nValue": {"zh_CN": "appNameZh", "en_US": "appNameEn"}
},
"header": {
"defaultValue": "header",
"i18nValue": {"zh_CN": "headerZh", "en_US": "headerEn"}
},
"body": {
"defaultValue": "body",
"i18nValue": {"zh_CN": "bodyZh", "en_US": "bodyEn"}
},
"tags": [
{
"defaultValue": "tag1",
"i18nValue": {"zh_CN": "tag1Zh", "en_US": "tag1En"}
},
{
"defaultValue": "tag2",
"i18nValue": {"zh_CN": "tag2Zh", "en_US": "tag2En"}
}
],
"features": [
{
"defaultValue": "feature1",
"i18nValue": {"zh_CN": "feature1Zh", "en_US": "feature1En"}
},
{
"defaultValue": "feature2",
"i18nValue": {"zh_CN": "feature2Zh", "en_US": "feature2En"}
}
]
}
]
}
Return Sample¶
{
"code": 0,
"message": "",
"data": {
"success": true
}
}