Note: Make sure you have a persistent session enabled in whatever you're using to make requests.
##Authentication
GET /api/authTest
POST /api/login
key | type | required |
---|---|---|
username | string | yes |
password | string | yes |
POST /api/logout
##Schools
GET /api/schoolStats
##Users
POST /api/register
key | type | required |
---|---|---|
username | string | yes |
password | string | yes |
givenName | string | yes |
familyName | string | yes |
GET /api/verify?userID=userID&verifier=verifier
POST /api/resendVerification/
key | type | required |
---|---|---|
username | string | yes |
POST /api/requestPasswordReset
key | type | required |
---|---|---|
username | string | yes |
GET /api/resetPassword?userID=userID&verifier=verifier
GET /api/user
PUT /api/user
key | type | required |
---|---|---|
bio | string | no |
gradYear | number | no |
emailSettings | object | no |
familyName | string | no |
givenName | string | no |
password | string | no |
oldPassword | string | * |
* oldPassword is required if password is included
emailSettings: { watchlist: boolean, undercut: boolean, updates: boolean }
DELETE /api/user
GET /api/user/:id
##Avatars
POST /api/avatar
key | type | required |
---|---|---|
file | file | yes |
##Reports
POST /api/report/:id
key | type | required |
---|---|---|
description | string | yes |
##Subscriptions
GET /api/subscriptions
POST /api/subscriptions/clear
POST /api/subscriptions/add/:id
DELETE /api/subscriptions/remove/:id
##Listings
GET /api/listings
POST /api/listings/add/:id
key | type | required |
---|---|---|
sellingPrice | number 0-100 | * |
rentingPrice | number 0-100 | * |
condition | number 0-3 | yes |
* Call must include at least one of these attributes.
GET /api/listings/user/:id
GET /api/listings/book/:id
GET /api/listings/recent?skip=skip&limit=limit
Use skip and limit for pagination.
GET /api/listings/:id
PUT /api/listings/:id
key | type | required |
---|---|---|
sellingPrice | number 0-100 | * |
rentingPrice | number 0-100 | * |
condition | number 0-3 | yes |
* Call must include at least one of these attributes.
DELETE /api/listings/:id
POST /api/listings/complete/:id
##Offers
GET /api/offers
GET /api/offers/:id
POST /api/offers/:id
key | type | required |
---|---|---|
message | string | no |
##Books
GET /api/book/:id
POST /api/book/:id
##Search
GET /api/search?query=query
GET /api/searchUser?query=query
##Activity
GET hitsthebooks.com/api/activities?limit=limit
Return object looks like
[{
userID: string,
ISBN: string,
verb: string['list','exchange'],
when: date
}, ...]
##Errors
key | type | required |
---|---|---|
message | string | yes |
POST /api/errors