File API Documentation

Overview

The File API returns representations relating to individual files referenced in a content package manifest.

URI Template
http://{host}/cartridges/{cartridge_id}/items/{item_id}/
files/{file_id}.{ext}
Returns an OpenSocial App Data representation of a file.

The file identifier path variable can be either a integer (zero based) index or the file name itself prefixed with a "@" symbol as a selector definition.

.xml, .json: returns an OpenSocial App Data representation of a file within a content package.

.js: returns an representation of the file to be directly embedded into any web page.

.app: redirects to a view of the file in a configured web application.

.do: redirects to a landing page about the file (such as a sign up form).

.go: redirects to the actual file itself(HTML page, PDF document, Flash video etc.).

Try It

http://api.icodeon.com/cartridges/OpenLearn-L120_1/items/ x_l120_1_1_1_item/files/14.json
http://api.icodeon.com/cartridges/OpenLearn-L120_1/items/ x_l120_1_1_1_item/files/14.xml
http://api.icodeon.com/cartridges/OpenLearn-L120_1/items/ x_l120_1_1_1_item/files/14.app
http://api.icodeon.com/cartridges/OpenLearn-L120_1/items/ x_l120_1_1_1_item/files/14.do
http://api.icodeon.com/cartridges/OpenLearn-L120_1/items/ x_l120_1_1_1_item/files/14.go

or

http://api.icodeon.com/cartridges/OpenLearn-L120_1/items/ x_l120_1_1_1_item/files/@l120_1_001v.flv.json
http://api.icodeon.com/cartridges/OpenLearn-L120_1/items/ x_l120_1_1_1_item/files/@l120_1_001v.flv.xml

Embed It
http://api.icodeon.com/cartridges/OpenLearn-L120_1/items/
x_l120_1_1_1_item/files/14.js
or
http://api.icodeon.com/cartridges/OpenLearn-L120_1/items/
x_l120_1_1_1_item/files/@l120_1_001v.flv.js
Example Embed

File type: video/x-flv



File type: application/x-shockwave-flash



File type: video/quicktime



File type: image/jpeg



File type: application/mp3