Comments

Resource Fields

Name Type Read-only Description
contents string
is_html boolean
status string PUBLISHED, SPAM
user User
replies Comments
is_liked boolean
like_count integer
created_at timestamp ISO-8601 Format
updated_at timestamp ISO-8601 Format

Metadata




 
 




Actions

Retrieve all comments

GET /api/v1/articles/:id/comments.json

Information

Allowed for Public
Ordered by created_at (descending)

Arguments

Name Type Mandatory Description
filter string PUBLISHED, SPAM

Response

    {
        "status": 200,
        "data": [




{
  "id": 1,

  "contents": "Really nice article <V60 pour over brewing>! keep posting!",
  "is_html": false,
  "status": "PUBLISHED",
  "user": 




{
    "id": 1,

    "resource_type": "user_minimal"

}
,
  "replies": [],
  "is_liked": false,
  "like_count": 0,
  "created_at": "2016-06-30T11:08:06+00:00",
  "updated_at": "2016-06-30T11:08:06+00:00",

  "resource_type": "comment"

  ,"resource_url": "https://brewfictus.kayako.com/api/v1/articles/1/comments/1"

}
        ],
        "resource": "comment",
        "offset": 0,
        "limit": 10,
        "total_count": 1
    }

Retrieve a comment

GET /api/v1/articles/:id/comments/:id.json

Information

Allowed for Public

Response

    {
        "status": 200,
        "data": 



{
  "id": 1,

  "contents": "Really nice article <V60 pour over brewing>! keep posting!",
  "is_html": false,
  "status": "PUBLISHED",
  "user": 




{
    "id": 1,

    "resource_type": "user_minimal"

}
,
  "replies": [],
  "is_liked": false,
  "like_count": 0,
  "created_at": "2016-06-30T11:08:06+00:00",
  "updated_at": "2016-06-30T11:08:06+00:00",

  "resource_type": "comment"

  ,"resource_url": "https://brewfictus.kayako.com/api/v1/articles/1/comments/1"

},
        "resource": "comment"
    }

Add a comment

POST /api/v1/articles/:id/comments.json

Information

Allowed for Customers, Collaborators, Agents, Admins & Owners

Note: User is allowed to update their comments within duration of 10 minutes

Parameters

Name Type Mandatory Description
contents string
is_html boolean Default: false

Response

    {
        "status": 201,
        "data": 



{
  "id": 1,

  "contents": "Really nice article <V60 pour over brewing>! keep posting!",
  "is_html": false,
  "status": "PUBLISHED",
  "user": 




{
    "id": 1,

    "resource_type": "user_minimal"

}
,
  "replies": [],
  "is_liked": false,
  "like_count": 0,
  "created_at": "2016-06-30T11:08:06+00:00",
  "updated_at": "2016-06-30T11:08:06+00:00",

  "resource_type": "comment"

  ,"resource_url": "https://brewfictus.kayako.com/api/v1/articles/1/comments/1"

},
        "resource": "comment"
    }

Update a comment

PUT /api/v1/articles/:id/comments/:id.json

Information

Allowed for Customers, Collaborators, Agents, Admins & Owners

Note: User is allowed to update their comments within duration of 10 minutes

Parameters

Name Type Mandatory Description
contents string

Response

    {
        "status": 200,
        "data": 



{
  "id": 1,

  "contents": "Really nice article <V60 pour over brewing>! keep posting!",
  "is_html": false,
  "status": "PUBLISHED",
  "user": 




{
    "id": 1,

    "resource_type": "user_minimal"

}
,
  "replies": [],
  "is_liked": false,
  "like_count": 0,
  "created_at": "2016-06-30T11:08:06+00:00",
  "updated_at": "2016-06-30T11:08:06+00:00",

  "resource_type": "comment"

  ,"resource_url": "https://brewfictus.kayako.com/api/v1/articles/1/comments/1"

},
        "resource": "comment"
    }

Mark comment as published

PUT /api/v1/articles/:id/comments/:id/publish

Information

Allowed for Collaborators, Agents, Admins & Owners

Response

{
    "status": 200
}

Mark comment as spam

PUT /api/v1/articles/:id/comments/:id/spam

Information

Allowed for Collaborators, Agents, Admins & Owners

Response

{
    "status": 200
}

Delete a comment

DELETE /api/v1/articles/:id/comments/:id.json

Information

Allowed for Customers, Collaborators, Agents, Admins & Owners

Note: User is allowed to delete their comments within duration of 10 minutes

Response

{
    "status": 200
}

Likes

RESOURCE FIELDS

Name Type Read-only Description
user User
created_at timestamp
ISO-8601 Format

Retrieve all likes

GET /api/v1/articles/:id/comments/:id/likes.json

Information

Allowed for Customers, Collaborators, Agents, Admins & Owners

Response

    {
        "status": 200,
        "data": [
            {
    "id": 1,

    "user": 



{
    "id": 1,

    "resource_type": "user"

}
,
    "created_at": "2015-07-21T16:58:13+05:00",

    "resource_type": "like"
}

        ],
        "resource": "like",
        "offset": 0,
        "limit": 10,
        "total_count": 1
    }

Like a comment

POST /api/v1/articles/:id/comments/:id/likes.json

Information

Allowed for Customers, Collaborators, Agents, Admins & Owners

Response

{
    "status": 201
}

Unlike a comment

DELETE /api/v1/articles/:id/comments/:id/likes.json

Information

Allowed for Customers, Collaborators, Agents, Admins & Owners

Response

{
    "status": 200
}