# Users

Users can interact with comments in different ways.

# Bookmark

This route toggles the "bookmark" action for the comment. Meaning that the first time you call it, it'll bookmark the comment; the second call for the same record will cause removing "bookmark" record.

TIP

The response is different for "bookmark" and "undo bookmark". You can use either the response's message or status code to detect whether the action has caused "bookmark" or "undo bookmark". Since the "bookmark" action causes creating a record in our database, it has the status code of 201. The "undo bookmark" isn't creating anything; thus it has the status code of 200.

# Resource URL

https://humtog.com/api/comments/:comment_id/bookmark

# Resource Method

POST

# Example Response

When performed a "bookmark" action:

{
    "message": "Bookmarked successfully."
}

When performed an "undo bookmark" action:

{
    "message": "Undid bookmark successfully."
}

# Like

This route toggles the "like" action for the comment. Meaning that the first time you call it, it'll like the comment; the second call for the same record will cause removing "like" record.

TIP

The response is different for "like" and "undo like". You can use either the response's message or status code to detect whether the action has caused "like" or "undo like". Since the "like" action causes creating a record in our database, it has the status code of 201. The "undo like" isn't creating anything; thus it has the status code of 200.

# Resource URL

https://humtog.com/api/comments/:comment_id/like

# Resource Method

POST

# Example Response

When performed a "like" action:

{
    "message": "Liked successfully."
}

When performed an "undo like" action:

{
    "message": "Undid like successfully."
}

# Vote

Vote works different, it sends a vote status of 1 or -1 depending if clicked on 'up vote' or 'down vote' button respectively. If user again click same vote button it will reset vote to 0.

# Resource URL

https://humtog.com/api/comment/comment_id/vote

# Resource Method

POST

# Params

Name Required Type Description
status Yes string It has three possible outcomes -1, 1 and 0.

# Example Response

When performed an "up vote":

{
    "message": "Up voted comment",
    "data": {
        "uservote": 1,
        'votes': 2
    }
}

In case of down vote return message will be Down voted comment. and in case of reversal Removed vote from comment.

uservote and votes are used to update current status of votes on comment as well as current user vote action.

# Report

# Resource URL

https://humtog.com/api/comments/:comment_id/report

# Resource Method

POST

# Params

Name Required Type Description
subject Yes string Must be one these values: It's spam, It doesn't follow channel's exclusive rules, It doesn't follow Humtog's general rules, It's harassing me or someone that I know, Other.
description No string Optional description which cannot exceed 5,000 characters.

# Example Response

{
    "message": "Report submitted successfully."
}