GET /resources/{path:.*}

Returns the platform resource, such as a CSS file, specified in the path. Can also return a folder and its contents in a ZIP file.

The response is cached for one hour unless the ResourceVersionKey in the resource path changes.

Note: There is another operation you can use to retrieve platform resources: in the UI Application service: GET /ui/apps/{application}/{version}/{path:resources/.*}. We recommend using that operation rather than this one. The functionality is essentially the same. Content retrieved using this API is cached for 1 hour; content retrieved using the UI Application service is cached for 1 month.

Authorization Roles/Permissions: No permission needed. Anyone can run this operation.

Note: The CSRF header is never required for this operation, regardless of platform settings.

This topic includes the following sections:

HTTP Method

GET

URL

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

Sample Request

The example below shows a request for the reset.css file used by the online help for the Community Manager developer portal.

Request URL #1: views the file

http://acmepaymentscorp.com/resources/style/reset.css

Request URL #2: downloads the file

http://acmepaymentscorp.com/resources/style/reset.css?download=true

Request URL #3: views an image file previously uploaded to the /resources folder

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

Sample request headers

None needed.

Sample request body

Not applicable.

Request Headers

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

None.

Request Parameters

Parameter Parm Type Data Type Required Description
path Path String Required The path for the content being retrieved. Include the path from the /resources/ folder downwards.
dynamic Query Boolean Optional Indicates whether the upload file content includes dynamic placeholders to be replaced with current values valid on the platform. Default: false. For possible values, see Console Resource dynamic variable values.
download Query Boolean Optional Indicates whether the content is being downloaded. Default: false.
zip Query Boolean Optional Used when getting a folder, to get the folder and its contents as one ZIP file. Default: false.
ReturnDefault Query Boolean Optional If set to False, this operation only returns files that were uploaded, not default files. If set to true (the default) returns out-of-the-box files, such as style.css, as well as any uploaded files.

Response

If successful, this operation returns HTTP status code 200, with the requested content.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers

HTTP/1.1 200 OK
Cache-Control: max-age=3600, public
Content-Type: text/css
X-Frame-Options: SAMEORIGIN

Sample response body

The content below has been abbreviated for display purposes.

****************** start reset.less ************/
/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,

Response Headers

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

Header Description
X-Frame-Options Optional header sometimes used as a security measure to control whether content can be displayed within an <iframe> tag.

Response Body

The response body is the requested file.

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
500 An error occurred processing the call.

More information about Akana API Platform API error messages.