Using EiTV Cloud API you can retrieve all videos that are avaailable on your instance:
method: GET
URL: /videos.json
PARAMETERS: { “media_page”: “NUMBER” # Pagination, starting on 1 (if 0 or null, no pagination) } RETURN: { "page": "videos", "videos": [ { “VIDEO INFORMATION” } ], "pagination": { "current": “NUMBER”, # Current page "last": true/false # If last page, true } }
Using a video ID, you can get all information about this content.
method: GET
URL: /videos/ID.json # ID Format NUMBER-TEXT
PARAMETERS: { “comment_page”: “NUMBER” # Pagination of comments, starting on 1 } RETURN: { "page": "video", "media": { "id": "ID", "name": "NAME", "description": "DESCRIPTION", "html_description": "HTML ADDITIONAL DESCRIPTION", "format": [ “FORMAT", # “240p”,”480p”,”720p” ], "promote": true/false, # Promote on Home Page "demote": true/false, # Do not show on Home "date": "DATE", "type": "video", "time_ago_in_words": "FULL DATE", "views": NUMBER, "impressions": NUMBER, "duration": "DURATION", "duration_in_seconds": NUMBER, "last_view_time: NUMBER, "likes": NUMBER, "deslikes": NUMBER, "comments": NUMBER, “comment_perm”: true/false, # Comments enabled “rating_perm”: true/false, # Rating enabled }, “comments”: [ { “id”: “ID” # Format NUMBER-TEXT “user_id”: “ID” “user_name”: “NAME” “content”: “COMMENT CONTENT” “date”: “DATE” "time_ago_in_words": "FULL DATE", "status": "available,under_review,unavailable", "num_children": NUMBER, "likes": NUMBER, "deslikes": NUMBER, "rating": [""|"up"|"down"], # Current user rating } ], “rating”: [“”|”up”|”down”], # Current user rating "pagination": { "current": “NUMBER”, # Current page "last": true/false # If last page, true } }
Following, we show how to get a specific content thumbnail:
URL: /videos/[ID]/retrieve?format=thumb
ID: format NUMBER-TEXT
Thumbnails can be shown in more than one resolution, you can choose the resolution using: format=thumb[240p,480p,720p] (available resolutions on media info)
To get the specific player (iframe) for a media, you should request:
URL: /videos/[ID]/play?format=[auto,240p,480p,720p]
ID: format NUMBER-TEXT
Before make the request, you should check available resolutions on Media Info.
Adding comments can be done using the following method:
method: POST
URL: /videos/[ID]/comments.json # media ID consists of NUMBER-TEXT
PARAMETERS: { "comment": { "reply_id": "NUMBER-TEXT" # comment ID, only if is a reply "content": "COMMENTS CONTENT" } } RETURN:
To get the comment replies:
method: GET
URL: /videos/[MEDIA_ID]/comments/[ID].json # media ID and comment ID consist of NUMBER-TEXT
PARAMETERS: { "children_page": "NUMBER" # Pagination of comments, starting on 1 "children_limit": "NUMBER" # If children_page == 0 } RETURN: { "page": "comment", "comments": { "COMMENT INFO" }, "children": [ { "COMMENT INFO" }, ], "pagination": { "current": "NUMBER", # Current page "last": true/false # If last page, true } }
You can remove a comment using the request:
method: DELETE
URL: /videos/[MEDIA_ID]/comments/[ID].json # media ID and comment ID consist of NUMBER-TEXT
RETURN:
Rating a content is available with the method:
method: POST
URL: /videos/[MEDIA_ID]/ratings.json # ID – NUMBER-TEXT
PARAMETERS: { "rating": [""|"up"|"down"] # “up” = like, “down” = dislike, “” = none } RETURN: {
And rating a comment:
method: POST
URL: /videos/[MEDIA_ID]/comments/[ID]/ratings.json # ID – NUMBER-TEXT
PARAMETERS: { "rating": [""|"up"|"down"] # “up” = like, “down” = dislike, “” = none } RETURN:
<< Previous topic | Next topic >> |
---|