Skip to content

Developers

How can we help you?

← Go back

Licensor

A licensor of a given brand, title, or right is normally the rights owner, the company who is licensing the rights for that particular title. Currently, the licensor is only informational and it is not required in Mediagenix On-Demand, the name is the only attribute stored at the moment. This is how it looks like:

<?xml version="1.0" encoding="UTF-8"?>
<licensor>
  <id type="integer">5</id>
  <name>Disney</name>
  <link rel="self" href="https://movida.bebanjo.net/api/licensors/5"/>
  <link rel="titles" href="https://movida.bebanjo.net/api/licensors/5/titles"/>
</licensor>
{
  "resource_type": "licensor",
  "id": 5,
  "name": "Disney",
  "self_link": "https://movida.bebanjo.net/api/licensors/5",
  "titles_link": "https://movida.bebanjo.net/api/licensors/5/titles"
}

Get a list of all licensors

As you would expect, just do GET /api/licensors:

$ curl --digest -u robot:password "https://movida.bebanjo.net/api/licensors"
$ curl --digest -u robot:password -H "Accept: application/json" "https://movida.bebanjo.net/api/licensors"

Which would return:

<?xml version="1.0" encoding="UTF-8"?>
<licensors type="array">
  <licensor>
    <id type="integer">3</id>
    <name>- No licensor -</name>
    <link rel="self" href="https://movida.bebanjo.net/api/licensors/3"/>
    <link rel="titles" href="https://movida.bebanjo.net/api/licensors/3/titles"/>
  </licensor>
  <licensor>
    <id type="integer">5</id>
    <name>Disney</name>
    <link rel="self" href="https://movida.bebanjo.net/api/licensors/5"/>
    <link rel="titles" href="https://movida.bebanjo.net/api/licensors/5/titles"/>
  </licensor>
  <licensor>
    <id type="integer">4</id>
    <name>Warner Brothers</name>
    <link rel="self" href="https://movida.bebanjo.net/api/licensors/4"/>
    <link rel="titles" href="https://movida.bebanjo.net/api/licensors/4/titles"/>
  </licensor>
</licensors>
{
  "entries": [
    {
      "resource_type": "licensor",
      "id": 3,
      "name": "- No licensor -",
      "self_link": "https://movida.bebanjo.net/api/licensors/3",
      "titles_link": "https://movida.bebanjo.net/api/licensors/3/titles"
    },
    {
      "resource_type": "licensor",
      "id": 5,
      "name": "Disney",
      "self_link": "https://movida.bebanjo.net/api/licensors/5",
      "titles_link": "https://movida.bebanjo.net/api/licensors/5/titles"
    },
    {
      "resource_type": "licensor",
      "id": 4,
      "name": "Warner Brothers",
      "self_link": "https://movida.bebanjo.net/api/licensors/4",
      "titles_link": "https://movida.bebanjo.net/api/licensors/4/titles"
    }
  ]
}

Finding a specific licensor

If you want to search for a specific licensor, you can try passing the name as a parameter; this might come in handy when you want to create titles associated to an existing licensor.

$ curl --digest -u robot:password "https://movida.bebanjo.net/api/licensors?name=Disney"
$ curl --digest -u robot:password -H "Accept: application/json" "https://movida.bebanjo.net/api/licensors?name=Disney"

Which would return:

<?xml version="1.0" encoding="UTF-8"?>
<licensors type="array">
  <licensor>
    <id type="integer">5</id>
    <name>Disney</name>
    <link rel="self" href="https://movida.bebanjo.net/api/licensors/5"/>
    <link rel="titles" href="https://movida.bebanjo.net/api/licensors/5/titles"/>
  </licensor>
</licensors>
{
  "entries": [
    {
      "resource_type": "licensor",
      "id": 5,
      "name": "Disney",
      "self_link": "https://movida.bebanjo.net/api/licensors/5",
      "titles_link": "https://movida.bebanjo.net/api/licensors/5/titles"
    }
  ]
}

Creating a new licensor

To create a new licensor, just POST the licensor XML/JSON to the api/licensors path. The XML/JSON only needs the licensor name:

$ cat licensor.xml
$ cat licensor.json
<licensor>
  <name>Paramount</name>
</licensor>
{
  "name": "Paramount"
}

Now we post it to the api/licensors:

$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X POST -d @licensor.xml "https://movida.bebanjo.net/api/licensors"
$ curl --digest -u robot_user:password -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d @licensor.json "https://movida.bebanjo.net/api/licensors"

Which will return the XML/JSON of the newly created licensor:

<?xml version="1.0" encoding="UTF-8"?>
<licensor>
  <id type="integer">6</id>
  <name>Paramount</name>
  <link rel="self" href="https://movida.bebanjo.net/api/licensors/6"/>
  <link rel="titles" href="https://movida.bebanjo.net/api/licensors/6/titles"/>
</licensor>
{
  "resource_type": "licensor",
  "id": 6,
  "name": "Paramount",
  "self_link": "https://movida.bebanjo.net/api/licensors/6",
  "titles_link": "https://movida.bebanjo.net/api/licensors/6/titles"
}

The titles resource

Notice that each licensor has a titles link, following that link will retrieve all of the titles for that licensor. Please note that the titles resource for a licensor is paginated.