Skip to content

Developers

How can we help you?

← Go back

Enumeration entry

The Enumeration entry is used to populate the list of elements of an enumeration

A enumeration entry looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<entry>
  <id type="integer">66475</id>
  <value>France &gt; Bouygues &gt; Boing &gt; Catch Up</value>
  <description>France &gt; Bouygues &gt; Boing &gt; Catch Up</description>
  <link rel="self" href="https://movida.bebanjo.net/api/entries/66475"/>
  <link rel="enumeration" href="https://movida.bebanjo.net/api/enumerations/879"/>
  <link rel="mapping_entries" href="https://movida.bebanjo.net/api/entries/66475/mapping_entries"/>
</entry>
{
  "resource_type": "entry",
  "id": 66475,
  "value": "France > Bouygues > Boing > Catch Up",
  "description": "France > Bouygues > Boing > Catch Up",
  "self_link": "https://movida.bebanjo.net/api/entries/66475",
  "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879",
  "mapping_entries_link": "https://movida.bebanjo.net/api/entries/66475/mapping_entries"
}

Note: currently enumeration entries cannot be updated/destroyed through the API. Please, contact your Technical Account Manager in order to define the list of enumeration and enumeration entries suitable for your company.

Valid attributes

  • value (required): string used internally to identify that entry.
  • description (required): string used on the Mediagenix On-Demand UI to represent the entry.
  • enumeration (optional): The enumeration it belongs to.
  • mapping_entries (optional): Each of the mapping entries associated to that enumeration entry.

Get a list of all entries for an enumeration

Entries are accessed via the Enumeration they belong to, as in the example below, through the link identified by the rel="entries" attribute:

<?xml version='1.0' encoding='utf-8' ?>
<enumerations type="array">
  <total-entries>66</total-entries>
  <link rel="next" href="https://movida.bebanjo.net/api/enumerations?page=2"/>
  <enumeration>
    <id type="integer">879</id>
    <name>Mediagenix On-Demand:Platform Configuration</name>
    <link rel="self" href="https://movida.bebanjo.net/api/enumerations/879"/>
    <link rel="entries" href="https://movida.bebanjo.net/api/enumerations/879/entries"/>
    <link rel="mappings" href="https://movida.bebanjo.net/api/enumerations/879/mappings"/>
  </enumeration>
</enumerations>
{
  "total_entries": 66,
  "next_link": "https://movida.bebanjo.net/api/enumerations?page=2",
  "entries": [
    {
      "resource_type": "enumeration",
      "id": 879,
      "name": "Mediagenix On-Demand:Platform Configuration",
      "self_link": "https://movida.bebanjo.net/api/enumerations/879",
      "entries_link": "https://movida.bebanjo.net/api/enumerations/879/entries",
      "mappings_link": "https://movida.bebanjo.net/api/enumerations/879/mappings"
    },
    // ...
  ]
}

If we follow that link, we can fetch the list of all entries for that enumeration.

$ curl --digest -u robot_user:password http://www.example.com/api/enumerations/879/entries
$ curl --digest -u robot_user:password -H "Accept: application/json" http://www.example.com/api/enumerations/879/entries
<?xml version="1.0" encoding="UTF-8"?>
<entries type="array">
  <entry>
    <id type="integer">66475</id>
    <value>France &gt; Bouygues &gt; Boing &gt; Catch Up</value>
    <description>France &gt; Bouygues &gt; Boing &gt; Catch Up</description>
    <link rel="self" href="https://movida.bebanjo.net/api/entries/66475"/>
    <link rel="enumeration" href="https://movida.bebanjo.net/api/enumerations/879"/>
    <link rel="mapping_entries" href="https://movida.bebanjo.net/api/entries/66475/mapping_entries"/>
  </entry>
  <entry>
    <id type="integer">81068</id>
    <value>Finland &gt; AVS &gt; Toonix &gt; SVOD</value>
    <description>Finland &gt; AVS &gt; Toonix &gt; SVOD</description>
    <link rel="self" href="https://movida.bebanjo.net/api/entries/81068"/>
    <link rel="enumeration" href="https://movida.bebanjo.net/api/enumerations/879"/>
    <link rel="mapping_entries" href="https://movida.bebanjo.net/api/entries/81068/mapping_entries"/>
  </entry>
</entries>
{
  "entries": [
    {
      "resource_type": "entry",
      "id": 66475,
      "value": "France > Bouygues > Boing > Catch Up",
      "description": "France > Bouygues > Boing > Catch Up",
      "self_link": "https://movida.bebanjo.net/api/entries/66475",
      "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879",
      "mapping_entries_link": "https://movida.bebanjo.net/api/entries/66475/mapping_entries"
    },
    {
      "resource_type": "entry",
      "id": 81068,
      "value": "Finland > AVS > Toonix > SVOD",
      "description": "Finland > AVS > Toonix > SVOD",
      "self_link": "https://movida.bebanjo.net/api/entries/81068",
      "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879",
      "mapping_entries_link": "https://movida.bebanjo.net/api/entries/81068/mapping_entries"
    }
  ]
}

Get a specific enumeration entry

Just do a GET to the URL in the enumeration_entry self link

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/entries/66475
$ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/entries/66475

And:

<?xml version='1.0' encoding='utf-8' ?>
<entry>
  <id type="integer">66475</id>
  <value>France &gt; Bouygues &gt; Boing &gt; Catch Up</value>
  <description>France &gt; Bouygues &gt; Boing &gt; Catch Up</description>
  <link rel="self" href="https://movida.bebanjo.net/api/entries/66475"/>
  <link rel="enumeration" href="https://movida.bebanjo.net/api/enumerations/879"/>
  <link rel="mapping_entries" href="https://movida.bebanjo.net/api/entries/66475/mapping_entries"/>
</entry>
{
  "resource_type": "entry",
  "id": 66475,
  "value": "France > Bouygues > Boing > Catch Up",
  "description": "France > Bouygues > Boing > Catch Up",
  "self_link": "https://movida.bebanjo.net/api/entries/66475",
  "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879",
  "mapping_entries_link": "https://movida.bebanjo.net/api/entries/66475/mapping_entries"
}

Remember you can use the expand me some nodes trick if you want to, for instance, find out what are the mappings entries and enumeration of a particular enumeration entry.

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/entries/66475?expand=enumeration,mapping_entries,mapping
$ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/entries/66475?expand=enumeration,mapping_entries,mapping

This would expand the rel="enumeration", the rel="mappings_entries" links inside the enumeration entry, and the rel="mapping" link inside each mapping entry yielding something like:

<?xml version='1.0' encoding='utf-8' ?>
<entry>
  <id type="integer">66475</id>
  <value>France &gt; Bouygues &gt; Boing &gt; Catch Up</value>
  <description>France &gt; Bouygues &gt; Boing &gt; Catch Up</description>
  <link rel="self" href="https://movida.bebanjo.net/api/entries/66475"/>
  <link rel="enumeration" href="https://movida.bebanjo.net/api/enumerations/879">
    <enumeration>
      <id type="integer">879</id>
      <name>Mediagenix On-Demand:Platform Configuration</name>
      <link rel="self" href="https://movida.bebanjo.net/api/enumerations/879"/>
      <link rel="entries" href="https://movida.bebanjo.net/api/enumerations/879/entries"/>
      <link rel="mappings" href="https://movida.bebanjo.net/api/enumerations/879/mappings"/>
    </enumeration>
  </link>
  <link rel="mapping_entries" href="https://movida.bebanjo.net/api/entries/66475/mapping_entries">
    <mapping-entries type="array">
      <mapping-entry>
        <id type="integer">34</id>
        <value>Bouygues</value>
        <link rel="entry" href="https://movida.bebanjo.net/api/entries/66475"/>
        <link rel="mapping" href="https://movida.bebanjo.net/api/mappings/7">
          <mapping>
            <id type="integer">7</id>
            <name>Distribution Channel</name>
            <link rel="self" href="https://movida.bebanjo.net/api/mappings/7"/>
            <link rel="enumeration" href="https://movida.bebanjo.net/api/enumerations/879"/>
          </mapping>
        </link>
      </mapping-entry>
      <mapping-entry>
        <id type="integer">35</id>
        <value>Boing</value>
        <link rel="entry" href="https://movida.bebanjo.net/api/entries/66475"/>
        <link rel="mapping" href="https://movida.bebanjo.net/api/mappings/8">
          <mapping>
            <id type="integer">8</id>
            <name>Channel Brand</name>
            <link rel="self" href="https://movida.bebanjo.net/api/mappings/8"/>
            <link rel="enumeration" href="https://movida.bebanjo.net/api/enumerations/879"/>
          </mapping>
        </link>
      </mapping-entry>
      <mapping-entry>
        <id type="integer">36</id>
        <value>Catch Up</value>
        <link rel="entry" href="https://movida.bebanjo.net/api/entries/66475"/>
        <link rel="mapping" href="https://movida.bebanjo.net/api/mappings/9">
          <mapping>
            <id type="integer">9</id>
            <name>Business Model</name>
            <link rel="self" href="https://movida.bebanjo.net/api/mappings/9"/>
            <link rel="enumeration" href="https://movida.bebanjo.net/api/enumerations/879"/>
          </mapping>
        </link>
      </mapping-entry>
      <mapping-entry>
        <id type="integer">1717</id>
        <value nil="true"/>
        <link rel="entry" href="https://movida.bebanjo.net/api/entries/66475"/>
        <link rel="mapping" href="https://movida.bebanjo.net/api/mappings/24">
          <mapping>
            <id type="integer">24</id>
            <name>Image Validation Rule Set</name>
            <link rel="self" href="https://movida.bebanjo.net/api/mappings/24"/>
            <link rel="enumeration" href="https://movida.bebanjo.net/api/enumerations/879"/>
          </mapping>
        </link>
      </mapping-entry>
    </mapping-entries>
  </link>
</entry>
{
  "resource_type": "entry",
  "id": 66475,
  "value": "France > Bouygues > Boing > Catch Up",
  "description": "France > Bouygues > Boing > Catch Up",
  "self_link": "https://movida.bebanjo.net/api/entries/66475",
  "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879",
  "enumeration": {
    "resource_type": "enumeration",
    "id": 879,
    "name": "Mediagenix On-Demand:Platform Configuration",
    "self_link": "https://movida.bebanjo.net/api/enumerations/879",
    "entries_link": "https://movida.bebanjo.net/api/enumerations/879/entries",
    "mappings_link": "https://movida.bebanjo.net/api/enumerations/879/mappings"
  },
  "mapping_entries_link": "https://movida.bebanjo.net/api/entries/66475/mapping_entries",
  "mapping_entries": {
    "entries": [
      {
        "resource_type": "mapping_entry",
        "id": 34,
        "value": "Bouygues",
        "entry_link": "https://movida.bebanjo.net/api/entries/66475",
        "mapping_link": "https://movida.bebanjo.net/api/mappings/7",
        "mapping": {
          "resource_type": "mapping",
          "id": 7,
          "name": "Distribution Channel",
          "self_link": "https://movida.bebanjo.net/api/mappings/7",
          "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879"
        }
      },
      {
        "resource_type": "mapping_entry",
        "id": 35,
        "value": "Boing",
        "entry_link": "https://movida.bebanjo.net/api/entries/66475",
        "mapping_link": "https://movida.bebanjo.net/api/mappings/8",
        "mapping": {
          "resource_type": "mapping",
          "id": 8,
          "name": "Channel Brand",
          "self_link": "https://movida.bebanjo.net/api/mappings/8",
          "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879"
        }
      },
      {
        "resource_type": "mapping_entry",
        "id": 36,
        "value": "Catch Up",
        "entry_link": "https://movida.bebanjo.net/api/entries/66475",
        "mapping_link": "https://movida.bebanjo.net/api/mappings/9",
        "mapping": {
          "resource_type": "mapping",
          "id": 9,
          "name": "Business Model",
          "self_link": "https://movida.bebanjo.net/api/mappings/9",
          "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879"
        }
      },
      {
        "resource_type": "mapping_entry",
        "id": 1717,
        "value": null,
        "entry_link": "https://movida.bebanjo.net/api/entries/66475",
        "mapping_link": "https://movida.bebanjo.net/api/mappings/24",
        "mapping": {
          "resource_type": "mapping",
          "id": 24,
          "name": "Image Validation Rule Set",
          "self_link": "https://movida.bebanjo.net/api/mappings/24",
          "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879"
        }
      }
    ]
  }
}

Creating a new enumeration entry for an existing enumeration

To create enumeration entries, you just need to POST proper XML/JSON enumeration entry representation to the entries URL of an enumeration.

For example, this POST would create an enumeration entry (we will use curl’s @ option, which reads data to be posted from a file):

$ cat entry.xml
$ cat entry.json
<entry>
  <value>Spain &gt; Toonami &gt; SVOD</value>
  <description>Spain &gt; Toonami &gt; SVOD</description>
</entry>
{
    "resource_type": "entry",
    "value": "Spain &gt; Toonami &gt; SVOD",
    "description": "Spain &gt; Toonami &gt; SVOD"
}
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -H "Accept: application/xml" -X POST -d @entry.xml "https://movida.bebanjo.net/api/enumerations/879/entries"
$ curl --digest -u robot_user:password -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d @entry.json "https://movida.bebanjo.net/api/enumerations/879/entries"

Mediagenix On-Demand will return the full XML/JSON of the enumeration entry just created:

<?xml version="1.0" encoding="UTF-8"?>
<entry>
  <id type="integer">66476</id>
  <value>Spain &gt; Toonami &gt; SVOD</value>
  <description>Spain &gt; Toonami &gt; SVOD</description>
  <link rel="self" href="https://movida.bebanjo.net/api/entries/66476"/>
  <link rel="enumeration" href="https://movida.bebanjo.net/api/enumerations/879"/>
  <link rel="mapping_entries" href="https://movida.bebanjo.net/api/entries/66476/mapping_entries"/>
</entry>
{
  "resource_type": "entry",
  "id": 66576,
  "value": "Spain &gt; Toonami &gt; SVOD",
  "description": "Spain &gt; Toonami &gt; SVOD",
  "self_link": "https://movida.bebanjo.net/api/entries/66476",
  "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879",
  "mapping_entries_link": "https://movida.bebanjo.net/api/entries/66476/mapping_entries"
}