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.

Adds a new comment to a community post.

URL Parameters

community_id
string
required
The unique identifier of the community
post_id
string
required
The unique identifier of the post

Request Body

comment[content]
string
required
Comment content (required, cannot be blank)

Returns

Returns the created comment object.
curl -X POST https://api.onlydrams.app/api/v1/communities/abc123-def456/posts/post-uuid/comments \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "comment": {
         "content": "Great post! Thanks for sharing."
       }
     }'
{
  "id": "comment-uuid",
  "content": "Great post! Thanks for sharing.",
  "like_count": 0,
  "liked_by_current_user": false,
  "user": {
    "id": "user-uuid",
    "username": "whisky_lover",
    "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/user.jpg"
  },
  "created_at": "2024-11-14T10:30:00Z",
  "updated_at": "2024-11-14T10:30:00Z"
}

Error Responses

403 Forbidden
object
Returned when user doesn’t have access to the post
ERROR
{
  "message": "You don't have access to this post"
}
422 Unprocessable Entity
object
Returned when validation fails
ERROR
{
  "message": ["Content can't be blank"]
}

Notes

  • Authorization: User must be a member of the community and have access to the post
  • Notification: If community has notify_new_comments enabled, owner receives email
  • Content: Comment content cannot be blank