NotificationDescriptions.create.call(CreateNotification( notification =Notification( id =null, message ="Something has happened", meta =JsonObject(mapOf("myParameter" to JsonLiteral( coerceToInlineType =null, content ="42", isString =false, )),)), read =false, ts =1704180845770, type ="MY_NOTIFICATION_TYPE", ), user ="User#1234", ), ucloud).orThrow()/*FindByLongId( id = 56123, )*/
Communication Flow: Curl
# ------------------------------------------------------------------------------------------------------# $host is the UCloud instance to contact. Example: 'http://localhost:8080' or 'https://cloud.sdu.dk'# $accessToken is a valid access-token issued by UCloud# ------------------------------------------------------------------------------------------------------# Authenticated as ucloudcurl -XPUT -H "Authorization: Bearer $accessToken" -H "Content-Type: content-type: application/json; charset=utf-8" "$host/api/notifications" -d '{
"user":"User#1234","notification":{"type":"MY_NOTIFICATION_TYPE","message":"Something has happened","id":null,"meta":{"myParameter":42 },"ts":1704180845770,"read":false }}'# {# "id": 56123# }