Start a conversation

REST - NewsComment

Overview

This article provides details about the REST - NewsComment API call that Kayako Classic uses, including its field types, arguments, and responses. 

 

Information

Comment Creator Types

Creator type Value
Staff 1
User 2

 

Comment Statuses

Comment status Value
Pending for approval 1
Approved 2
Marked as spam  

 

GET /News/Comment/ListAll/$newsitemid$

Retrieve a list of all the comments that belong to a given news item ID.


Arguments

Red = required

Name Description
$newsitemid$ The unique numeric identifier of the news item


Response

<newsitemcomments>
<newsitemcomment>
<id><![CDATA[320]]]]><![CDATA[></id>
<newsitemid><![CDATA[41]]]]><![CDATA[></newsitemid>
<creatortype><![CDATA[2]]]]><![CDATA[></creatortype>
<creatorid><![CDATA[1]]]]><![CDATA[></creatorid>
<fullname><![CDATA[Jon doe]]]]><![CDATA[></fullname>
</email><ipaddress><![CDATA[127.0.0.1]]]]><![CDATA[></ipaddress>
<dateline><![CDATA[1340037804]]]]><![CDATA[></dateline>
<parentcommentid><![CDATA[0]]]]><![CDATA[></parentcommentid>

<commentstatus><![CDATA[2]]]]><![CDATA[></commentstatus>
<useragent />
<referrer />

<parenturl><![CDATA[http://localhost/fusiongit/trunk/index.php?/News/NewsItem/View/41]]]]><![CDATA[></parenturl>
<contents><![CDATA[Created by API onnews]]]]><![CDATA[></contents>
</newsitemcomment>
<newsitemcomment><id><![CDATA[321]]]]><![CDATA[></id>
<newsitemid><![CDATA[41]]]]><![CDATA[></newsitemid>
<creatortype><![CDATA[2]]]]><![CDATA[></creatortype>
<creatorid><![CDATA[1]]]]><![CDATA[></creatorid>
<fullname><![CDATA[Simaranjit Singh]]]]><![CDATA[></fullname>
</email><ipaddress><![CDATA[127.0.0.1]]]]><![CDATA[></ipaddress>
<dateline><![CDATA[1340037801]]]]><![CDATA[></dateline>
<parentcommentid><![CDATA[0]]]]><![CDATA[></parentcommentid>
<commentstatus><![CDATA[2]]]]><![CDATA[></commentstatus>
<useragent />
<referrer />

<parenturl><![CDATA[http://localhost/fusiongit/trunk/index.php?/News/NewsItem/View/41]]]]><![CDATA[></parenturl>
<contents><![CDATA[Created by API onnews]]]]><![CDATA[></contents>
</newsitemcomment>
</newsitemcomments>

 

GET /News/Comment/$id$

Retrieve a comment identified by $id$.


Arguments

Red = required

Name Description
$id$ The unique numeric identifier


Response

<newsitemcomments>
<newsitemcomment>
<id><![CDATA[320]]]]><![CDATA[></id>
<newsitemid><![CDATA[41]]]]><![CDATA[></newsitemid>
<creatortype><![CDATA[2]]]]><![CDATA[></creatortype>
<creatorid><![CDATA[1]]]]><![CDATA[></creatorid>
<fullname><![CDATA[Jon doe]]]]><![CDATA[></fullname>
<email /><ipaddress><![CDATA[127.0.0.1]]]]><![CDATA[></ipaddress>
<dateline><![CDATA[1340037804]]]]><![CDATA[></dateline>
<parentcommentid><![CDATA[0]]]]><![CDATA[></parentcommentid>
<commentstatus><![CDATA[2]]]]><![CDATA[></commentstatus>
<useragent />
<referrer />

<parenturl><![CDATA[http://localhost/fusiongit/trunk/index.php?/News/NewsItem/View/41]]]]><![CDATA[></parenturl>
<contents><![CDATA[Created by API onnews]]]]><![CDATA[></contents>
</newsitemcomment>
</newsitemcomments>

 

POST /News/Comment

Create a new knowledgebase article comment.


Arguments (POST variables)

Red = required, Blue = Either of the value

Name Description
newsitemid The news item ID
contents The comment contents
creatortype The creator type. Staff: 1, User: 2
creatorid The creator (staff or user) ID. Needed when creator type is Staff, optional when creator type is User
fullname The creator (user) full name. Needed when creator type is User and creator id (user id) is not provided
email The creator email
parentcommentid Parent comment ID (when replying to some comment)


Response

<newsitemcomments>
<newsitemcomment>
<id><![CDATA[320]]]]><![CDATA[></id>
<newsitemid><![CDATA[41]]]]><![CDATA[></newsitemid>
<creatortype><![CDATA[2]]]]><![CDATA[></creatortype>
<creatorid><![CDATA[1]]]]><![CDATA[></creatorid>
<fullname><![CDATA[Jon doe]]]]><![CDATA[></fullname>
<email /><ipaddress><![CDATA[127.0.0.1]]]]><![CDATA[></ipaddress>
<dateline><![CDATA[1340037804]]]]><![CDATA[></dateline>
<parentcommentid><![CDATA[0]]]]><![CDATA[></parentcommentid>
<commentstatus><![CDATA[2]]]]><![CDATA[></commentstatus>
<useragent />
<referrer />

<parenturl><![CDATA[http://localhost/fusiongit/trunk/index.php?/News/NewsItem/View/41]]]]><![CDATA[></parenturl>
<contents><![CDATA[Created by API onnews]]]]><![CDATA[></contents>
</newsitemcomment>
</newsitemcomments>

 

DELETE /News/Comment/$id$

Delete a news comment identified by $id$.


Arguments

Red = required

Name Description
$id$ The unique numeric identifier of the comment

 

 

 

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments