-
Notifications
You must be signed in to change notification settings - Fork 0
API Design
API call: POST http://texttrader.com/api/register
Parameters: none
Examples of API calls: texttrader.com/api/register
Request body:
{"username": “Juice”, "password":"178HiHouman!!!", "email":"justin.example@email.com"}
API respond:
{ “success”:true “msg”: “account created” }
API call: POST http://texttrader.com/api/login
Parameters: username – user’s username password – user’s password
Examples of API calls: texttrader.com/api/login
Request body:
{"username": “Juice”, "password":"Password11!!”}
API respond:
{ “success”:true, “payload”: { "userid": 1, "username": “Juice”, "password": JSON Web Token here} }
API call: POST http://texttrader.com/api/post-book
Parameters: none
Examples of API calls: texttrader.com/api/post-book
Request body:
{"title":value, "author":value, "ISBN":"value"}
API respond:
{ “success”: true, “payload”: { "book_id":17, "Title": “Coding for Dummies”, "Author": “Billy Smith”, "ISBN": “978190”, "owner_id": 3} }
API call: DELETE http://texttrader.com/books/bookid?id={value}
Parameters: Bookid – the ID of the book
Examples of API calls: texttrader.com/books/bookid?id=1
API respond: {“success”: true}
API call: GET http://texttrader.com/api/books
Parameters: none
Examples of API calls: texttrader.com/api/books
API respond:
[ {"book_id":17, "Title": “Coding for Dummies”, "Author": “Billy Smith”, "ISBN": “978190”, "owner_id": 3}, {"book_id":17, "Title": “Anthropology”, "Author": “Anne Davis”, "ISBN": “117357”, "owner_id": 1} ]
API call: GET http://texttrader.com/api/books/title?title={value}
Parameters: title - the title of the book
Examples of API calls: texttrader.com/api/books/title?title=“anthropology”
Request body:
{"title": “Anthropology”}
API respond:
{"title": “Anthropology”, "author": “Anne Davis”, "ISBN": “117357”}
Text Trader is a collaborative project with the students at Cascadia College's Mobile Application Development program in conjunction with Washington State Board for Community and Technical Colleges.