Skip to content

HackerYou/listed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Listed API

Listed API is the definitive list making API for your list making application needs!

This API was built for a React & Redux workshop. No keys / no auth, just fun and learning!

Routes

All requests need to be prefixed with http://lists.hackeryou.com

Lists

/list

GET Return All Lists

Sample Response

[
  {
    "_id": "5a208081ee97e351d81e5cc5",
    "title": "Best Pizza",
    "__v": 0,
    "items": [
      {
        "_id": "5a2080aaee97e351d81e5cc6",
        "item": "Maker Pizza",
        "created_at": 1512079530916,
        "score": 192
      },
      {
        "_id": "5a2080afee97e351d81e5cc7",
        "item": "Terroni",
        "created_at": 1512079535629,
        "score": 23
      },
      {
        "_id": "5a2080baee97e351d81e5cc8",
        "item": "Old Man Pizza & Wings",
        "created_at": 1512079546455,
        "score": 2
      }
    ]
  },
  {
    "_id": "5a208081ee97e351d81e5345",
    "title": "Best James Bond",
    "__v": 0,
    "items": [
      {
        "_id": "5a2080aaee97e351d81e5cc6",
        "item": "Sean Connery",
        "created_at": 1512079530916,
        "score": 45
      },
      {
        "_id": "5a2080afee97e351d81e5cc7",
        "item": "Daniel Craig",
        "created_at": 1512079535629,
        "score": 64
      },
      {
        "_id": "5a2080baee97e351d81e5cc8",
        "item": "Pierce Brosnan",
        "created_at": 1512079546455,
        "score": 5
      }
    ]
  }
]

POST Post A New List

Params Value Description
title : string list title required

Example: http://lists.hackeryou.com/list/

Sample Response

{
  "message": "List successfully added!",
  "list": {
    "__v": 0,
    "title": "Best Pizza Topping",
    "_id": "5a20b1c606c60352769f970b",
    "items": []
  }
}

/list/:listId

GET Return List By Id

Example: http://lists.hackeryou.com/list/5a208081ee97e351d81e5cc5

Sample Response

{
  "_id": "5a208081ee97e351d81e5cc5",
  "title": "Best Pizza",
  "__v": 0,
  "items": [
    "5a2080aaee97e351d81e5cc6",
    "5a2080afee97e351d81e5cc7",
    "5a2080baee97e351d81e5cc8",
    "5a2080cfee97e351d81e5cc9",
    "5a2080d5ee97e351d81e5cca"
  ]
}

Adding Items To Lists

/list/:listId/item

POST Post Item To List

Params Value Description
item : string list item required

Sample Response

{
  "message": "Item successfully added!",
  "item": {
    "__v": 0,
    "item": "Pineapple",
    "belongs_to": "5a20b1c606c60352769f970b",
    "created_at": 1512092768230,
    "_id": "5a20b46006c60352769f970c",
    "score": 0
  }
}

Updating Items

/item/:itemId

POST Update

Params Value Description
item: string some new text
belongs_to: string listId unique id for list
score: number updated score

Sample Response

{
  "message": "item updated!",
  "item": {
    "_id": "5a20b46006c60352769f970c",
    "item": "Pineapple",
    "belongs_to": "5a20b1c606c60352769f970b",
    "created_at": 1512092768230,
    "__v": 0,
    "score": 50
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published