POST /api/boards/items/comments/{CommentID}/artifacts

Adds an artifact, such as an uploaded image or file, to be used in the markdown for a comment that is being edited (subsequent artifact, after the first).

Authorization Roles/Permissions: Must be a user logged in to the platform, with visibility of the Board. For more information about how authorization and visibility work for Board operations, see Boards in the developer portal.

This topic includes the following sections:

HTTP Method

POST

Back to top

URL

https://{hostname}/api/boards/items/comments/{CommentID}/artifacts

Back to top

Sample Request

The example below shows adding a subsequent artifact to a new comment.

Request URL

https://{hostname}/api/boards/items/comments/c23c3cb9-3da0-4448-b584-2fef489d3ddf.acmepaymentscorp/artifacts

Sample request headers

POST http://{hostname}/api/boards/items/comments/c23c3cb9-3da0-4448-b584-2fef489d3ddf.acmepaymentscorp/artifacts?wrapInHTML=true HTTP/1.0
Host: {hostname}
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
X-Csrf-Token_{tenant}: {TokenID}

Sample request body

The request body is the image or other file being uploaded to the comment.

Back to top

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json, application/vnd.soa.v80+json, application/vnd.soa.v81+json
Content-Type multipart/form-data
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform.

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
CommentID Path string Required The unique ID for a specific comment.
InMultiPart Body multipart Required The artifact; an image or other file to be uploaded as part of the content of the board item. For more information, see Managing Multipart/Form-Data Uploads.

Back to top

Response

If successful, this operation returns HTTP status code 200, with information about the artifact that was uploaded.

Back to top

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers: application/json

HTTP/1.1 200 OK
Content-Type: application/json
Expires: Tue, 09 Jun 2015 17:25:01 GMT

Sample response body: application/json

{
  "ContextID" : "c23c3cb9-3da0-4448-b584-2fef489d3ddf.acmepaymentscorp",
  "FileName" : "img_dollars_03.jpg",
  "BaseUri" : "http://{hostname}",
  "UriPath" : "/api/boards/items/comments/c23c3cb9-3da0-4448-b584-2fef489d3ddf.acmepaymentscorp/artifacts/img_dollars_03.jpg"
}

Back to top

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json, application/vnd.soa.v80+json, application/vnd.soa.v81+json

Back to top

Response Body

Name Type Description
BoardItemArtifact BoardItemArtifact Contains information about an image or other artifact associated with a Board item. Applicable only if the DescriptionMediaType for the Board item is text/markdown.

Back to top

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics