updated readme

This commit is contained in:
Lain Iwakura 2025-06-16 01:45:25 +03:00
parent 923b0213fa
commit 64e1c443a2
No known key found for this signature in database
GPG Key ID: C7C18257F2ADC6F8

View File

@ -85,9 +85,45 @@ Files:
main/api.php - Message API
API usage:
GET /api.php - Get messages
Parameters:
- limit: number of messages (1-100, default: 50)
Example:
curl http://localhost/api.php?limit=10
Response:
{
"messages": [
{
"username": "user",
"message": "text",
"created_at": "2024-03-21 12:34:56",
"signature": "[Signed]",
"is_encrypted": true
}
]
}
POST /api.php - Send message
Headers:
- Content-Type: application/json
Body:
{
"username": "name",
"message": "text",
"signature": "pgp_signature",
"encrypted": true
}
Example:
curl -X POST http://localhost/api.php -H "Content-Type: application/json" -d '{
"username": "name",
"message": "text",
"signature": "pgp_signature",
"encrypted": true
}'
Note: Messages can only be sent by unregistered usernames