REST API - Add Comment Request
9 min
api/v1/projects/{projectid}/artifacts/{artifactid}/comments description adds a single comment to the specified artifact url structure \[blueprint uri]/api/v1/projects/{projectid}/artifacts/{artifactid}/comments projectid the id of the project containing the artifact that you want to add the comment to artifactid the id of the artifact you want to add the comment to supported methods post docid\ hsi lzxs8g rx ydudzkg request body the comment must be defined in the body of the request read more about how to define a comment in the request body docid ime 8rgznc7zy7 vf9of http status codes 200 ok 201 successfully created 206 partial content 400 bad request this error can occur for a variety of reasons at least one uri or request body parameter is invalid, such as one of the filter docid\ sv9gjverxczcgqdn28j7u , traces, offset or limit parameters a required value has not been provided if you are submitting a post docid\ hsi lzxs8g rx ydudzkg or patch docid\ rcjvhrlby6de zgkehxui request and have not added the x http method override parameter to your request header 401 unauthorized the blueprint token is missing, invalid or expired 403 forbidden the applicable permissions are needed for example, this error can occur when an author or collaborate license is needed for access comment permissions are needed on the artifact edit permissions are needed on the change summary job 404 notfound item is not found in the project for example, this error can occur when artifact not found artifact type not found project not found alm target not found change summary job not found user does not have edit permissions for this artifact, project or alm target 409 conflict reason for failure can be found in the response body additional information may also be found in the log 411 length required if the content length header is missing in the request 413 request entity too large if the provided file size is larger than allowed 415 unsupported media type if the provided media type is not of mime multipart content "form data " 416 request range not satisfiable if offset points to a part of a collection that is not available 500 internal server error 501 not implemented examples xml example request uri https //production blueprintcloud com/api/v1/projects/220870/artifacts/220914/comments request body \<?xml version="1 0" ?>\<comment xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<description>comment created by api\</description> \<status>open\</status>\</comment> response body \<?xml version="1 0" ?>\<comment xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<author> \<displayname>admin\</displayname> \<id>398\</id> \</author> \<description>\&lt;html\&gt;\&lt;head\&gt;\&lt;style type="text/css"\&gt; c0 { font size 11px; line height 1 45000004768372 } c1 { margin 0px; font size 11px; line height 1 45000004768372 } \&lt;/style\&gt;\&lt;/head\&gt;\&lt;body class="c0"\&gt;\&lt;p class="c1"\&gt;\&lt;span class="c0"\&gt;comment created by api\&lt;/span\&gt;\&lt;/p\&gt;\&lt;/body\&gt;\&lt;/html\&gt;\</description> \<id>71466\</id> \<lastmodified>2013 11 26t11 16 23 9633271 05 00\</lastmodified> \<version>0\</version> \<isclosed>false\</isclosed> \<status>open\</status>\</comment> json example request uri https //production blueprintcloud com/api/v1/projects/220870/artifacts/220914/comments request body { "status" "open", "description" "comment created by api"} response body language php template { "lastmodified" "2013 11 26t11 16 23 9633271 05 00", "isclosed" false, "status" "open", "id" 71466, "author" { "type" "user", "id" 398, "displayname" "admin" }, "version" 0, "description" "\<html\>\<head\>\<style type=\\"text/css\\"\> c0 { font size 11px; line height 1 45000004768372 } c1 { margin 0px; font size 11px; line height 1 45000004768372 } \</style\>\</head\>\<body class=\\"c0\\"\>\<p class=\\"c1\\"\>\<span class=\\"c0\\"\>comment created by api\</span\>\</p\>\</body\>\</html\>"}