REST API - Add Comment Request

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

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.

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, Traces, Offset or Limit parameters.
    • A required value has not been provided.
    • If you are submitting a POST or PATCH 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>&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;style type="text/css"&amp;gt;.c0 { font-size: 11px; line-height: 1.45000004768372 } .c1 { margin: 0px; font-size: 11px; line-height: 1.45000004768372 } &amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body class="c0"&amp;gt;&amp;lt;p class="c1"&amp;gt;&amp;lt;span class="c0"&amp;gt;Comment created by API&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;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

{
"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": "&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;"
}