Skip to content

harshit151001/plutusbackend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The following documentation outlines the API endpoints based on requirements of project.


1. Sign Up (Registration) API

Endpoint: /api/signup

Method: POST

Functionality: Allows a new user to create an account.

Headers:

  • Content-Type: application/json

Body Data Parameters:

  • username - Desired username for the new account.
  • email - Email address for the new account.
  • password - Password for the new account.

Authorization Required: No


2. Login API

Endpoint: /api/login

Method: POST

Functionality: Authenticates a user and provides a token for accessing protected endpoints.

Headers:

  • Content-Type: application/json

Body Data Parameters:

  • username - The user's username.
  • password - The user's password.

Authorization Required: No


3. Fetch Posts API (General)

Endpoint: /api/posts/

Method: GET

Functionality: Retrieves a list of all posts.

Headers: None required for this action.

Body Data Parameters: None - The third curl example does not specify any data, suggesting that this endpoint may be a simple GET request without a body.

Authorization Required: No


4. Fetch Posts by User API

Endpoint: /api/posts/?user={user_id}

Method: GET

Functionality: Retrieves a list of posts by a specific user.

Headers: No headers required for this action.

Body Data Parameters: None - The endpoint appears to use a query parameter user to filter posts by the user ID.

Authorization Required: No


5. Create Comment API

Endpoint: /api/comments/

Method: POST

Functionality: Allows a user to add a comment to a post.

Headers:

  • Content-Type: application/json
  • Authorization: Token your_token

Body Data Parameters:

  • post - The ID of the post to comment on.
  • body - The content of the comment.

Authorization Required: Yes - A valid token must be provided in the Authorization header.


6. Like a Post API

Endpoint: /api/likes/

Method: POST

Functionality: Allows a user to like a post.

Headers:

  • Content-Type: application/json
  • Authorization: Token your_token

Body Data Parameters:

  • post - The ID of the post to like.

Authorization Required: Yes - A valid token must be provided in the Authorization header.


7. Create Post API

Endpoint: /api/posts/

Method: POST

Functionality: Allows a user to create a new post.

Headers:

  • Content-Type: application/json
  • Authorization: Token your_token

Body Data Parameters:

  • title - The title of the post.
  • body - The content of the post.

Authorization Required: Yes - A valid token must be provided in the Authorization header.


Note: For Headers requiring the Authorization token, replace your_token with the actual token received after authentication. For Body Data parameters containing the your_ prefix, replace with actual content values when making the request.

This documentation provides a basic overview for each API's functionality and usage. For a full integration, additional details such as error handling, response structures, and status codes should be considered and documented appropriately.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages