Comments

APIs related to Post comments and replies

Get Comments list

GET https://multiply.arbre.in/api/posts/{post_id}/comments

This endpoint will give a list of comments for a given post_id

Headers

Name
Type
Description

Accept

string

application/json

Authorization

string

Bearer 1|EMQEUjXq0OoQD6wVBnUd4WMrkcJi8nQF

{
    "data": [
        {
            "id": 2,
            "text": "Keep it up 👍",
            "replies": [],
            "likes": [
                {
                    "id": 2,
                    "role": "user",
                    "name": "Mrinmai Sharma",
                    "username": "mrinmaisharma",
                    "email": "[email protected]",
                    "phone_number": "1234567890",
                    "gender": "male",
                    "dob": "1997-12-15",
                    "email_verified_at": null,
                    "current_team_id": null,
                    "profile_photo_path": null,
                    "created_at": "2021-09-30T18:05:08.000000Z",
                    "updated_at": "2021-09-30T18:05:08.000000Z",
                    "profile_photo_url": "https://ui-avatars.com/api/?name=Mrinmai+Sharma&color=7F9CF5&background=EBF4FF",
                    "pivot": {
                        "post_comment_id": 2,
                        "user_id": 2,
                        "created_at": "2021-09-30T18:06:59.000000Z",
                        "updated_at": "2021-09-30T18:06:59.000000Z"
                    }
                }
            ],
            "creator": {
                "id": 2,
                "role": "user",
                "name": "Mrinmai Sharma",
                "username": "mrinmaisharma",
                "email": "[email protected]",
                "phone_number": "1234567890",
                "gender": "male",
                "dob": "1997-12-15",
                "email_verified_at": null,
                "current_team_id": null,
                "profile_photo_path": null,
                "created_at": "2021-09-30T18:05:08.000000Z",
                "updated_at": "2021-09-30T18:05:08.000000Z",
                "profile_photo_url": "https://ui-avatars.com/api/?name=Mrinmai+Sharma&color=7F9CF5&background=EBF4FF"
            },
            "created": "1 day ago",
            "created_at": "2021-09-30T18:06:56.000000Z",
            "updated": "1 day ago",
            "updated_at": "2021-09-30T18:06:56.000000Z"
        },
        {
            "id": 3,
            "text": "😍 yay!!",
            "replies": [
                {
                    "id": 2,
                    "post_comment_id": 3,
                    "text": "hello",
                    "created_at": "2021-10-02T10:20:48.000000Z",
                    "updated_at": "2021-10-02T10:20:48.000000Z",
                    "created_by": 1,
                    "updated_by": 1,
                    "likes": [
                        {
                            "id": 1,
                            "role": "superadmin",
                            "name": "Admin",
                            "username": "admin",
                            "email": "[email protected]",
                            "phone_number": "8360818229",
                            "gender": null,
                            "dob": null,
                            "email_verified_at": null,
                            "current_team_id": null,
                            "profile_photo_path": null,
                            "created_at": "2021-09-30T17:55:36.000000Z",
                            "updated_at": "2021-09-30T17:55:36.000000Z",
                            "profile_photo_url": "https://ui-avatars.com/api/?name=Admin&color=7F9CF5&background=EBF4FF",
                            "pivot": {
                                "post_comment_reply_id": 2,
                                "user_id": 1,
                                "created_at": "2021-10-02T10:22:12.000000Z",
                                "updated_at": "2021-10-02T10:22:12.000000Z"
                            }
                        }
                    ],
                    "creator": {
                        "id": 1,
                        "role": "superadmin",
                        "name": "Admin",
                        "username": "admin",
                        "email": "[email protected]",
                        "phone_number": "8360818229",
                        "gender": null,
                        "dob": null,
                        "email_verified_at": null,
                        "current_team_id": null,
                        "profile_photo_path": null,
                        "created_at": "2021-09-30T17:55:36.000000Z",
                        "updated_at": "2021-09-30T17:55:36.000000Z",
                        "profile_photo_url": "https://ui-avatars.com/api/?name=Admin&color=7F9CF5&background=EBF4FF"
                    }
                }
            ],
            "likes": [],
            "creator": {
                "id": 1,
                "role": "superadmin",
                "name": "Admin",
                "username": "admin",
                "email": "[email protected]",
                "phone_number": "8360818229",
                "gender": null,
                "dob": null,
                "email_verified_at": null,
                "current_team_id": null,
                "profile_photo_path": null,
                "created_at": "2021-09-30T17:55:36.000000Z",
                "updated_at": "2021-09-30T17:55:36.000000Z",
                "profile_photo_url": "https://ui-avatars.com/api/?name=Admin&color=7F9CF5&background=EBF4FF"
            },
            "created": "2 hours ago",
            "created_at": "2021-10-02T09:35:04.000000Z",
            "updated": "2 hours ago",
            "updated_at": "2021-10-02T09:35:04.000000Z"
        },
        {
            "id": 5,
            "text": "Okay",
            "replies": [],
            "likes": [],
            "creator": {
                "id": 1,
                "role": "superadmin",
                "name": "Admin",
                "username": "admin",
                "email": "[email protected]",
                "phone_number": "8360818229",
                "gender": null,
                "dob": null,
                "email_verified_at": null,
                "current_team_id": null,
                "profile_photo_path": null,
                "created_at": "2021-09-30T17:55:36.000000Z",
                "updated_at": "2021-09-30T17:55:36.000000Z",
                "profile_photo_url": "https://ui-avatars.com/api/?name=Admin&color=7F9CF5&background=EBF4FF"
            },
            "created": "2 hours ago",
            "created_at": "2021-10-02T09:38:32.000000Z",
            "updated": "2 hours ago",
            "updated_at": "2021-10-02T09:38:32.000000Z"
        },
        {
            "id": 6,
            "text": "fine",
            "replies": [],
            "likes": [],
            "creator": {
                "id": 1,
                "role": "superadmin",
                "name": "Admin",
                "username": "admin",
                "email": "[email protected]",
                "phone_number": "8360818229",
                "gender": null,
                "dob": null,
                "email_verified_at": null,
                "current_team_id": null,
                "profile_photo_path": null,
                "created_at": "2021-09-30T17:55:36.000000Z",
                "updated_at": "2021-09-30T17:55:36.000000Z",
                "profile_photo_url": "https://ui-avatars.com/api/?name=Admin&color=7F9CF5&background=EBF4FF"
            },
            "created": "2 hours ago",
            "created_at": "2021-10-02T09:38:56.000000Z",
            "updated": "2 hours ago",
            "updated_at": "2021-10-02T09:38:56.000000Z"
        }
    ]
}

Get Single Comment

GET https://multiply.arbre.in/api/posts/{post_id}/comments/{comment_id}

This endpoint will give a single comment for a given post_id and comment_id

Headers

Name
Type
Description

Accept

string

application/json

Authorization

string

Bearer 1|EMQEUjXq0OoQD6wVBnUd4WMrkcJi8nQF

Create Comment

POST https://multiply.arbre.in/api/posts/{post_id}/comments

This endpoint will create a comment for a given post_id

Headers

Name
Type
Description

Accept

string

application/json

Authorization

string

Bearer 1|EMQEUjXq0OoQD6wVBnUd4WMrkcJi8nQF

Request Body

Name
Type
Description

text

string

your comment text

Add or Remove Like

POST https://multiply.arbre.in/api/posts/{post_id}/comments/{comment_id}/like

This endpoint will add or remove like for a given comment. It acts as a toggle for the Like action.

Headers

Name
Type
Description

Accept

string

application/json

Authorization

string

Bearer 1|EMQEUjXq0OoQD6wVBnUd4WMrkcJi8nQF

Last updated

Was this helpful?