Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Possible API endpoints
- ## Home
- | Method | Endpoint | Function | Authorization |
- |--------|---------------------------------|-----------------|---------------|
- | GET | / | Home page | Visitor |
- | GET | /[ not "admin" ] | Admin dashboard | Admin |
- ## Users
- | Method | Endpoint | Function | Authorization |
- |--------|-----------------|----------------------------------|--------------------------------|
- | GET | /users/ | return all users | Admin |
- | POST | /users/ | Create new user | Admin |
- | POST | /users/register | create new user | Visitor |
- | POST | /users/login | login | User |
- | GET | /users/logout | logout | Visitor |
- | GET | /users/:userID | Get info for user with id userID | Admin or User with matching ID |
- | PUT | /users/:userID | update user with id userID | Admin or User with matching ID |
- | DELETE | /users/:userID | deactivate user with id userID | Admin |
- ## Adventures
- | Method | Endpoint | Function | Authorization |
- |--------|------------------------------------|------------------------------------------------------|--------------------------------|
- | GET | /adventures | redirect to search? | Visitor |
- | POST | /adventures | add a new adventure | User |
- | GET | /adventures/:advID | return adventure matching with id :advID | Visitor |
- | PUT | /adventures/:advID | edit adventure | Admin or User with matching ID |
- | DELETE | /adventures/:advID | delete adventure | Admin or User with matching ID |
- | GET | /adventures/:advID/comments | return all comments for adventure :advID | Visitor |
- | POST | /adventures/:advID/comments | add new comment to adventure :advID | User |
- | GET | /adventures/:advID/comments/:comID | return comment :comID for adventure :advID | Visitor |
- | PUT | /adventures/:advID/comments/:comID | edit comment :comID for adventure :advID | Admin or User with matching ID |
- | DELETE | /adventures/:advID/comments/:comID | delete comment :comID for adventure :advID | Admin or User with matching ID |
- ## Search
- - Mostly from https://www.reddit.com/r/AdventureLookup/comments/4jqe6d/what_data_do_we_actually_care_about/
- - This is just a sample of possible search params. Someone should go through this once the actual search fields become more apparent.
- | Method | Endpoint | Query | Function | Authorization |
- |--------|----------|----------------------|-----------------------------------------------------------------|---------------|
- | GET | /search? | query=querystring | simple search | Visitor |
- | GET | /search? | q=querystring | simple search | Visitor |
- | GET | /search? | page=pagenum | pagination | Visitor |
- | GET | /search? | limit=100&offset=200 | alternate pagination candidate | Visitor |
- | GET | /search? | title=advtitle | return advs where title matches this | Visitor |
- | GET | /search? | pub=advpublisher | return advs where publisher matches this | Visitor |
- | GET | /search? | ed=edition | return advs where edition matches this | Visitor |
- | GET | /search? | set=setting | return advs where setting matches this | Visitor |
- | GET | /search? | pub=date | return advs where publish date matchis this | Visitor |
- | GET | /search? | minlvl=1 | return advs where min level matches this | Visitor |
- | GET | /search? | maxlvl=20 | return advs where max level matches this | Visitor |
- | GET | /search? | level=5 | return advs where this is between minlvl and maxlvl | Visitor |
- | GET | /search? | sessions=2 | return advs where expected sessions matches this | Visitor |
- | GET | /search? | hours=4 | return advs where expected num of hours matches this | Visitor |
- | GET | /search? | maps=0 or 1 | return advs that have/don't have maps | Visitor |
- | GET | /search? | art=0 or 1 | return advs that have/don't have art | Visitor |
- | GET | /search? | artist=artistname | return advs where artist matches this | Visitor |
- | GET | /search? | rating=rating | return advs where rating matches this | Visitor |
- | GET | /search? | alnmt=good | return advs where alignment matches this | Visitor |
- | GET | /search? | setting=eberron | return advs where setting matches this | Visitor |
- | GET | /search? | locale=underdark | return advs where locale matches this | Visitor |
- | GET | /search? | rr=0 or 1 | return advs that are railroad or sandbox | Visitor |
- | GET | /search? | magic=magiclevel | return advs that are based in a world with high/low/other magic | Visitor |
- | GET | /search? | series=0 or 1 | return advs that are part of a series (or not) | Visitor |
- | GET | /search? | theme=sometheme | return advs where theme matches this | Visitor |
- | GET | /search? | haspcs=0 or 1 | return advs that provide player characters (or don't) | Visitor |
Add Comment
Please, Sign In to add comment