Skip to content

Developers

How can we help you?

← Go back

Playlist

The playlist resource represents a collection of playlist entries, which represent the pieces of content that should be played in that list.

A playlist looks like this:

<?xml version='1.0' encoding='utf-8' ?>
<playlist>
  <id type="integer">10</id>
  <link rel="self" href="https://movida.bebanjo.net/api/playlists/10"/>
  <link rel="playlist-entries" href="https://movida.bebanjo.net/api/playlists/10/playlist_entries">
</playlist>
{
  "resource_type": "playlist",
  "id": 10,
  "self_link": "https://movida.bebanjo.net/api/playlists/10",
  "playlist-entries_link": "https://movida.bebanjo.net/api/playlists/10/playlist_entries"
}

Get a playlist

Playlists are linked in scheduling resource. Like here:

<?xml version='1.0' encoding='utf-8' ?>
<scheduling>
  <!-- ... -->
  <link rel="playlist" href="https://movida.bebanjo.net/api/playlists/10"/>
  <!-- ... -->
</scheduling>
{
  "resource_type": "scheduling",
  // ...
  "playlist_link": "https://movida.bebanjo.net/api/playlists/10",
  // ...
}

Follow that URL:

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/playlists/10
$ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/playlists/10

Would yield something like:

<?xml version='1.0' encoding='utf-8' ?>
<playlist>
  <id type="integer">10</id>
  <link rel="self" href="https://movida.bebanjo.net/api/playlists/10"/>
  <link rel="playlist-entries" href="https://movida.bebanjo.net/api/playlists/10/playlist_entries">
</playlist>
{
  "resource_type": "playlist",
  "id": 10,
  "self_link": "https://movida.bebanjo.net/api/playlists/10",
  "playlist-entries_link": "https://movida.bebanjo.net/api/playlists/10/playlist_entries"
}

Get a list of playlist entries from a playlist

To get the list of entries of a playlist, the node with the rel attribute identified with the value playlist-entries should be followed:

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/playlists/13/playlist_entries
$ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/playlists/13/playlist_entries

And would yield something like:

<?xml version='1.0' encoding='utf-8' ?>
<playlist-entries type="array">
  <total-entries>2</total-entries>
  <playlist-entry>
    <id type="integer">10</id>
    <position>1</position>
    <link rel="self" href="https://movida.bebanjo.net/api/playlist-entries/10"/>
    <link rel="asset" href="https://movida.bebanjo.net/api/asset/23"/>
    <link rel="segment" href="https://movida.bebanjo.net/api/segment/2"/>
  </playlist-entry>
  <playlist-entry>
    <id type="integer">11</id>
    <position>2</position>
    <link rel="self" href="https://movida.bebanjo.net/api/playlist-entries/11"/>
    <link rel="asset" href="https://movida.bebanjo.net/api/asset/23"/>
  </playlist-entry>
</playlist-entries>
{
  "total_entries": 2,
  "entries": [
    {
      "resource_type": "playlist_entry",
      "id": 10,
      "position": 1,
      "self_link": "https://movida.bebanjo.net/api/playlist_entries/10",
      "asset_link": "https://movida.bebanjo.net/api/assets/23",
      "segment_link": "https://movida.bebanjo.net/api/segments/2"
    },
    {
      "resource_type": "playlist_entry",
      "id": 11,
      "position": 2,
      "self_link": "https://movida.bebanjo.net/api/playlist_entries/11",
      "asset_link": "https://movida.bebanjo.net/api/assets/23"
    }
  ]
}