Skip to content
Daniel Chabr edited this page Nov 9, 2015 · 7 revisions

Meals API

GET /meals?query=kimchi&limit=20&start=20

  • parameter: none
  • returns: JSON array of all meals
  • if a query parameter is provided, the results will be filtered
  • results should be paginated.
  • status code indicates success, 200 OK
  • default limit: 10
  • default start: 0 Ex. { "limit" : 10, "start" : 0, data : [{...}, {...}, ...] }

GET /meals/{ID}

  • parameter: none
  • returns: JSON meal object
  • status code indicates success, 200 OK

POST /meals/images/upload

GET /meals/images/{id}

  • parameter: none
  • returns: image file
  • status code indicates success, 200 OK

POST /meals

  • parameter: JSON meal object
  • returns: nothing
  • status code indicates success, 201 created

PUT /meals/{ID}

  • parameter: JSON meal object
  • returns: nothing
  • updates existing meal object with the specified ID
  • status code indicates success, 200 OK

DELETE /meals/{ID}

  • parameter: none
  • returns: nothing
  • deletes meal with the specified ID
  • status code indicates success, 200 OK

Users API

POST /users

  • parameter: JSON user object
  • returns: nothing
  • registers new user
  • status code indicates success, 201 created

POST /users/authenticate

  • parameter: JSON containing username/email and password
  • returns: JSON user object containing also token which will be used for sending further requests in HTTP headers to authenticate user's actions
  • signs in the user
  • status code indicates success, 200 OK

PUT /users

  • parameter: JSON user object
  • returns: nothing
  • updates user object
  • status code indicates success, 200 OK

DELETE /users/authenticate

  • parameter: JSON user object
  • returns: nothing
  • logs out the user
  • status code indicates success, 200 OK

External API

POST /api/transliterate

  • parameter: {"hangul": "...."}
  • return: {"latin": "..."}

POST /api/translate

  • parameter: {"korean": "...."}
  • return: {"english": "..."}