Create/Update Comment
  • 21 Feb 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Create/Update Comment

  • Dark
    Light
  • PDF

Article Summary

The Create/Update Comment is an endpoint in ProGet's SCA Directory API that will create a new comment or update properties on an existing comment, and return a CommentInfo Object object describing the new or updated comment.

🚀 Quick Example: Creating a New Comment with Curl

This example creates a comment in version 1.2.3 of a project named myProject, authenticating with the API key abc12345:

curl -H "X-ApiKey: abc12345" -H "Content-Type: application/json" -X POST -d "{ \"project\": \"myProject\", \"version\": \"1.2.3\", \"comment\": \"This is a new comment.\" }" http://192.168.0.189:8624/api/sca/comments

Request Specification

To create or update a comment, simply POST to the URL with an appropriate API Key and a CommentInfo Object object as the request body.

POST /api/sca/comments

Creating a comment with a CommentInfo body requires the project name (e.g. myProject), version (e.g. 1.2.3), and comment (e.g. This is a new comment)

POST /api/sca/comments

{
    "project": "myProject", 
    "version": "1.2.3", 
    "comment": "This is a new comment"
}

Updating a comment with a CommentInfo body requires the comment number (e.g. 1) project name (e.g. myProject), version (e.g. 1.2.3), and updated comment (e.g. This is a newer comment)

POST /api/sca/issues

{
  "number":1,
  "project": "myProject", 
  "version": "1.2.3", 
  "comment": "This is a newer comment"
}

Response Specification

ResponseDetails
200 (Success)indicates the comment was successfully entered
400 (Invalid Input)indicates invalid or missing properties on the CommentInfo object; the body will provide some details as text
403 (Unauthorized API Key)indicates a missing, unknown, or unauthorized API Key; the body will be empty
500 (Server Error)indicates an unexpected error; the body will contain the message and stack trace, and this will also be logged

Was this article helpful?

What's Next