Developers
How can we help you?
Platform
Note: This resource links can be expanded using the expand option.
A platform is something like YouTube. Think of it as a place where videos can be published to. Sometimes these platforms are governed by a set of requirements (like under what business models it operates, or for what devices), but it is too early to talk about that.
Note: The
metadata
link is a deprecated feature, it is no longer supported and it will be removed soon.
In Mediagenix On-Demand land, a platform looks like this:
<?xml version='1.0' encoding='utf-8' ?>
<platform>
<name>Mediagenix On-Demand Movies</name>
<timezone>London</timezone>
<external-id>C5080530001</external-id>
<link rel="self" href="https://movida.bebanjo.net/api/platforms/1"/>
<link rel="schedule" href="https://movida.bebanjo.net/api/platforms/1/schedule" />
<link rel="requirements" href="https://movida.bebanjo.net/api/platforms/1/requirements"/>
<link rel="metadata" href="https://movida.bebanjo.net/api/platforms/1/metadata"/>
<link rel="outlet" href="https://movida.bebanjo.nett/api/outlets/2"/>
</platform>
{
"resource_type": "platform",
"id": 1,
"name": "Mediagenix On-Demand Movies",
"timezone": "London",
"external_id": "C5080530001",
"self_link": "https://movida.bebanjo.net/api/platforms/1",
"schedule_link": "https://movida.bebanjo.net/api/platforms/1/schedule",
"requirements_link": "https://movida.bebanjo.net/api/platforms/1/requirements",
"metadata_link": "https://movida.bebanjo.net/api/platforms/1/metadata",
"outlet_link": "https://movida.bebanjo.net/api/outlets/2"
}
Get a list of all platforms
As you would expect, just do a GET /api/platforms
:
$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/platforms?pagination=true&per_page=10&page=1
$ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/platforms?pagination=true&per_page=10&page=1
And:
<?xml version='1.0' encoding='utf-8' ?>
<platforms type="array">
<total-entries>328</total-entries>
<link rel="next" href="https://movida.bebanjo.net/api/platforms?page=2&pagination=true&per_page=10"/>
<platform>
<id type="integer">1</id>
<name>Mediagenix On-Demand Movies</name>
<timezone>London</timezone>
<external-id>C5080530001</external-id>
<link rel="self" href="https://movida.bebanjo.net/api/platforms/1"/>
<link rel="schedule" href="https://movida.bebanjo.net/api/platforms/1/schedule"/>
<link rel="requirements" href="https://movida.bebanjo.net/api/platforms/1/requirements"/>
<link rel="metadata" href="https://movida.bebanjo.net/api/platforms/1/metadata"/>
<link rel="outlet" href="https://movida.bebanjo.nett/api/outlets/2"/>
</platform>
<platform>
<id type="integer">2</id>
<name>YouTube</name>
<timezone>London</timezone>
<external-id>C5080530002</external-id>
<link rel="self" href="https://movida.bebanjo.net/api/platforms/2"/>
<link rel="schedule" href="https://movida.bebanjo.net/api/platforms/2/schedule"/>
<link rel="requirements" href="https://movida.bebanjo.net/api/platforms/2/requirements"/>
<link rel="metadata" href="https://movida.bebanjo.net/api/platforms/2/metadata"/>
<link rel="outlet" href="https://movida.bebanjo.nett/api/outlets/3"/>
</platform>
<!-- ... -->
</platforms>
{
"total_entries": 328,
"next_link": "https://movida.bebanjo.net/api/platforms?page=2&pagination=true&per_page=10",
"entries": [
{
"resource_type": "platform",
"id": 1,
"name": "Mediagenix On-Demand Movies",
"timezone": "London",
"external_id": "C5080530001",
"self_link": "https://movida.bebanjo.net/api/platforms/1",
"schedule_link": "https://movida.bebanjo.net/api/platforms/1/schedule",
"requirements_link": "https://movida.bebanjo.net/api/platforms/1/requirements",
"metadata_link": "https://movida.bebanjo.net/api/platforms/1/metadata"
"outlet_link": "https://movida.bebanjo.net/api/outlets/2"
},
{
"resource_type": "platform",
"id": 2,
"name": "YouTube",
"timezone": "London",
"external_id": null,
"self_link": "https://movida.bebanjo.net/api/platforms/2",
"schedule_link": "https://movida.bebanjo.net/api/platforms/2/schedule",
"requirements_link": "https://movida.bebanjo.net/api/platforms/2/requirements",
"metadata_link": "https://movida.bebanjo.net/api/platforms/2/metadata"
},
// ...
]
}
You can then follow the links to access their respective schedules.
Note: With pagination enabled, only 50 platforms will be included in each page by default. But you can override this by using the
per_page
parameter. Thetotal-entries
attribute will show the total number of entries and the linksrel="next"
andrel="prev"
should be used to get to the next and the previous pages.
Valid attributes
-
external_id
: You can filter the list of platforms by passing in anexternal_id
. Because Mediagenix On-Demand was designed to integrate with external content management system, it has an attribute calledexternal_id
for every platform. This attribute can be used to store the ID of that specific item in an external system. -
pagination
: If you want to enable pagination you need to provide apagination
parameter with a value oftrue
. Note that by default, pagination is not enabled for this endpoint. -
per_page
: The number of elements returned in each page. The maximum value allowed is200
and the default is50
. Only effective with pagination enabled. -
page
: The number of the page you want to get. Only effective with pagination enabled.
Get a platform by external_id
If you needed to access a platform by external_id
, you can do so by passing the parameter external_id
to the list of platforms, like this:
$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/platforms?external_id=C5080530001
$ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/platforms?external_id=C5080530001
Which would filter by the passed external_id
like:
<?xml version="1.0" encoding="UTF-8"?>
<platforms type="array">
<platform>
<id type="integer">1</id>
<name>Mediagenix On-Demand Movies</name>
<timezone>London</timezone>
<external-id>C5080530001</external-id>
<link rel="self" href="https://movida.bebanjo.net/api/platforms/1"/>
<link rel="schedule" href="https://movida.bebanjo.net/api/platforms/1/schedule" />
<link rel="requirements" href="https://movida.bebanjo.net/api/platforms/1/requirements"/>
<link rel="metadata" href="https://movida.bebanjo.net/api/platforms/1/metadata"/>
<link rel="outlet" href="https://movida.bebanjo.nett/api/outlets/2"/>
</platform>
</platforms>
{
"entries": [
{
"resource_type": "platform",
"id": 1,
"name": "Mediagenix On-Demand Movies",
"timezone": "London",
"external_id": "C5080530001",
"self_link": "https://movida.bebanjo.net/api/platforms/1",
"schedule_link": "https://movida.bebanjo.net/api/platforms/1/schedule",
"requirements_link": "https://movida.bebanjo.net/api/platforms/1/requirements",
"metadata_link": "https://movida.bebanjo.net/api/platforms/1/metadata",
"outlet_link": "https://movida.bebanjo.net/api/outlets/2"
}
]
}