API EndpointsCommentsRemove Comment Downvote

Remove Comment Downvote

Endpoint

URL: https://api.replyke.com/:projectId/comments/:commentId/remove-downvote

Method: PATCH

Authentication Required: Yes (Requires a valid access token in the Authorization header)


Description

This endpoint allows a user to remove their downvote from a comment. If the user has not previously downvoted the comment, they cannot remove a downvote.


Request

Headers

  • Authorization: Bearer <accessToken> (Required, must contain a valid access token)

URL Parameters

ParameterTypeRequiredDescription
projectIdstringYesThe project ID associated with the comment.
commentIdstringYesThe ID of the comment to remove the downvote from.

Response

Success Response (200 OK)

{
  "id": "<COMMENT_ID>",
  "projectId": "<PROJECT_ID>",
  "userId": "<USER_ID>",
  "entityId": "<ENTITY_ID>",
  "parentId": "<PARENT_ID>",
  "content": "<COMMENT_CONTENT>",
  "gif": {
    "id": "<GIF_ID>",
    "gifUrl": "<GIF_URL>",
    "gifPreviewUrl": "<GIF_PREVIEW_URL>",
    "altText": "<ALT_TEXT>",
    "url": "<URL>",
    "aspectRatio": "<ASPECT_RATIO>"
  },
  "mentions": ["<UPDATED_MENTIONS_ARRAY>"],
  "upvotes": ["<UPDATED_UPVOTES_ARRAY>"],
  "downvotes": ["<UPDATED_DOWNVOTES_ARRAY>"]
}

Error Responses

Missing commentId (400 Bad Request)

{
  "error": "Missing required data"
}

Reason: The request must include a commentId to specify which comment to modify.

Comment Not Found (404 Not Found)

{
  "error": "Comment not found"
}

Reason: The specified commentId does not exist or does not belong to the given projectId.

No Downvote to Remove (409 Conflict)

{
  "error": "User hasn't downvoted this comment"
}

Reason: The user has not downvoted this comment, so there is no downvote to remove.

Unauthorized Request (401 Unauthorized)

{
  "error": "Missing or invalid authorization token"
}

Reason: The request did not include a valid access token in the Authorization header.

Server Error (500 Internal Server Error)

{
  "error": "Server error"
}

Reason: An unexpected error occurred while processing the request.


Notes

  • A user cannot remove a downvote if they have not previously downvoted the comment.
  • The Authorization header must be provided and contain a valid access token.
  • The response will contain the updated upvotes and downvotes arrays reflecting the latest state.