We use cookies (just for analytics) on this website. If you continue we will assume you are happy with it. ok

BeBanjo

Back to index

Deal

Note: This resource links can be expanded using the expand option except the rights, licensor, granted_requirements and specific_platforms links.

A deal provides a way to store all rights information as agreed in a licensing deal, where a set of umbrella rights will be agreed (license windows, business models, devices, platforms, etc.) and a list of features or series with equal or different availability windows will be governed by them.

This is how a deal looks through the API:

<deal>
  <id type="integer">123</id>
  <name>Marvel deal 2013</name>
  <external-id>Marvel2013</external-id>
  <right-type>archive</right-type>
  <starts type="date">2014-10-10</starts>
  <ends type="date">2015-10-31</ends>
  <rights-updated-at type="datetime">2014-10-01T00:00:00Z</rights-updated-at>
  <minimum-exploitation type="integer">10</minimum-exploitation>
  <maximum-exploitation type="integer">30</maximum-exploitation>
  <parity>start+end</parity>
  <link href="https://movida.bebanjo.net/api/deals/123" rel="self"/>
  <link href="https://movida.bebanjo.net/api/deals/123/rights" rel="rights"/>
  <link href="https://movida.bebanjo.net/api/deals/123/metadata" rel="metadata"/>
  <link href="https://movida.bebanjo.net/api/licensors/114" rel="licensor"/>
  <link href="https://movida.bebanjo.net/deals/123/granted_requirements" rel="granted_requirements"/>
  <link href="https://movida.bebanjo.net/deals/123/specific_platforms" rel="specific_platforms"/>
</deal>

Deal attributes

  • id (required): Movida internal identifier of the deal.

  • name (required): the name of the deal.

  • external-id (optional): the identifier of the deal in the external system.

  • right-type (required): the type of the rights the deal is composed of. Possible values are “archive” and “catchup”.

  • starts (optional): For archive deals, the date from which, the deal applies.

  • ends (optional): For archive deals, the date until which, the deal applies.

  • rights-updated-at (read_only): a timestamp indicating when the rights association with the deal has been updated the last time, in ISO8601 format. Will be nil if there is no rights elements yet. This value is refreshed when:

    • Any granted requirement is added to, updated or removed from the deal

    • Any right is added to, updated or removed from the deal

  • minimum-exploitation (optional): indicates the minimum duration in days on exploitation. Allowed values are: nil (if there is no such limit) and integer values greater or equal than 0. If a value maximum_explotation is provided too must be lower than that.

  • maximum-exploitation (optional): indicates the maximum duration in days on exploitation. Allowed values are: nil (if there is no such limit) and integer values greater or equal than 0. If a value minimum_explotation is provided too must be higher than that.

  • parity (optional): indicates if schedule entries must be specified en every platform with the same: start date, end date or same start and end dates. Allowed values are: nil (if there is no such restriction), ‘start’, ‘end’, and ‘start+end’.

Get a list of all deals in the account

Note: that this is a paginated resource. By default, only 50 deals 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" provide the next and the previous pages links.

Deals are linked from the root of the API, through the link identified with the rel="deals" attribute:

<?xml version="1.0" encoding="UTF-8"?>
<movida>
  <!-- ... -->
  <link rel="deals" href="https://movida.bebanjo.net/api/deals">
</movida>

Following that link, we can fetch the list of deals in the current account:

$ curl --digest -u robot_user https://movida.bebanjo.net/api/deals
<?xml version='1.0' encoding='utf-8' ?>
<deals type='array'>
  <total-entries>2</total-entries>
  <link href="https://movida.bebanjo.net/api/deals?page=2" rel="next"/>
  <deal>
    <id type="integer">2</id>
    <name>Marvel Deal 2013</name>
    <external-id>Marvel2013</external-id>
    <right-type>archive</right-type>
    <starts type="date">2014-10-10</starts>
    <ends type="date">2015-10-31</ends>
    <rights-updated-at type='datetime'>2014-10-26T04:47:09Z</rights-updated-at>
    <minimum-exploitation nil="true"/>
    <maximum-exploitation nil="true"/>
    <parity nil="true"/>
    <link rel="self" href="https://movida.bebanjo.net/deals/2"/>
    <link rel="rights" href="https://movida.bebanjo.net/deals/2/rights"/>
    <link rel="metadata" href="https://movida.bebanjo.net/deals/2/metadata"/>
    <link rel="granted_requirements" href="https://movida.bebanjo.net/deals/2/granted_requirements"/>
    <link rel="specific_platforms" href="https://movida.bebanjo.net/deals/2/specific_platforms"/>
  </deal>
  <deal>
    <id type="integer">4</id>
    <name>Supply License #1 : A3MI </name>
    <external-id></external-id>
    <right-type>archive</right-type>
    <starts type="date">2014-06-10</starts>
    <ends type="date">2015-07-01</ends>
    <rights-updated-at type='datetime'>2014-06-01T04:47:09Z</rights-updated-at>
    <minimum-exploitation nil="true"/>
    <maximum-exploitation nil="true"/>
    <parity nil="true"/>
    <link rel="self" href="https://movida.bebanjo.net/deals/4"/>
    <link rel="rights" href="https://movida.bebanjo.net/deals/4/rights"/>
    <link rel="metadata" href="https://movida.bebanjo.net/deals/4/metadata"/>
    <link rel="granted_requirements" href="https://movida.bebanjo.net/deals/4/granted_requirements"/>
    <link rel="specific_platforms" href="https://movida.bebanjo.net/deals/4/specific_platforms"/>
  </deal>
</deals>

You can also pass other attributes to limit the results:

  • external_id: You can filter the list of deals by passing in an external_id. This attribute can be used to store the ID of that specific deal in an external system.

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

Here is an example passing the external_id:

$ curl --digest -u robot_user http://movida.bebanjo.net/api/deals?external_id=Marvel2013
<?xml version='1.0' encoding='utf-8' ?>
<deals type='array'>
  <total-entries>1</total-entries>
  <deal>
    <id type="integer">2</id>
    <name>Marvel Deal 2013</name>
    <external-id>Marvel2013</external-id>
    <right-type>archive</right-type>
    <starts type="date">2014-06-10</starts>
    <ends type="date">2015-07-01</ends>
    <rights-updated-at type='datetime'>2014-10-26T04:47:09Z</rights-updated-at>
    <minimum-exploitation nil="true"/>
    <maximum-exploitation nil="true"/>
    <parity nil="true"/>
    <link rel="self" href="https://movida.bebanjo.net/deals/2"/>
    <link rel="rights" href="https://movida.bebanjo.net/deals/2/rights"/>
    <link rel="metadata" href="https://movida.bebanjo.net/deals/2/metadata"/>
    <link rel="granted_requirements" href="https://movida.bebanjo.net/deals/2/granted_requirements"/>
    <link rel="specific_platforms" href="https://movida.bebanjo.net/deals/2/specific_platforms"/>
  </deal>
</deals>

Get a single deal

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

$ curl --digest -u robot_user https://movida.bebanjo.net/api/deals/2

<?xml version='1.0' encoding='utf-8' ?>
<deal>
  <id type="integer">2</id>
  <name>Marvel Deal 2013</name>
  <external-id>Marvel2013</external-id>
  <right-type>archive</right-type>
  <starts type="date">2014-06-10</starts>
  <ends type="date">2015-07-01</ends>
  <rights-updated-at type='datetime'>2014-06-01T04:47:09Z</rights-updated-at>
  <minimum-exploitation nil="true"/>
  <maximum-exploitation nil="true"/>
  <parity nil="true"/>
  <link rel="self" href="https://movida.bebanjo.net/deals/2"/>
  <link rel="rights" href="https://movida.bebanjo.net/deals/2/rights"/>
  <link rel="metadata" href="https://movida.bebanjo.net/deals/2/metadata"/>
  <link rel="granted_requirements" href="https://movida.bebanjo.net/deals/2/granted_requirements"/>
  <link rel="specific_platforms" href="https://movida.bebanjo.net/deals/2/specific_platforms"/>
</deal>

Create a new deal

To create a deal, you just need to POST the proper XML representation of a deal (similar to the ones you get when fetching) to the URL that you can find in the link rel="deals" of the root of the API.

For example, this POST would create a deal: (we’ll use $ curl’s @ option, which reads the data that is to be posted to the URL from a file)

$ cat payload.xml
<?xml version='1.0' encoding='utf-8' ?>
<deal>
  <name>Marvel deal 2013</name>
  <external-id>Marvel2013</external-id>
  <right-type>archive</right-type>
  <starts type="date">2014-06-10</starts>
  <ends type="date">2015-07-01</ends>
</deal>
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X POST -d @payload.xml "https://movida.bebanjo.net/api/deals"

Movida will return the full XML of the deal just created:

<?xml version='1.0' encoding='utf-8' ?>
<deal>
  <id type="integer">2</id>
  <name>Marvel deal 2013</name>
  <external-id>Marvel2013</external-id>
  <right-type>archive</right-type>
  <starts type="date">2014-06-10</starts>
  <ends type="date">2015-07-01</ends>
  <rights-updated-at type='datetime'>2014-06-01T04:47:09Z</rights-updated-at>
  <minimum-exploitation nil="true"/>
  <maximum-exploitation nil="true"/>
  <parity nil="true"/>
  <link rel="self" href="https://movida.bebanjo.net/deals/2"/>
  <link rel="rights" href="https://movida.bebanjo.net/deals/2/rights"/>
  <link rel="metadata" href="https://movida.bebanjo.net/deals/2/metadata"/>
  <link rel="granted_requirements" href="https://movida.bebanjo.net/deals/2/granted_requirements"/>
  <link rel="specific_platforms" href="https://movida.bebanjo.net/deals/2/specific_platforms"/>
</deal>

Updating a deal

You can update an existing deal sending a PUT request to the URL of the deal (that you can get from its link rel="self"). You only need to include those attributes of the deal that you wish to update:

$ cat payload.xml
<?xml version='1.0' encoding='utf-8' ?>
<deal>
  <name>Marvel deal 2014</name>
</deal>
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X PUT -d @payload.xml "https://movida.bebanjo.net/api/deals/2"

Movida will return the full XML of the deal just updated:

<?xml version='1.0' encoding='utf-8' ?>
<deal>
  <id type="integer">2</id>
  <name>Marvel deal 2014</name>
  <external-id>Marvel2013</external-id>
  <right-type>archive</right-type>
  <starts type="date">2014-06-10</starts>
  <ends type="date">2015-07-01</ends>
  <rights-updated-at type='datetime'>2014-06-01T04:47:09Z</rights-updated-at>
  <minimum-exploitation nil="true"/>
  <maximum-exploitation nil="true"/>
  <parity nil="true"/>
  <link rel="self" href="https://movida.bebanjo.net/deals/2"/>
  <link rel="rights" href="https://movida.bebanjo.net/deals/2/rights"/>
  <link rel="metadata" href="https://movida.bebanjo.net/deals/2/metadata"/>
  <link rel="granted_requirements" href="https://movida.bebanjo.net/deals/2/granted_requirements"/>
  <link rel="specific_platforms" href="https://movida.bebanjo.net/deals/2/specific_platforms"/>
</deal>

Deleting a deal

Note: Deleting a deal won’t delete its series in cascade. Those series will keep existing but they won’t belong to any deal.

You can also delete a deal using a DELETE request to the deal URL:

$ curl --digest -u robot_user:password -X DELETE "https://movida.bebanjo.net/api/deals/2"

Last updated March 31st, 2017.