create comment public
/groups/{group}/comments [POST]
| API Support | Available since | Last updated | Output |
|---|---|---|---|
| 5.1102 | 5.9900 | xml, json |
Description
Create a comment using parameters to specify the author.
To create a comment for an existing member, use
Parameters
| Name | Description | Required | Type | Default |
|---|---|---|---|---|
| authorname | The name of the author | yes | string | |
| content | The content of the comment. XHTML content is sanitized. | yes | string | |
| title | The title of the comment | yes | string | |
| assignedto | The ID of the member to assign the task to – status MUST be set | no | long | |
| authoremail | The email address of the author | no | ||
| contenttype | The media type of the comment | no | mediatype | text/plain |
| due | The task due date and time in ISO-8601 format – status MUST be set. e.g. 2010-10-25T18:00:00+11:00 | no | datetime | |
| labels | A comma-separated list of labels | no | string | |
| notify | The notification behavior | no | notify | normal |
| notify-async | Whether emails should be sent asynchronously (for slow email servers) | no | boolean | false |
| priority | The priority for the task e.g. High, Medium, Low' – status MUST be set | no | priority | |
| properties | A pipe-separated list of value pairs (e.g. x=1|y=2|) | no | string | |
| status | The task status value, e.g. Open | no | status | |
| type | The type of the comment | no | string | |
| uris | Comma-separated list of attachments as URI ID with optional !fragment | no | long | |
| urls | Comma-separated list of attachments as URL with optional !fragment | no | url | |
| draft | Whether the comment is a draft | no | boolean | false |
Permission
This service is public, anyone can invoke it.
Response
The XML response is a <comment> wrapped by a <comment-creation> element that indicates whether a notification has been sent and whether the comment is public.
<comment-creation [notification-email-delayed="true"|
notification-email-failed="true"|
moderator-email-failed="true"]
[notify-param-ignored="true"]
[public="true"]>
<comment id="123"
contentrole="[Comment|File Attachment]"
created="2012-03-08T12:34:00+10:00"
status="Open"
due="2012-03-10T18:00:00+10:00"
priority="High"
[moderated="true"]>
<title>Cavern stolen!</title>
<author email="alibaba@fortythieves.com.au" ...> ... </author>
<assignedto id="123" date="2012-03-09T..." ...> ... </assignedto>
<modifiedby id="456" date="2012-03-09T..." ...> ... </modifiedby>
<content id="789" type="text/plain">Sesame opened the door
</content>
<attachment>
<uri id="189" > ... </uri>
</attachment>
<attachment fragment="5" >
<uri id="289" > ... </uri>
</attachment>
</comment>
</comment-creation>
Error Handling
| Code | Cause / Description |
|---|---|
| 0x0000 | Missing required title |
| 0x1002 | Invalid email address |
| 0x1301 | Missing required authorname |
| 0x1302 | If the author is existing and was specified using authorname or authoremail |
| 0x1304 | The URL is invalid |
| 0x1307 | The assigned to member is invalid. The status is required to validate |
| 0x1308 | The due date is invalid. The status is required to validate |
| 0x1328 | The labels parameter is invalid |
| 0x1329 | The priority parameter is invalid |
| 0x1330 | The status parameter is invalid |
| 0x0201 | Missing required content |
| 0x6301 | If the group has no general discussion |
| 0x6302 | Failed to create new comment |