API:
Documentation

Comments

List comments on photo
Get a single comment
Add comment
Update comment
Delete comment

List comments on photo

GET /photos/:photo_id/comments
Parameters
NameTypeDescription
includestringFetch additional data using one or more includes separated by comma. Available includes: commentable.
Response
{
    "data": [
        {
            "id": 14,
            "body": "Good luck!",
            "level": 0,
            "parent": 0,
            "count_likes": 0,
            "created_at": "2014-10-12T14:21:05+0200",
            "authorable": {
                "data": {
                    "id": 40,
                    "name": "Piotr Kmita",
                    "username": "kmita",
                    "avatar": "https://cdn.tookapic.com/avatars/2014/283/c/4/c470cfea0a59d96fb95745c55d537796.jpg?w=128&h=128&fit=crop&q=85&sharp=3&s=5050143df983c7dd47632a3e6175e1eb"
                }
            }
        },
        {
            "id": 2,
            "body": "Thanks! Looking forward to seeing your photos.",
            "level": 0,
            "parent": 0,
            "count_likes": 0,
            "created_at": "2014-10-10T16:01:11+0200",
            "authorable": {
                "data": {
                    "id": 1,
                    "name": "Paweł Kadysz",
                    "username": "pawelkadysz",
                    "avatar": "https://cdn.tookapic.com/avatars/2014/322/e/3/e32b5a9133b8370d6137328bc182ccc6.png?w=128&h=128&fit=crop&q=85&sharp=3&s=ee77785b8ffd22a91c2fe156512997d5"
                }
            }
        },
        {
            "id": 1,
            "body": "And this is the first comment  :D\r\n\r\nBest of luck!",
            "level": 0,
            "parent": 0,
            "count_likes": 0,
            "created_at": "2014-10-10T15:42:06+0200",
            "authorable": {
                "data": {
                    "id": 27,
                    "name": "Abdulhameid Grandoka",
                    "username": "grandoka",
                    "avatar": "https://cdn.tookapic.com/avatars/2014/282/6/e/6e2ae54a23126f864d39163ec5ae17d3.jpg?w=128&h=128&fit=crop&q=85&sharp=3&s=260211473fcd44236f6e838de2e87f6b"
                }
            }
        }
    ]
}

Get a single comment

GET /photos/:photo_id/comments/:comment_id
Parameters
NameTypeDescription
includestringFetch additional data using one or more includes separated by comma. Available includes: commentable.
Response
{
    "data": {
        "id": 1,
        "body": "And this is the first comment  :D\r\n\r\nBest of luck!",
        "level": 0,
        "parent": 0,
        "count_likes": 0,
        "created_at": "2014-10-10T15:42:06+0200",
        "authorable": {
            "data": {
                "id": 27,
                "name": "Abdulhameid Grandoka",
                "username": "grandoka",
                "avatar": "https://cdn.tookapic.com/avatars/2014/282/6/e/6e2ae54a23126f864d39163ec5ae17d3.jpg?w=128&h=128&fit=crop&q=85&sharp=3&s=260211473fcd44236f6e838de2e87f6b"
            }
        }
    }
}

Add comment

POST /photos/:photo_id/comments
Data
NameTypeDescription
bodystringRequired. The content of the comment.
mentionsarrayDeprecated. The array of user mentions: USER_ID,USERNAME.
parentintegerThe id of the parent comment if the comment is a reply.
Response
{
    "data": {
        "id": 104639,
        "body": "Nice photo!",
        "level": 0,
        "parent": 0,
        "count_likes": 0,
        "created_at": "2016-07-11T14:57:37+0200",
        "authorable": {
            "data": {
                "id": 1,
                "name": "Paweł Kadysz",
                "username": "pawelkadysz",
                "avatar": "https://cdn.tookapic.com/avatars/2014/322/e/e32b5a9133b8370d6137328bc182ccc6.png?w=128&h=128&fit=crop&q=85&sharp=s=ee77785b8ffd22a91c2fe156512997d5",
                "level": 10,
                "is_hero": 1
            }
        }
    }
}

Update comment

PUT /photos/:photo_id/comments/:comment_id
Data
NameTypeDescription
bodystringRequired. The content of the comment.
mentionsarrayDeprecated. The array of user mentions: USER_ID,USERNAME.
Response
{
    "data": {
        "id": 104639,
        "body": "Nice photo! :)",
        "level": 0,
        "parent": 0,
        "count_likes": 0,
        "created_at": "2016-07-11T14:57:37+0200",
        "authorable": {
            "data": {
                "id": 1,
                "name": "Paweł Kadysz",
                "username": "pawelkadysz",
                "avatar": "https://cdn.tookapic.com/avatars/2014/322/e/e32b5a9133b8370d6137328bc182ccc6.png?w=128&h=128&fit=crop&q=85&sharp=s=ee77785b8ffd22a91c2fe156512997d5",
                "level": 10,
                "is_hero": 1
            }
        }
    }
}

Delete comment

DELETE /photos/:photo_id/comments/:comment_id
Response
{
    "status_code": 200,
    "status": "success",
    "message": "Comment was deleted."
}

Pawel from Tookapic

Hi, I’m happy to help you with any tookapic subject, however, before you send me a message, please look at Help section where you can find answers for most questions.

We’ll reply shortly!

Please note that answers for most questions about tookapic can be found in the Help section.