POST /resources/{path:.*}

Uploads a Community Manager developer portal resource, such as a stylesheet, to the /resources/ folder structure.

Authorization Roles/Permissions: Must be logged in. Site Admin only.

This topic includes the following sections:

HTTP Method

POST

URL

{protocol}://{hostname}/resources/{path:.*}

Sample Request

The example below shows an upload of a revised custom.less file.

Request URL #1

Uploads a revised custom.less file.

http://acmepaymentscorp.com/resources/theme/devportal/less?unpack=false

Request URL #2

Uploads an image file to the resources folder.

http://acmepaymentscorp.com/resources/img_lead.png

Sample request headers (for request #1)

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Content-Type: multipart/form-data; boundary=---------------------------2366399137693
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

The content below has been abbreviated for display purposes.

-----------------------------2366399137693
Content-Disposition: form-data; name="File"; filename="custom.less"
Content-Type: application/octet-stream
/**
 *  Commonly used variables to customize styles
 *  Tenant: acmepaymentscorp *  Theme: Default  
 */
// base color, often used for navbar (left or top) background color, link text color, button background color, etc 
// @main-color: #810040;
// when base color is used as a background, what's the text color on top? 
// @inverse-color: #fff;
// widgets, such as those on dashboard, header text color
// @widget-header-text-color: @box-header-text-color;
// color of the leftnav header over form elements -- example would be the leftnav filter widget on Dashboard
// @leftnav-header-text-color: lighten(@disabled-text-color,40%);
// default color of leftnav link item
// @leftnav-default-text-color: @leftnav-header-text-color;
// color of the text of leftnav link item that signifies where you are, the "active" item
// @leftnav-active-text-color: @canvas-color;
// leftnav background color 
// @leftnav-bg-color: @main-color;
// leftnav header, found for example on a leftnav set of board filters, text color 
// @leftnav-header-text-color: screen(lighten(@plain-text-color,25%),#ccc);
// any horizontal rule that appears in the leftnav 
// @leftnav-divider-color: @leftnav-active-text-color;
// top left logo image path
// @logo-img: url("images/logo_50.png");
// width of the logo, max 295px; logo height is fixed at 46px
// @logo-width: 232px;
// default link color
// @link-color: @main-color;
-----------------------------2366399137693
Content-Disposition: form-data; name="X-Csrf-Token_acmepaymentscorp"
TokenID%3D0a966054-61ff-11e5-b349-e7f5dfda3ec7%2CexpirationTime%3D1443020172984%2CUserFDN%3D
f3bd3fd0-5a62-420c-adb7-3c937111a37f%252Eacmepaymentscorp%2Csig%3DV-_Kv5MI9j0aQ2ooGv28UZJMpO
c8FXha41SIMqG96iWB0WE2FnLZTxRlyrYdRsAqGDj3-HiNYQpct4NWVRYBv0cTyB0FO6UCSIVYeYSoW2cO-Ghq17viyf-
JlSyqs18Z6p9PbI7bCR9yB5K9odK3sNz5gp7cMpM8kiPXvd_RiIM
-----------------------------2366399137693--

Request Headers

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

Header Description
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
inMP Body BufferedInMultiPart Required The content being uploaded.
path Path String Required The path for the content being uploaded. Include the path from the /resources/ folder downwards.
unpack Query Boolean Optional Indicates whether the content being uploaded is a ZIP file that needs to be unzipped. Default: False.

Response

If successful, this operation returns HTTP status code 200, and the specified content is uploaded to the platform resources folder structure.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers

HTTP/1.1 200 OK
Content-Type: text/html
Cache-Control: no-cache
Expires: Wed, 23 Sep 2015 09:34:18 GMT

Sample response body

None.

Response Headers

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

None.

Response Body

None.

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.
404

The resource could not be found.

For example, you might get this if the Accept header is set to a wrong value.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.