(Outgoing) Publish news

Usage

You can publish news from the server with the websocket.

WebSocket event

You need to emit an event with the following name and data:

Event name: news@publish

Object : PartialNews

KeyTypeExtraDescription
authorstring
required
Author of the content (1-64 characters)
timestampnumber
required
Date (unix ms, UTC)
contentstring
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".

Example

{
  "author": "Mike Jones",
  "timestamp": 1675848916000,
  "content": "A bus was burnt on Sunday evening at Vespucci Beach. LSPD is investigating."
}

Response

ID of the created news will be returned.

{
  "id": "28ec1ddb-90df-4d96-b114-bc49ef138d22"
}

What's next?

Powered by Doctave