Skip to content

Latest commit

 

History

History
103 lines (77 loc) · 3.56 KB

File metadata and controls

103 lines (77 loc) · 3.56 KB

### 1. Register New User # POST /api/auth/register/

POST http://localhost:8000/api/auth/register/ Content-Type: application/json

{
"username": "study_buddy_1", "email": "user1@focus.io", "password": "StrongPassword123!", "password2": "StrongPassword123!"

}

### 2. Login User and Obtain JWT Tokens # POST /api/auth/login/

POST http://localhost:8000/api/auth/login/ Content-Type: application/json

{
"email": "user1@focus.io", "password": "StrongPassword123!"

}

### 3. Refresh Access Token (Requires copying refresh token from step 2) # POST /api/auth/token/refresh/

POST http://localhost:8000/api/auth/token/refresh/ Content-Type: application/json

{
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTc2NTg5MDE4MCwiaWF0IjoxNzY1ODAzNzgwLCJqdGkiOiI5YzIzMDZhYzRhMzY0MGVkOWM5ZGE0M2RjZWI2YThjNSIsInVzZXJfaWQiOiIxIn0.p755gFA3nm2qnzznJc15-qa4NgNWYc_vaIpP0C5HRCI"

}

### 4. Get Current User Profile (Protected) # GET /api/auth/me/ # Requires a valid Access Token in the 'access_token' cookie

GET http://localhost:8000/api/auth/me/ Cookie: access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzY1ODA2NjIwLCJpYXQiOjE3NjU4MDYzMjAsImp0aSI6ImFiYzc0ZmY3NGM1MTQ4YTM5NGI0YjZiOTllY2Y1NTFkIiwidXNlcl9pZCI6IjEifQ.Pvl8QbNwXuhBimip1toJbq4tC20adjBAoOH3PeZq-Fs

### 5. Logout (Clear Cookies & Blacklist Token) # POST /api/auth/logout/ # Requires a valid Access Token cookie to authenticate the user before logging out

POST http://localhost:8000/api/auth/logout/ Cookie: access_token=<YOUR_ACCESS_TOKEN_HERE>

### 6. Forgot Password (Trigger Email/Console Log) # POST /api/auth/forgot-password/

POST http://localhost:8000/api/auth/forgot-password/ Content-Type: application/json

{
"email": "user1@focus.io"

}

### 7. Reset Password (Requires uidb64 and token from step 6 output) # POST /api/auth/reset-password/

POST http://localhost:8000/api/auth/reset-password/ Content-Type: application/json

{
"uidb64": "MQ", "token": "d0uumk-102882291cd64aae5a44f04469ce43b7", "password": "NewStrongPassword456!", "password2": "NewStrongPassword456!"

}

### 8. Create a New Room (Protected) # POST /api/rooms/ # Requires: Access Token POST http://localhost:8000/api/rooms/ Content-Type: application/json Cookie: access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzY1OTU5Mjc4LCJpYXQiOjE3NjU5NTg5NzgsImp0aSI6IjhkNzFmN2QwODhjZTRiYjY4MDk3ODBhNGI2MmNhNDZlIiwidXNlcl9pZCI6IjEifQ.sxKb81n2DFlGrWknlHv8BA3H__jYllQ_zITBDYwdcRo

{
"name": "Open Source Contributors", "description": "Collaborating on GitHub projects and open source contributions", "topic": "Open Source", "capacity": 20, "is_private": false

}

### 9. List All Rooms # GET /api/rooms/ # Requires: Access Token (or ReadOnly if Configured) GET http://localhost:8000/api/rooms/ Content-Type: application/json Cookie: access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzY1ODkyNjY5LCJpYXQiOjE3NjU4OTIzNjksImp0aSI6IjU2Mjg4MjdhNjNiYTQxYWU5NzkzZWJkYmMxNDg2ZWQ2IiwidXNlcl9pZCI6IjEifQ.DD_pGiVPT66PRDT1KSjAqyFB3EjuFegH4AYHpfVOSUc

### 10. Get Room Details # GET /api/rooms/{room_id}/ # Replace {room_id} with the UUID returned from Step 8 GET http://localhost:8000/api/32431574-e901-4a53-914f-8175e8f6d257/ Content-Type: application/json Cookie: access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzY1ODkyNjY5LCJpYXQiOjE3NjU4OTIzNjksImp0aSI6IjU2Mjg4MjdhNjNiYTQxYWU5NzkzZWJkYmMxNDg2ZWQ2IiwidXNlcl9pZCI6IjEifQ.DD_pGiVPT66PRDT1KSjAqyFB3EjuFegH4AYHpfVOSUc