Action: CreateComment

Purpose: Creates a new Comment Node and optionally appends it into its owner DOM.

If you don't attach the newly created node, you can attach it to its DOM tree at a later time using either the AppendChild or InsertBefore Action

Action-specific name/value pairs:

Parameter Name Description
Data The Data content of the Comment. This must be correctly URL-escaped as appropriate.
DocumentName or DocumentOID The Name or OID of the DOM in which you wish to create the new Node.
AppendTo (optional) The OID of the Node to which the newly-created Node will be appended as a Last Child. If not specified, the newly created Node will be left unattached in the Document.

Alternatively, the parameters above can be incorporated into a single JSON string and specified using the parameter name JSON, eg:

{Data:"This is the content of my new Comment",DocumentName:"example",AppendTo:"1-1"}

Example Request

Action=CreateComment
&Data=This%20is%20the%20content%20of%20my%20new%20Comment
&DocumentName=example
&MDBAccessKeyId=[your access key id]
&Signature=[computed signature]
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-06-14T13%3A19%3A41
&Version=2009-04-15
&db=mdbx

or:

Action=CreateComment
&JSON=%7BData%3A%22This%20is%20the%20content%20of%20my%20new%20Comment%22%2C
 DocumentName%3A%22example%22%7D
&MDBAccessKeyId=[your access key id]
&OutputFormat=JSON
&Signature=[computed signature]
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-06-14T13%3A19%3A41
&Version=2009-04-15
&db=mdbx

This request will create the following node in the DOM named example:

<!-- This is the content of my new Comment -->

Example Response

<?xml version='1.0'?>
<CreateCommentResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/">
   <CreateCommentResult>
      <NodeOID>
         1-30
      </NodeOID>
      <NodeType>
         8
      </NodeType>
   </CreateCommentResult>
</CreateCommentResponse>

JSON (ie if OutputFormat=JSON specified in the Request)

{NodeOID:"1-30",NodeType:8}

The OID assigned to the newly-created Comment Node was 1-30. Note that the NodeType (Comment = 8) is also returned for information only.