*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处

UserNotification

代表向用户发送的通知。

属性

pathstring

用户通知的资源路径。

格式:users/{user_id}/notifications/{user_notification_id}.

idstring
仅输出

用户通知的独特 UUID。.

sourceobject

通知的来源。.

payloadobject

通知付载。.

基本网址

https://apis.roblox.com
UserNotification 资源

{
"path": "users/123/notifications/01234567-ABCD-1234-ABCD-0123456789AB",
"id": "a6746f2e-2cc6-11ee-be56-0242ac120002",
"source": {
"universe": "universes/96623001"
},
"payload": {
"type": "TYPE_UNSPECIFIED",
"messageId": "5dd7024b-68e3-ac4d-8232-4217f86ca244",
"parameters": {
"key": {
"stringValue": "bronze egg"
}
},
"joinExperience": {
"launchData": "Launch Data"
},
"analyticsData": {
"category": "Bronze egg hatched"
}
}
}

UserNotification

创建用户通知

POST /cloud/v2/users/{user_id}/notifications

向用户发送通知。

范围
user.user-notification:write
请求路径参数
user_idstring
必填

用户ID。.

请求正文UserNotification
POST /cloud/v2/users/{user_id}/notifications

curl -L -X POST 'https://apis.roblox.com/cloud/v2/users/{user_id}/notifications' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{
"source": {
"universe": "universes/96623001"
},
"payload": {
"type": "TYPE_UNSPECIFIED",
"messageId": "5dd7024b-68e3-ac4d-8232-4217f86ca244",
"parameters": {
"key": {
"stringValue": "bronze egg"
}
},
"joinExperience": {
"launchData": "Launch Data"
},
"analyticsData": {
"category": "Bronze egg hatched"
}
}
}'
答复

{
"path": "users/123/notifications/01234567-ABCD-1234-ABCD-0123456789AB",
"id": "a6746f2e-2cc6-11ee-be56-0242ac120002"
}