POST /api/boards/items/{BoardItemID}/artifacts

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

Note: If you are adding an artifact to a new board item, use the POST /api/boards/items/artifacts operation. The BoardItemID is assigned, and is returned in the response. If you are adding a subsequent artifact, use the POST /api/boards/items/{BoardItemID}/artifacts operation (this operation), referencing the BoardItemID that was assigned in the response for the first operation.

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/{BoardItemID}/artifacts

Sample Request

The example below shows adding a subsequent artifact to a new board item.

Sample Request URL

https://{hostname}/api/boards/items/d620210d-bab5-4446-aeff-e6e5c506ea5f.acmepaymentscorp/artifacts

Sample request headers

POST http://{hostname}/api/boards/items/d620210d-bab5-4446-aeff-e6e5c506ea5f.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_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

The request body is the uploaded image or other file.

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
BoardItemID Path string Required The unique ID for a specific Board item. Can be the unique ID for any Board item that supports markdown: Discussion, Ticket, Alert, Review, or 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.

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.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers: application/json

HTTP/1.1 200 OK
Content-Type: text/html
Expires: Fri, 22 May 2015 15:54:08 GMT

Sample response body: application/json

{
  "ContextID" : "d620210d-bab5-4446-aeff-e6e5c506ea5f.acmepaymentscorp",
  "FileName" : "img_dollarsign.jpg",
  "BaseUri" : "http://{hostname}",
  "UriPath" : "/api/boards/items/d620210d-bab5-4446-aeff-e6e5c506ea5f.acmepaymentscorp/img_dollarsign.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.