Skip to content

Latest commit

 

History

History
89 lines (65 loc) · 1.48 KB

14_Motd.md

File metadata and controls

89 lines (65 loc) · 1.48 KB

MOTD

Retrieving MOTD information

This call returns information for the current MOTD (message of the day).

Definition

GET /api/v1/motd

Example Request

$ curl 'https://api-news.layervault.com/api/v1/motd?client_id=abc123'

Example Response

{
  "motd": {
    "downvote_count": 0,
    "message": "What was your first Mac? https://www.apple.com/30-years/your-first-mac/",
    "upvote_count": 6,
    "user_display_name": "Wells R.",
    "user_id": 272
  }
}

Upvoting an MOTD

This call upvotes the current MOTD.

Definition

POST /api/v1/motd/upvote

Example Request

$ curl -H 'Authorization: Bearer <your access token>' \
  -X POST \
  'https://api-news.layervault.com/api/v1/motd/upvote'

Example Response

{
  "motd": {
    "downvote_count": 0,
    "message": "What was your first Mac? https://www.apple.com/30-years/your-first-mac/",
    "upvote_count": 7,
    "user_display_name": "Wells R.",
    "user_id": 272
  }
}

Downvoting an MOTD

This call downvote the current MOTD.

Definition

POST /api/v1/motd/downvote

Example Request

$ curl -H 'Authorization: Bearer <your access token>' \
  -X POST \
  'https://api-news.layervault.com/api/v1/motd/downvote'

Example Response

{
  "motd": {
    "downvote_count": 1,
    "message": "What was your first Mac? https://www.apple.com/30-years/your-first-mac/",
    "upvote_count": 6,
    "user_display_name": "Wells R.",
    "user_id": 272
  }
}