This document provides information about the features and usage of the Notes API.
Framework : DRF, DB : PostgresDB (ElephantSQL cloudDB instance), DB Index : GinIndexes, , Authentication Mechanism: Token Based (JWT)
The API uses token-based authentication using JSON Web Tokens (JWT). To access protected endpoints, you need to include the generated token in the Authorization
header of your requests.
The API has rate limiting in place to manage server load. Exceeding the allowed number of requests within a specified time frame will result in a rate limit error. Each endpoint has different Rate Limits assigned to it
Endpoint: /api/auth/signup/
Method: POST
Description: Create a new user account.
Endpoint: /api/auth/login/
Method: POST
Description: Log in to an existing user account and obtain an access token.
Endpoint: /api/notes/{id}/
Method: GET
Description: Retrieve details of a specific note by providing its ID.
Endpoint: /api/notes/
Method: POST
Description: Create a new note by providing a title and content.
Endpoint: /api/notes/{id}/
Method: DELETE
Description: Delete a specific note by providing its ID.
Endpoint: /api/notes/{id}/
Method: PUT
Description: Update the title and/or content of a specific note by providing its ID.
Endpoint: /api/notes/{id}/share/
Method: POST
Description: Share a specific note with another user by providing their username.
Endpoint: /api/search/
Method: GET
Description: Search for notes based on a keyword.
Endpoint: /api/notes/
Method: GET
Description: Retrieve a list of all notes owned or shared with the authenticated user.
- Clone the repository.
- Navigate to test_app folder :
cd notes_api/test_app
- Set up a virtual environment and install dependencies using
pip install -r requirements.txt
. - Run the Django development server:
python manage.py runserver
- In a separate terminal :
Go tocd tests/
Runpython tests.py
- Follow the prompts to test all the functionalities of the API
- For testing purposes two users have already been registered with usernames user1 and user2 respectively. Their login passwords are same as their usernames.