Handysolver Dummy API

Note:

End points:

Sign up a user

End point:
/api/register

Request Method: POST

Auth: Not required

Body params:

  • name => type: string, required: true
  • email => type: string, required: true
  • passowrd => type: string, required: true
  • confirm_password => type: string, required: true

Get user details and token

End point:
/api/login

Request Method: POST

Auth: Not required

Body params:

  • email => type: email, required: true
  • password => type: string, required: true

Get all posts

End point:
/api/posts

Request Method: GET

Auth: Not required

Get single post by id

End point:
/api/posts/:id

Request Method: GET

Auth: Not required

Create post

End point:
/api/posts/:id

Request Method: POST

Auth: Bearer token

Body params:

  • title => type: string, required: true
  • body => type: string, required: true

Delete post

End point:
/api/posts/:id

Request Method: DELETE

Auth: Bearer token

Get all the comments of a post

End point:
/api/posts/:id/comments

Request Method: GET

Auth: Not required

Create comment

End point:
/api/comments

Request Method: POST

Auth: Bearer token

Body params:

  • post_id => type: id of some post, required: true
  • body => type: string, required: true

Delete comment by it's id

End point:
/api/comments/:id

Request Method: DELETE

Auth: Bearer token