Handysolver Dummy API
Note:
- Make sure there is no trailing / in the URL
- Add Accept: application/json header to the requests
End points:
Sign up a user
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
Request Method: POST
Auth: Not required
Body params:
- email => type: email, required: true
- password => type: string, required: true
Get all 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
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