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.

Updates an existing comment. Users can only update their own comments.

URL Parameters

id
string
required
The unique identifier of the comment

Request Body

comment[content]
string
required
Updated comment content

Returns

Returns the updated comment object.
curl -X PATCH https://api.onlydrams.app/api/v1/comments/comment-uuid \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "comment": {
         "content": "Updated comment content"
       }
     }'
{
  "id": "comment-uuid",
  "content": "Updated comment content",
  "like_count": 5,
  "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-14T11:00:00Z"
}

Error Responses

403 Forbidden
object
Returned when user tries to update someone else’s comment
ERROR
{
  "message": "You can only edit your own comments"
}

Notes

  • Authorization: Comment owner only
  • Content: Comment content cannot be blank