You are on page 1of 4

FeedND API

HW #4
Author: Edwin Onattu
Date: March 30, 2015
Overview
All API calls documented here consist of an HTTP method and a relative path.
The path is relative to a configurable base URL.
Requests
API calls receive requests in JSON format.
Please only send parameters as documented.
Responses
Responses are in either in JSON or HTML.
Resource Overview
/orders
/orders/{orderID}/items/{orderItemID}
/users/registration (or you can use /users/me)
/restaurants
/restaurants/{restID}/categories
/restaurants/{restID}/categories/{catID}/items
/restaurants/{restID}/categories/{catID}/items/{itemID}

/users/registration
ACTION
GET /users/registration
POST /users/registration

DESCRIPTION
Prepares user registration Page
Inserts a User to the Users Table in SQl

JSON Form:
POST {phone: ,errors: [], password: , name: , email: }

/orders/
ACTION
GET /orders/
PUT /orders/
POST /orders/
DELETE /orders/{orderID}

DESCRIPTION
Get Page Description of all orders
Add or update item to order quantity
Insert into orders
Delete an order

JSON Form:
GET {orderId, quantity, itemID, price, placed, href }
PUT {orderId, errors:[]}
POST {errors:[]}
DELETE {errors:[]}

/orders/{orderID}/orderItems
ACTION
GET /orders/{orderID}/orderItems/{itemID}
PUT /orders/{orderID}/orderItems/{itemID}
DELETE
/orders/{orderID}/orderItems/{itemID}

DESCRIPTION
Get orderItemId, quantity
Add or Update an orderItem to an order
Delete an orderItem with orderID and itemID

JSON Form:
GET {orderItemId, quantity, errors:[] }
PUT {orderItemID, orderID, itemID, quantity, errors:[]}

DELETE {errors:[]}

/restaurants/
ACTION
GET /restaurants/{restID}
GET /restaurants/
POST /restaurants/
PUT /restaurants/{restID}

DESCRIPTION
Returns description of command
Get info about restaurants nearby
Returns description of command
Returns description of command

DELETE /restaurants/{restID}

Returns description of command

JSON Form:
GET {name, lat, long, address, city, state, url, href}

/restaurants/{restID}/categories/
ACTION
GET /restaurants/{restID}/categories/
GET /restaurants/{restID}/categories/catID
PUT /restaurants/{restID}/categories/catID
POST /restaurants/{restID}/categories/
DELETE /restaurants/{restID}/categories/catID

DESCRIPTION
Get list of categories for a Restaurant
Returns description of command
Returns description of command
Returns description of command
Returns description of command

JSON Form:
GET {href, name}

/restaurants/{restID}/categories/{catID}/items/
ACTION
GET /restaurants/{restID}/categories/{catID}/items/

DESCRIPTION
Returns list of items for categories for a
restaurant

GET
/restaurants/{restID}/categories/{catID}/items/itemID
POST /restaurants/{restID}/categories/{catID}/items/
PUT
/restaurants/{restID}/categories/{catID}/items/itemID
DELETE
/restaurants/{restID}/categories/{catID}/items/itemID
JSON Form:
GET {href, name, description, price}

Returns description of command


Returns description of command
Returns description of command
Returns description of command

You might also like