mirror of
https://git.sr.ht/~iwakuralain/text0Nly
synced 2025-07-27 15:36:11 +00:00
updated readme
This commit is contained in:
parent
923b0213fa
commit
64e1c443a2
36
README.txt
36
README.txt
@ -85,9 +85,45 @@ Files:
|
|||||||
main/api.php - Message API
|
main/api.php - Message API
|
||||||
|
|
||||||
API usage:
|
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 '{
|
curl -X POST http://localhost/api.php -H "Content-Type: application/json" -d '{
|
||||||
"username": "name",
|
"username": "name",
|
||||||
"message": "text",
|
"message": "text",
|
||||||
"signature": "pgp_signature",
|
"signature": "pgp_signature",
|
||||||
"encrypted": true
|
"encrypted": true
|
||||||
}'
|
}'
|
||||||
|
|
||||||
|
Note: Messages can only be sent by unregistered usernames
|
Loading…
x
Reference in New Issue
Block a user