News

Resource Operation Description
DELETE DELETE /v1/news Mark all news as read for the authenticated user.
GET GET /v1/news Return the list of news.
  GET /v1/news/(news_id) Return a specific news.
GET /v1/news

Return the list of news.

Example request:

GET /news HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK

{
  "news": [{
    "id": "28875e88-b66c-4fd3-9faa-cae8a5e408a0",
    "createdAt": "2019-06-17T16:47:05Z",
    "updatedAt": "2019-06-17T16:47:05Z",
    "title": "Hello world",
    "message": "This is a great news !"
  }]
}
Parameters:
  • unread – Returns unread news for the authenticated user
  • limit – Limit the number of results
Response Headers:
 
Status Codes:
DELETE /v1/news

Mark all news as read for the authenticated user.

Example request:

DELETE /news/28875e88-b66c-4fd3-9faa-cae8a5e408a0 HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK

{}
Response Headers:
 
Status Codes:
  • 200 OK – the news has been read.
GET /v1/news/(news_id)

Return a specific news.

Example request:

GET /news/28875e88-b66c-4fd3-9faa-cae8a5e408a0 HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK

{
  "id": "28875e88-b66c-4fd3-9faa-cae8a5e408a0",
  "createdAt": "2019-06-17T16:47:05Z",
  "updatedAt": "2019-06-17T16:47:05Z",
  "title": "Hello world",
  "message": "This is a great news !"
}
Response Headers:
 
Status Codes: