Skip to main content

Documentation Index

Fetch the complete documentation index at: https://api.docs.onlydrams.app/llms.txt

Use this file to discover all available pages before exploring further.

Returns all messages in a conversation between the authenticated user and another user in the community. Messages are returned in chronological order (oldest first).

URL Parameters

community_id
string
required
The unique identifier of the community
user_id
string
required
The unique identifier of the other user in the conversation

Query Parameters

page
integer
Page number for pagination (default: 1)
per_page
integer
Number of results per page (default: 20)

Returns

Returns a paginated list of message objects in chronological order.
curl -X GET https://api.onlydrams.app/api/v1/communities/abc123-def456/messages/user-uuid-123?page=1&per_page=20 \
     -H "Authorization: Bearer $ACCESS_TOKEN"
{
  "total": 3,
  "has_more": false,
  "data": [
    {
      "id": "msg-uuid-1",
      "content": "Hello! How can I help you today?",
      "created_at": "2024-12-01T09:00:00Z",
      "updated_at": "2024-12-01T09:00:00Z",
      "sender": {
        "id": "creator-uuid",
        "username": "community_creator",
        "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/creator.jpg"
      },
      "recipient": {
        "id": "user-uuid-123",
        "username": "whisky_lover",
        "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/user.jpg"
      }
    },
    {
      "id": "msg-uuid-2",
      "content": "I have a question about the upcoming event.",
      "created_at": "2024-12-01T09:15:00Z",
      "updated_at": "2024-12-01T09:15:00Z",
      "sender": {
        "id": "user-uuid-123",
        "username": "whisky_lover",
        "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/user.jpg"
      },
      "recipient": {
        "id": "creator-uuid",
        "username": "community_creator",
        "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/creator.jpg"
      }
    },
    {
      "id": "msg-uuid-3",
      "content": "I'd be happy to help! What would you like to know?",
      "created_at": "2024-12-01T10:30:00Z",
      "updated_at": "2024-12-01T10:30:00Z",
      "sender": {
        "id": "creator-uuid",
        "username": "community_creator",
        "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/creator.jpg"
      },
      "recipient": {
        "id": "user-uuid-123",
        "username": "whisky_lover",
        "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/user.jpg"
      }
    }
  ]
}

Error Responses

403 Forbidden
object
Returned when:
  • The user is not a member of the community
  • The conversation partner is not a member of the community
  • The conversation is blocked
ERROR
{
  "message": "You can only view conversations with members of this community"
}

Notes

  • Authorization: User must be an active member of the community or the community creator
  • Partner Validation: Both users must be members of the community (or one must be the creator)
  • Blocked Conversations: If the conversation is blocked, a 403 error is returned
  • Empty Conversations: If no conversation exists, an empty array is returned
  • Ordering: Messages are returned in chronological order (oldest first)
  • Pagination: Standard pagination with 20 items per page by default