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

Licensor

A licensor of a given title 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 Movida, the name is the only attribute stored at the moment. This is how it looks like:

<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>

Get a list of all licensors

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

$ curl --digest -u robot:password "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="http://movida.bebanjo.net/api/licensors/3"/>
    <link rel="titles" href="http://movida.bebanjo.net/api/licensors/3/titles"/>
  </licensor>
  <licensor>
    <id type="integer">5</id>
    <name>Disney</name>
    <link rel="self" href="http://movida.bebanjo.net/api/licensors/5"/>
    <link rel="titles" href="http://movida.bebanjo.net/api/licensors/5/titles"/>
  </licensor>
  <licensor>
    <id type="integer">4</id>
    <name>Warner Brothers</name>
    <link rel="self" href="http://movida.bebanjo.net/api/licensors/4"/>
    <link rel="titles" href="http://movida.bebanjo.net/api/licensors/4/titles"/>
  </licensor>
</licensors>

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"

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="http://movida.bebanjo.net/api/licensors/5"/>
    <link rel="titles" href="http://movida.bebanjo.net/api/licensors/5/titles"/>
  </licensor>
</licensors>

Creating a new licensor

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

$ cat licensor.xml 
<licensor>
  <name>Paramount</name>
</licensor>

Now we post it to the api/licensors:

$ curl --digest -u robot:secret -H "Content-Type: application/xml" -X POST -d @licensor.xml "http://movida.bebanjo.net/api/licensors"

Which will return the XML 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="http://movida.bebanjo.net/api/licensors/6"/>
  <link rel="titles" href="http://movida.bebanjo.net/api/licensors/6/titles"/>
</licensor>

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.

Last updated May 05th, 2017.