RESTful API endpoints and usage examples
https://w3rf.nl/api
Content-Type: application/json
Authorization: Bearer <token>Authenticate user and receive token
{
"username": "demo",
"password": "demo123"
}
Response (200):
{
"token": "eyJhbGc...",
"username": "demo",
"expiresIn": 3600
}Logout and invalidate token
Headers:
Authorization: Bearer <token>
Response (200):
{
"message": "Logged out successfully"
}Get user's projects
Response (200):
{
"projects": [
{
"id": 1,
"name": "w3rf-site",
"status": "active",
"created": "2024-01-15"
}
]
}Create a new note
{
"title": "My Note",
"content": "Note content here"
}
Response (201):
{
"id": 1,
"title": "My Note",
"content": "Note content here",
"created": "2024-04-28T10:30:00Z"
}Format and validate JSON
{
"json": "{\"key\":\"value\"}"
}
Response (200):
{
"formatted": "{
\"key\": \"value\"
}",
"valid": true
}Generate secure password
{
"length": 16,
"includeSymbols": true,
"includeNumbers": true
}
Response (200):
{
"password": "Xy9#kL2@mN4$pQ7!",
"strength": "strong"
}400 Bad Request:
{
"error": "Invalid request",
"message": "Missing required field: username"
}
401 Unauthorized:
{
"error": "Unauthorized",
"message": "Invalid token or credentials"
}
404 Not Found:
{
"error": "Not found",
"message": "Resource does not exist"
}
500 Server Error:
{
"error": "Internal server error",
"message": "Something went wrong"
}