Skip to content

Developers

How can we help you?

← Go back

Denied right

Mediagenix On-Demand’s denied rights represent a set of conditions on a content for which rights are not available. They apply on a feature, a clip or a series.

This is how a denied right looks like:

<?xml version="1.0" encoding="UTF-8"?>
<denied-right>
  <id type="integer">4</id>
  <external-id>C5080530001</external-id>
  <name>DeniedRight #1</name>
  <reason>No rights</reason>
  <enabled type="boolean">true</enabled>
  <link rel="self" href="https://movida.bebanjo.net/denied_rights/4"/>
  <link rel="licensable" href="https://movida.bebanjo.net/title_groups/1"/>
  <link rel="specific_platforms" href="https://movida.bebanjo.net/denied_rights/4/specific_platforms"/>
</denied-right>
{
  "resource_type": "denied_right",
  "id": 4,
  "external_id": "C5080530001",
  "name": "DeniedRight #1",
  "reason": "No rights",
  "self_link": "https://movida.bebanjo.net/api/denied_rights/4",
  "licensable_link": "https://movida.bebanjo.net/api/title_groups/10030255",
  "specific_platforms_link": "https://movida.bebanjo.net/api/denied_rights/4/specific_platforms"
}

Valid attributes

  • id (required): Mediagenix On-Demand internal identifier of the denied right.
  • external-id (optional): the identifier of the denied right in the external system. If provided, it has to be unique in the scope of the company.
  • name (optional): name of the denied right, meaningful to the user. When no value is provided, Mediagenix On-Demand will store a generic name based on number of denied rights in the licensable, such as DeniedRight #1.
  • reason (optional): the denial reason.

Get a list of all denied rights in the current account

Denied rights are linked from the root of the API, through the link identified with the rel="denied_rights" attribute:

<?xml version="1.0" encoding="UTF-8"?>
<movida>
  <!-- ... -->
  <link rel="denied_rights" href="https://movida.bebanjo.net/api/denied_rights">
  <!-- ... -->
</movida>
{
  "resource_type": "movida",
  // ...
  "denied_rights_link": "https://movida.bebanjo.net/api/denied_rights",
  // ...
}

Following that link, we can fetch the list of denied rights in the current account.

$ curl --digest -u robot_user:password "https://movida.bebanjo.net/api/denied_rights?page=2"
$ curl --digest -u robot_user:password -H "Accept: application/json" "https://movida.bebanjo.net/api/denied_rights?page=2"
<?xml version="1.0" encoding="UTF-8"?>
<denied-rights type="array">
  <total-entries>113</total-entries>
  <link rel="next" href="https://movida.bebanjo.net/api/denied_rights?page=1"/>
  <link rel="prev" href="https://movida.bebanjo.net/api/denied_rights?page=3"/>
  <denied-right>
    <id type="integer">5</id>
    <external-id nil="true"/>
    <name>DeniedRight #1</name>
    <!-- ... -->
  </denied-right>
  <denied-right>
    <id type="integer">6</id>
    <external-id nil="true"/>
    <name>DeniedRight #2</name>
    <!-- ... -->
  </denied-right>
  <!-- ... -->
</denied-rights>
{
  "total_entries": 113,
  "prev_link": "https://movida.bebanjo.net/api/denied_rights?page=1",
  "next_link": "https://movida.bebanjo.net/api/denied_rights?page=3",
  "entries": [
    {
      "resource_type": "denied_right",
      "id": 5,
      "external_id": null,
      "name": "DeniedRight #1",
      // ...
    },
    {
      "resource_type": "denied_right",
      "id": 6,
      "external_id": null,
      "name": "DeniedRight #2",
      // ...
    }
    // ...
  ]
}

Note: This is a paginated resource. By default, only 50 denied rights will be included in each page but you can override this default by using the per_page parameter described in the next section. The total-entries attribute will indicate the total number of entries and the links rel="next" and rel="prev" should be used to get the next and the previous pages.

Valid attributes

You can filter the list of denied rights returned using the following parameters:

  • external_id: It will return only the Denied right with the exact given external_id (if any).

  • per_page: Number of elements returned in each page. The maximum value allowed is 200 and the default is 50.

  • page: Number of the page you want to be returned.

Get a list of denied rights from a feature or series

Given an existing feature, for example:

  <title>
    <id type="integer">12</id>
    <name>Silicon Computers</name>
    <title>Silicon Computers</title>
    <external-id nil="true"/>
    <title-type>feature</title-type>
    <tags></tags>
    <link rel="self" href="https://movida.bebanjo.net/api/titles/12"/>
    <link rel="schedule" href="https://movida.bebanjo.net/api/titles/12/schedule"/>
    <link rel="availability_windows" href="https://movida.bebanjo.net/api/titles/12/availability_windows"/>
    <link rel="title_groups" href="https://movida.bebanjo.net/api/titles/12/title_groups"/>
    <link rel="licensor" href="https://movida.bebanjo.net/api/licensors/114"/>
    <link rel="images" href="https://movida.bebanjo.net/api/titles/12/images"/>
    <link rel="assets" href="https://movida.bebanjo.net/api/titles/12/assets"/>
    <link rel="metadata" href="https://movida.bebanjo.net/api/titles/12/metadata"/>
    <link rel="blackouts" href="https://movida.bebanjo.net/api/titles/12/blackouts"/>
    <link rel="rights" href="https://movida.bebanjo.net/api/titles/12/rights"/>
    <link rel="denied_rights" href="https://movida.bebanjo.net/api/titles/12/denied_rights"/>
    <link rel="trailers" href="https://movida.bebanjo.net/api/titles/12/trailers"/>
  </title>
{
  "resource_type": "title",
  "id": 12,
  "name": "Silicon Computers",
  "title": "Silicon Computers",
  "external_id": null,
  "title_type": "feature",
  "tags": "",
  "self_link": "https://movida.bebanjo.net/api/titles/12",
  "schedule_link": "https://movida.bebanjo.net/api/titles/12/schedule",
  "linear_schedulings_link": "https://movida.bebanjo.net/api/titles/12/linear_schedulings",
  "availability_windows_link": "https://movida.bebanjo.net/api/titles/12/availability_windows",
  "title_groups_link": "https://movida.bebanjo.net/api/titles/12/title_groups",
  "licensor_link": "https://movida.bebanjo.net/api/licensors/114",
  "images_link": "https://movida.bebanjo.net/api/titles/12/images",
  "assets_link": "https://movida.bebanjo.net/api/titles/12/assets",
  "metadata_link": "https://movida.bebanjo.net/api/titles/12/metadata",
  "blackouts_link": "https://movida.bebanjo.net/api/titles/12/blackouts",
  "rights_link": "https://movida.bebanjo.net/api/titles/12/rights",
  "denied_rights_link": "https://movida.bebanjo.net/api/titles/12/denied_rights",
  "rules_link": "https://movida.bebanjo.net/api/titles/12/rules",
  "clips_link": "https://movida.bebanjo.net/api/titles/12/clips",
  "note_link": "https://movida.bebanjo.net/api/titles/12/note"
}

All the denied rights of that feature can be obtained by following the link rel="denied_rights":

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/titles/12/denied_rights
$ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/titles/12/denied_rights
<denied-rights type="array">
  <total-entries>2</total-entries>
  <denied-right>
    <id type="integer">7</id>
    <external-id>C5080530001</external-id>
    <name>DeniedRight #1</name>
    <reason nil="true"/>
    <link rel="self" href="https://movida.bebanjo.net/api/denied_rights/7"/>
    <link rel="licensable" href="https://movida.bebanjo.net/api/titles/12"/>
    <link rel="specific_platforms" href="https://movida.bebanjo.net/denied_rights/7/specific_platforms"/>
  </denied-right>
  <denied-right>
    <id type="integer">8</id>
    <external-id>C5080530002</external-id>
    <name>DeniedRight #2</name>
    <reason nil="true"/>
    <link rel="self" href="https://movida.bebanjo.net/denied_rights/8"/>
    <link rel="licensable" href="https://movida.bebanjo.net/api/titles/12"/>
    <link rel="specific_platforms" href="https://movida.bebanjo.net/denied_rights/8/specific_platforms"/>
  </denied-right>
</denied-rights>
{
  "total_entries": 2,
  "entries": [
    {
      "resource_type": "denied_right",
      "id": 7,
      "external_id": "C5080530001",
      "name": "DeniedRight #1",
      "reason": null,
      "self_link": "https://movida.bebanjo.net/api/denied_rights/7",
      "licensable_link": "https://movida.bebanjo.net/api/titles/12",
      "specific_platforms_link": "https://movida.bebanjo.net/api/denied_rights/7/specific_platforms"
    },
    {
      "resource_type": "denied_right",
      "id": 8,
      "external_id": "C5080530002",
      "name": "DeniedRight #2",
      "reason": null,
      "self_link": "https://movida.bebanjo.net/api/denied_rights/8",
      "licensable_link": "https://movida.bebanjo.net/api/titles/12",
      "specific_platforms_link": "https://movida.bebanjo.net/api/denied_rights/8/specific_platforms"
    }
  ]
}

Get a single denied right

Just do a GET to the URI of the denied right (the one in the attribute rel="self"):

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/denied_rights/6
$ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/denied_rights/6
<denied-right>
  <id type="integer">6</id>
  <external-id>C5080530003</external-id>
  <name>DeniedRight #5</name>
  <reason nil="true"/>
  <link rel="self" href="https://movida.bebanjo.net/denied_rights/6"/>
  <link rel="licensable" href="https://movida.bebanjo.net/titles/3"/>
  <link rel="specific_platforms" href="https://movida.bebanjo.net/denied_rights/6/specific_platforms"/>
</right>
{
  "resource_type": "denied_right",
  "id": 6,
  "external_id": "C5080530003",
  "name": "DeniedRight #5",
  "reason": null,
  "self_link": "https://movida.bebanjo.net/api/denied_rights/6",
  "licensable_link": "https://movida.bebanjo.net/api/titles/3",
  "specific_platforms_link": "https://movida.bebanjo.net/api/denied_rights/6/specific_platforms"
}

Creating a denied right inside a feature

As our introduction to REST APIs page suggests, you can create a denied right issuing a POST request to each denied right URI:

$ cat denied_right.xml
$ cat denied_right.json
<denied-right>
  <external-id>C5080530004</external-id>
  <name>DeniedRight #1</name>
</denied-right>
{
  "external_id": "C5080530004",
  "name": "DeniedRight #1"
}
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X POST -d @denied_right.xml "https://movida.bebanjo.net/api/titles/1/denied_rights"
$ curl --digest -u robot_user:password -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d @denied_right.json "https://movida.bebanjo.net/api/titles/1/denied_rights"

As always Mediagenix On-Demand will return the full XML/JSON of the denied right just created:

<?xml version="1.0" encoding="UTF-8"?>
<denied-right>
  <id type="integer">13</id>
  <external-id>C5080530004</external-id>
  <name>DeniedRight #1</name>
  <reason nil="true"/>
  <link rel="self" href="https://movida.bebanjo.net/api/denied_rights/13"/>
  <link rel="licensable" href="https://movida.bebanjo.net/titles/1"/>
  <link rel="specific_platforms" href="https://movida.bebanjo.net/denied_rights/13/specific_platforms"/>
</denied-right>
{
  "resource_type": "denied_right",
  "id": 13,
  "external_id": "C5080530004",
  "name": "DeniedRight #1",
  "reason": null
  "self_link": "https://movida.bebanjo.net/api/denied_rights/13",
  "licensable_link": "https://movida.bebanjo.net/api/titles/1",
  "specific_platforms_link": "https://movida.bebanjo.net/api/denied_rights/13/specific_platforms"
}

Creating a denied right inside a series

As our introduction to REST APIs page suggests, you can create a denied right issuing a POST request to each denied right URI:

$ cat denied_right.xml
$ cat denied_right.json
<denied-right>
  <external-id>C5080530006</external-id>
  <name>DeniedRight #1</name>
</denied-right>
{
  "external_id": "C5080530006",
  "name": "DeniedRight #1"
}
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X POST -d @denied_right.xml "https://movida.bebanjo.net/api/title_groups/9/denied_rights"
$ curl --digest -u robot_user:password -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d @denied_right.json "https://movida.bebanjo.net/api/title_groups/9/denied_rights"

Mediagenix On-Demand will return the full XML/JSON of the denied right just created:

<?xml version="1.0" encoding="UTF-8"?>
<denied-right>
  <id>14</id>
  <external-id>C5080530006</external-id>
  <name>DeniedRight #1</name>
  <reason nil="true"/>
  <link rel="self" href="https://movida.bebanjo.net/api/denied_rights/14"/>
  <link rel="licensable" href="https://movida.bebanjo.net/title_groups/9"/>
  <link rel="specific_platforms" href="https://movida.bebanjo.net/denied_rights/14/specific_platforms"/>
</right>
{
  "resource_type": "denied_right",
  "id": 14,
  "external_id": "C5080530006",
  "name": "DeniedRight #1",
  "reason": null,
  "self_link": "https://movida.bebanjo.net/api/denied_rights/14",
  "licensable_link": "https://movida.bebanjo.net/api/title_groups/9",
  "specific_platforms_link": "https://movida.bebanjo.net/api/denied_rights/14/specific_platforms"
}

Updating a denied right

As our introduction to REST APIs page suggests, you can update a denied right issuing a PUT request to each denied right URI:

$ cat denied_right_update.xml
$ cat denied_right_update.json
<denied-right>
  <name>Another name</name>
</denied-right>
{
  "name": "Another name"
}
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X PUT -d @denied_right_update.xml "https://movida.bebanjo.net/api/denied_rights/13"
$ curl --digest -u robot_user:password -H "Content-Type: application/json" -H "Accept: application/json" -X PUT -d @denied_right_update.json "https://movida.bebanjo.net/api/denied_rights/13"

As always Mediagenix On-Demand will return the full XML/JSON of the denied right just updated:

<?xml version="1.0" encoding="UTF-8"?>
<denied-right>
  <id>13</id>
  <external-id>C5080530004</external-id>
  <name>Another name</name>
  <reason nil="true"/>
  <link rel="self" href="https://movida.bebanjo.net/api/denied_rights/13"/>
  <link rel="licensable" href="https://movida.bebanjo.net/api/title_groups/1"/>
  <link rel="specific_platforms" href="https://movida.bebanjo.net/denied_rights/13/specific_platforms"/>
</denied-right>
{
  "resource_type": "denied_right",
  "id": 13,
  "external_id": "C5080530004",
  "name": "Another name",
  "reason": null,
  "self_link": "https://movida.bebanjo.net/api/denied_rights/13",
  "licensable_link": "https://movida.bebanjo.net/api/titles/1",
  "specific_platforms_link": "https://movida.bebanjo.net/api/denied_rights/13/specific_platforms"
}

Deleting a denied right

Also you can delete a denied right using DELETE request to each denied right URI:

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

The DELETE request doesn’t return anything, as that denied right is now gone.

Conflicts with existing rights

It is not possible to create a denied right for a content which already has at least one right configured. Such creation attempt will result in an error response:

<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>There are rights recorded for the platforms you have just selected. You must remove them before you can deny rights</error>
</errors>
{
  "errors": [
    "There are rights recorded for the platforms you have just selected. You must remove them before you can deny rights"
  ]
}