REST-NewsComment
This topic provides details about the REST - NewsComment API call that GFI HelpDesk uses, including its field types, arguments, and responses.
Comment Creator Types
Creator type | Value |
---|---|
Staff | 1 |
User | 2 |
Comment Statuses
Comment status | Value |
---|---|
Pending for approval | 1 |
Approved | 2 |
Marked as spam |
Retrieve a list of all the comments that belong to a given news item ID.
Arguments
Name | Description |
---|---|
$newsitemid$ | The unique numeric identifier of the news item |
Response
<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>
Retrieve a comment identified by $id$.
Arguments
Name | Description |
---|---|
$id$ | The unique numeric identifier |
Response
<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>
Create a new knowledgebase article comment.
Arguments (POST variables)
Name | Description |
---|---|
newsitemid | The news item ID |
contents | The comment contents |
creatortype |
The creator type. Possible values:
|
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 |
The creator email | |
parentcommentid | Parent comment ID (when replying to some comment) |
Response
<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 a news comment identified by $id$
.
Arguments
Name | Description |
---|---|
$id$ | The unique numeric identifier of the comment |