Audios

Using EiTV Cloud API you can retrieve all audios that are available on your instance:

method: GET
URL: /audios.json

PARAMETERS:
{
  “media_page”: “NUMBER” # Pagination, starting on 1 (if 0 or null, no pagination) 
}
RETURN:
{
  "page": "audios",
  "audios": [
    {
      “AUDIO INFORMATION”
    }
  ],
  "pagination": {
    "current": “NUMBER”, # Current page
    "last": true/false # If last page, true
  }
}

Using a audio ID, you can get all information about this content.

method: GET
URL: /audios/ID.json # ID Format NUMBER-TEXT

PARAMETERS:
{
  “comment_page”: “NUMBER” # Pagination of comments, starting on 1
}
RETURN:
{
  "page": "audio",
  "media":
    { 
      "id": "ID", 
      "name": "NAME",
      "description": "DESCRIPTION",
      "html_description": "HTML ADDITIONAL DESCRIPTION",
      "promote": true/false, # Promote on Home Page
      "demote": true/false, # Do not show on Home
      "date": "DATE",
      "type": "audio",
      "time_ago_in_words": "FULL DATE",
      "views": NUMBER, 
      "impressions": NUMBER, 
      "duration": "DURATION", 
      "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: /audios/[ID]/retrieve?format=thumb
ID: format NUMBER-TEXT

To get the specific player (iframe) for a media, you should request:

URL: /audios/[ID]/play?format=[auto]

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: /audios/[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”
    } 
}

You can remove a comment using the request:

method: DELETE
URL: /audios/[MEDIA_ID]/comments/[ID].json # media ID and comment ID consist of NUMBER-TEXT

To get the comment replies:

method: GET
URL: /audios/[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
  }
}

Rating a content is available with the method:

method: POST
URL: /audios/[MEDIA_ID]/ratings.json # ID – NUMBER-TEXT

PARAMETERS:
{
  “rating”: [“”|”up”|”down”] # “up” = like, “down” = dislike, “” = none
}

And rating a comment:

method: POST
URL: /audios/[MEDIA_ID]/comments/[ID]/ratings.json # ID – NUMBER-TEXT

PARAMETERS:
{
  “rating”: [“”|”up”|”down”] # “up” = like, “down” = dislike, “” = none
}
<< Previous topic Next topic >>