POST /api/boards/items/comments/artifacts

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

Authorization Roles/Permissions: Must be logged in. Must have visibility of the Board. For more information about how authorization and visibility work for Board operations, see Boards in the Community Manager developer portal.

This topic includes the following sections:

HTTP Method

POST

URL

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

Sample Request

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

Sample Request URL

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

Sample request headers

POST http://{hostname}/api/boards/items/comments/artifacts?wrapInHTML=true HTTP/1.0
Host: {hostname}
Accept: application/json
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

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

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
Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Request Parameters

Parameter Parm Type Data Type Required Description
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.

Note: For information about the wrapInHTML parameter shown in the sample request above, see File Upload with Ajax. This is only used if you are running the API in a browser context.

Response

If successful, this operation returns HTTP status code 200, with information about the artifact that was uploaded, including the CommentID that's created as a result.

Sample Response

The sample response below shows successful completion of this operation. The Comment ID is assigned as a result of this operation.

Sample response headers: application/json

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

Sample response body: application/json

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

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

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.

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. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.