curl --request GET \
--url https://api.example.com/api/get_room_messages \
--header 'Authorization: <authorization>'{
"messages": [
{
"username": "<string>",
"message": "<string>",
"created_at": 123,
"room_id": 123
}
]
}Retrieve messages from a chat room
curl --request GET \
--url https://api.example.com/api/get_room_messages \
--header 'Authorization: <authorization>'{
"messages": [
{
"username": "<string>",
"message": "<string>",
"created_at": 123,
"room_id": 123
}
]
}{
"error": "missing token or room id"
}
{
"error": "unauthorized"
}
{
"error": "you are not in this room"
}
curl -X GET "https://api.mirage.com/api/get_room_messages?room_id=42" \
-H "Authorization: your-auth-token"
{
"messages": [
{
"username": "john_doe",
"message": "Hello everyone!",
"created_at": 1709481234.567,
"room_id": 42
},
{
"username": "jane_smith",
"message": "Hi John!",
"created_at": 1709481256.789,
"room_id": 42
}
]
}
{
"messages": []
}