Post a Comment to a Node

You can use this request to post a new comment to a node.

/services/v2/node/[nodeId]/comment.json

The following parameters can be used in your post a comment request:

other options: wrap, v1

🚧

Permissions & Notes:

  • You must have the Publish comment permission under Standard Roles in the Advanced Editor to post a comment to any node.
    • You must also have the Publish [node type] permission under Standard Roles in the Advanced Editor relevant to the node type you are attempting to comment on.
  • The location response header will contain the URL for the newly created comment.
  • The data describing the question to be posted can be specified both in the body of the request or as a request parameter with the same names as the fields in the body.
    • When data is sent in the body of the request, the format should match the URL extension or the value of the site's HTTP request header content-type.
    • If data values for the same field are specified both on the request body and as a request or query parameter, the value of the parameters takes precedence over the value in the body.
  • This request was added in version 1.6.3.

Sample Request

A POST post a comment request to make a comment ("Testing API. Node comment text goes here.") sent to a node (nodeId: 806) on https://apidocs.cloud.answerhub.com using a human-readable Username/Password (answerhub/test123) would look like this:

curl 
-u answerhub:test123 
-H "Accept: application/json" 
-H "Content-type: application/json" 
-X POST 
-d '{"body":"Testing API. Node comment text goes here."}' "https://apidocs.cloud.answerhub.com/services/v2/node/806/comment.json" -v

Expected Response

Successful Response:

  • HTTP Status 201 - Created

Community User Interface Result

You will see the comment under the question "Where do I go to learn more about Answerhub"

Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!