You can publish news from the server with the websocket.
You need to emit an event with the following name and data:
Event name: news@publish
| Key | Type | Extra | Description |
|---|---|---|---|
author | string | required | Author of the content (1-64 characters) |
timestamp | number | required | Date (unix ms, UTC) |
content | string | required | News content (1-512 characters) |
Important
Response object must respect every type rule. If any structure isn't respected, your request will be rejected for "bad-request".
{
"author": "Mike Jones",
"timestamp": 1675848916000,
"content": "A bus was burnt on Sunday evening at Vespucci Beach. LSPD is investigating."
}
ID of the created news will be returned.
{
"id": "28ec1ddb-90df-4d96-b114-bc49ef138d22"
}
Powered by Doctave