# Remove Comment

# Deleting a Specific Comment

The designated endpoint is intended for deleting specific comments from the database, providing a powerful tool for platform owners and administrators to manage and maintain their platform's user-generated content. This endpoint enables authorized users to remove comments that are no longer relevant or inappropriate To use this endpoint, users can send a DELETE request with the comment's unique identifier, which the API will then verify and delete from the platform's database. The endpoint is designed to be highly secure, requiring appropriate authorization and authentication to ensure that only authorized users have the ability to delete comments from the database.

#

# Request

  • HTTP Method: DELETE
  • accept : application/json
  • Content Type : application/json
  • Authorization : bearer userjwt
  • URL: https://comments-api-production.up.railway.app/comments/delete-comment/{commentid}

# Params Parameters

Property Type Required Description
commentId number true This is the id of the comment

# Request example

curl -X DELETE \ 
 'https://comments-api-production.up.railway.app/comments/delete-comment/{commentId}' \ 
-H 'accept : application/json' \ 
-H 'Content-Type : application/json' \ 
-H 'Authorization : bearer userjwt' \ 

# Expected Responses:

# Item Deleted

You have successfully deleted the item

{ 
"statusCode":200, 
"responseValue":{ 
"message":"Deleted Successfully"} 
} 
 

# Other Responses:

# Unauthorised Access

This jwt is invalid

{ 
"statusCode":401, 
"message":"Unauthorized"} 
 

# Missing Item

This Item cannot be found

{ 
"statusCode":404, 
"message":["This resource cannot be found"], 
"error":"Not found"} 
 

# Unauthorised User

this email is not associated with this resource

{ 
"statusCode":401, 
"message":["Your email is not associated with this resource"], 
"error":"Unauthorized"} 
 

# Playground

Method: DELETE

URL: https://comments-api-production.up.railway.app/comments/delete-comment/{commentId}

Headers:

KeyValue
accept
Content-Type
Authorization