Comments
Resource Fields
Metadata
Version | 1.0 |
Last Updated | July 04, 2016 |
Actions
Retrieve all comments
GET /api/v1/articles/:id/comments.jsonInformation
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.jsonInformation
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.jsonInformation
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.jsonInformation
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/publishInformation
Allowed for | Collaborators, Agents, Admins & Owners |
Response
{
"status": 200
}
Mark comment as spam
PUT /api/v1/articles/:id/comments/:id/spamInformation
Allowed for | Collaborators, Agents, Admins & Owners |
Response
{
"status": 200
}
Delete a comment
DELETE /api/v1/articles/:id/comments/:id.jsonInformation
Allowed for | Customers, Collaborators, Agents, Admins & Owners |
Note: User is allowed to delete their comments within duration of 10 minutes
Response
{
"status": 200
}
Likes
Retrieve all likes
GET /api/v1/articles/:id/comments/:id/likes.jsonInformation
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.jsonInformation
Allowed for | Customers, Collaborators, Agents, Admins & Owners |
Response
{
"status": 201
}
Unlike a comment
DELETE /api/v1/articles/:id/comments/:id/likes.jsonInformation
Allowed for | Customers, Collaborators, Agents, Admins & Owners |
Response
{
"status": 200
}