Skip to content

Endpoints

Victor edited this page Apr 27, 2019 · 5 revisions

Conversion table

old new new method
/login /login post
/createaccount /user post
/topicposts /topic/:hash get
/post /post/:hash get
/postcontent /post/:hash/content get
/topics /topics get
/squashedits /post/:hash/squash put
/search /search TBD
/submitpost /post post
/editpost /post/:hash put
/forceeditpost /post/:hash/forcesave put
/editcontent /post/:hash/editcontent get
/submittopic /topic post
/allusers /user get
/unverifiedposts /post/unverified get
/wipposts /post/wip get
TBD
/verifytoken
/verifyemail
/forgotpassword
/forgotpasswordemail
/dashboard
/changepassword
/changeavatar
/postsettings
/profile

Topic Endpoints

/topics - GET

Endpoint to get a list of topics.

With an optional header topicVersion with which the local version can be specified and if the version does not differ on the server the server returns 304

Returns

  • 200: with the topics
  • 304 Not modified: if topicVersion matches server

/topic/:hash - GET

Gets a list of postHashes pertaining to that specific topic

Returns

  • 200: with the postHashes of the topic
  • 404: If the topic does not exist

/topic - POST

Endpoint to create a new topic.

Returns

  • 201 Created: If created succesfully
  • 401 Unauthorized: If user is not logged in.
  • 403 Forbidden: If user is not a admin
  • 409 Conflict: If it conflicts

Post Endpoints

/post - POST

Create a new post

Returns

  • 201 Created: If created succesfully
  • 401 Unauthorized: If user is not logged in.
  • 409 Conflict: If it conflicts

/post/wip - GET

Gets the data (info) of all wip posts

Returns

  • 200: With the info

/post/unverified - GET

Gets the data (info) of all unverified post

Returns

  • 200: With the info

/post/:hash - GET

Gets the data (info) of a post

Returns

  • 200: With the info
  • 404: If post does not exist (or is hidden for the user)

/post/:hash - PUT

Saves a post

Returns

  • 200: Post has been succesfully saved
  • 401 Unauthorized: If user is not logged in.
  • 403 Forbidden: If user is not a admin
  • 404: If post does not exist

/post/:hash/content - GET

Gets the content of a post

Returns

  • 200: With the content
  • 404: If post does not exist (or is hidden for the user)

/post/:hash/editcontent - GET

Gets the editcontent of a post

Returns

  • 200: With the editcontent
  • 404: If post does not exist (or is hidden for the user)

/post/:hash/squash - PUT

Squashes given edits of the specific post

Returns

  • 200: If succesful

/post/:hash/forcesave

Forcefully saves the given post

Returns

  • 200: If succesful

User

/login - POST

Login with given credentials, sets a cookie with the jwt token

Returns

  • 200: on Success
  • 401 Unauthorized: Wrong password/username

/user - POST

Create a new user

Returns

  • 200: on success
  • 409: User already exists

//TODO complete

Utils

//TODO

Main

Home

Frontend

...

Backend

Endpoints

Clone this wiki locally