-
Endpoint:
POST /api/auth/login
-
Description: Authenticate and obtain an access token.
-
Request:
-
Body:
{ "username": "user@example.com", "password": "securepassword" }
-
-
Response:
-
Success (200 OK):
{ "message": "success", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." }
-
Error (401 Unauthorized):
{ "message": "Invalid credentials" }
-
- Endpoint:
POST /api/auth/logout
- Description: Invalidate the current access token.
- Request:
- Headers:
Authorization: Bearer [token]
- Headers:
- Response:
-
Success (200 OK):
{ "message": "Logout successful" }
-
-
Endpoint:
POST /api/auth/register
-
Description: Create a new user account.
-
Request:
-
Body:
{ "username": "newuser", "email": "newuser@example.com", "password": "securepassword" }
-
-
Response:
-
Success (201 Created):
{ "message": "User registered successfully" }
-
Error (400 Bad Request):
{ "message": "Validation failed" }
-
-
Endpoint:
POST /api/clipboard/copy
-
Description: Copy content to the clipboard.
-
Request:
-
Headers:
Authorization: Bearer [token]
-
Body:
{ "deviceIpAddress":"127.0.0.1", "content":"content", "contentType":"text" }
-
-
Response:
-
Success (200 OK):
{ "message":"content published" }
-
Error (401 Unauthorized):
{ "message": "Unauthorized" }
-