Media API
Bringing together photo, music and video sharing services with file transfer and syncing functionalities. It is related with the Gallery Application and the file system of a device.
Objects
Objects | Description | Reference | Activities Mapping |
---|---|---|---|
[article] | Represents objects such as news articles, knowledge base entries, or other similar construct. Such objects generally consist of paragraphs of text, in some cases incorporating embedded media such as photos and inline hyperlinks to other resources. | AS Schema | [Article Mapping] |
[audio] | Represents audio content of any kind. | AS Schema | [Audio Mapping] |
[file] | Represents any form of document or file. Objects of this type MAY contain an additional fileUrl property whose value a dereferenceable IRI that can be used to retrieve the file; and an additional mimeType property whose value is the MIME type of the file described by the object. | AS Schema | [File Mapping] |
[photo] | Represents a graphical image. Objects of this type MAY contain an additional fullImage property whose value is an Activity Streams Media Link to a "full-sized" representation of the photo. | [Photo Mapping] | |
[video] | Represents video content of any kind. | AS Schema | [Video Mapping] |
Methods
Below there are the generally supported methods that Objects from Media API support. For special cases, see every object separately.
Method | Details | Call Method | API path | Properties | Response |
---|---|---|---|---|---|
Get a media object | This method returns an object with its properties | [REST] #GET |
|
OBJECT_ID | A media object |
Get all media objects for an account | This method returns all the media objects that have been published under an account. The media objects are of the same type (i.e. photo, video, article, file etc.) | [REST] #GET | e.g. API_PATH/12312313/photos |
ACCOUNT_ID | A list of same-type media objects |
Get media objects for an OPENi user | Gets all media objects for the authenticated user, for all her accounts, accept if they are filtered. | [REST] #GET | e.g. API_PATH/555/videos |
USER_ID, accounts={ACCOUNT_ID} | A list of same-type media objects |
Post a media object to a simple account | This method uploads an object to an account, given the object. | [REST] #POST | e.g. API_PATH/12312313/photos |
ACCOUNT_ID, {OBJECT}, media_content | A success or error code |
Post a media object to an aggregation | This method uploads an object to an aggregation, given the object. | [REST] #POST | e.g. API_PATH/5553_12312313/photos |
AGGREGATION_ID, {OBJECT}, media_content | A success or error code |
Post a media object to multiple services | This method uploads an object to multiple services, given the object and all the account_ids. | [REST] #POST | e.g. API_PATH/555/articles |
{OBJECT}, media_content, accounts={ACCOUNT_ID}. USER_ID is extracted from the authorized user. | A success or error code |
Edit a media object | This method can update properties and not media content. If the media_content must change, the object must be deleted and posted again as a new object. It is allowed only for the owner of the content or someone with permissions. | [REST] #PUT |
|
OBJECT_ID | A success or error code |
Delete a media object | This method deletes an object, owned by the authenticated user | [REST] #DELETE |
|
OBJECT_ID | A success or error code |
Connections
Below there are the generally supported connections that Objects from Media API. For special cases, see every object separately.
Objects | Description | Reference | Activities Mapping |
---|---|---|---|
[like] | This connection refers to most objects that have a social aspect, it is unique per user and has a timestamp. It declares awareness, approval or support. | AS Schema | [Like Mapping] |
[comment] | This connection leaves a text comment to another object. | AS Schema | [Comment Mapping] |
[dislike] | This connection refers to other objects, and declare | AS Schema | [Dislike Mapping] |
Methods
Method | Details | Call Method | API path | Properties | Response |
---|---|---|---|---|---|
Like an object | Likes an object for the authenticated user, for the given list of accounts. If supported by the service. | [REST] #POST |
|
OBJECT_ID, accounts={ACCOUNT_ID} | A success or error code |
Unlike an object | If there is already a like, it is removed, for the given list of accounts. | [REST] #DELETE |
|
OBJECT_ID, accounts={ACCOUNT_ID} | A success or error code |
Get likes for a media object | Returns all the likes for an object. | [REST] #GET |
|
OBJECT_ID | A list of [like]s |
Dislike an object | Dislikes an object for the authenticated user, for the given list of accounts. If supported by the service. | [REST] #POST |
|
OBJECT_ID, accounts={ACCOUNT_ID} | A success or error code |
Delete a dislike an object | If there is already a dislike, it is removed, for the given list of accounts. | [REST] #DELETE |
|
OBJECT_ID, accounts={ACCOUNT_ID} | A success or error code |
Get dislikes for a media object | Returns all the dislikes for an object. | [REST] #GET |
|
OBJECT_ID | A list of [dislike]s |
Post a comment to an object | This method posts a comment to a media object, given a list of accounts | [REST] #POST |
|
OBJECT_ID, accounts={ACCOUNT_ID}, title (if available), {text} | A success or error code |
Update a comment to a media object | This method updates a comment to an object. The authenticated user must one the account that has created the comment initially. | [REST] #PUT |
|
COMMENT_ID, title (if available), {text} | A success or error code |
Delete a comment from a media object | This method deletes a comment from an object. This method can be performed either by the owner of the comment or the owner of the object. | [REST] #DELETE |
|
COMMENT_ID | A success or error code |
Get comments for a media object | This method returns all the comments for a given object. | [REST] #GET |
|
OBJECT_ID | A list of [comment]s |
Aggregations
The objects defined above can be stored and manage in various aggregations. Below the relative aggregations and the allowed methods are defined.
Aggregations | Description | Reference | Mapping |
---|---|---|---|
[playlist] | A list of media objects that can be presented the one after the other. | OPENi | [Playlist mapping] |
[folder] | A place into a system, where different types of media files can be stored | OPENi | [Folder mapping] |
[page] | (e.g. blog) Represents an area, typically a web page, that is representative of, and generally managed by a particular entity. Such areas are usually dedicated to displaying descriptive information about the entity and showcasing recent content such as articles, photographs and videos. Most social networking applications, for example, provide individual users with their own dedicated "profile" pages. Several allow similar types of pages to be created for commercial entities, organizations or events. While the specific details of how pages are implemented, their characteristics and use may vary, the one unifying property is that they are typically "owned" by a single entity that is represented by the content provided by the page itself. | AS Schema | [Page mapping] |
Methods
Method | Details | Call Method | API path | Properties | Response |
---|---|---|---|---|---|
Get an aggregation | This method returns an aggregation with its properties | [REST] #GET |
|
AGGEGATION_ID | An aggregation object, with attached a list of its objects. |
Get all aggregations for an account | This method returns all the required aggregations that have been published under an account. The aggregations are of the same type (i.e. folder, album, playlist etc.) | [REST] #GET | e.g. API_PATH/12312313/albums |
ACCOUNT_ID | A list of same-type aggregations |
Get aggregations for an OPENi user | Gets all aggregations for the authenticated user, for all her accounts, accept if they are filtered. | [REST] #GET | e.g. API_PATH/555/folders |
USER_ID, accounts={ACCOUNT_ID} | A list of same-type aggregations |
Create an aggregation | This method creates an aggregation to an account, given the aggregation. | [REST] #POST | e.g. API_PATH/12312313/playlists |
ACCOUNT_ID, {AGGREGATION} | A success or error code |
Edit an aggregation | This method can update properties of an aggregation. It is allowed only for the owner of the content or someone with permissions. | [REST] #PUT |
|
AGGREGATION_ID | A success or error code |
Delete an aggregation | This method deletes an aggregation, owned by the authenticated user | [REST] #DELETE |
|
AGGREGATION_ID | A success or error code |
Connections
Connections are related to Aggregations just like the Objects. But the service must support the relative activity.
Related
Wiki: REST
Wiki: page
Wiki: Page mapping
Wiki: folder
Wiki: Folder mapping
Wiki: playlist
Wiki: Playlist mapping
Wiki: comment
Wiki: dislike
Wiki: like
Wiki: Dislike Mapping
Wiki: Comment Mapping
Wiki: Like Mapping
Wiki: video
Wiki: Video Mapping
Wiki: photo
Wiki: Photo Mapping
Wiki: file
Wiki: File Mapping
Wiki: audio
Wiki: Audio Mapping
Wiki: article
Wiki: Article Mapping
Wiki: T31-_OPENi_APIs_Specification
Wiki: T3.1- OPENi APIs Specification