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

Enumeration

Note: This resource links can be expanded using the expand option.

The enumeration resource describes reusable configuration of an account.

A enumeration looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<enumeration>
  <id type="integer">135</id>
  <name>Audio Mix Type</name>
  <link rel="self" href="http://www.example.com/api/enumerations/135"/>
  <link rel="entries" href="http://www.example.com/api/enumerations/135/entries"/>
</enumeration>

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

Valid attributes

  • name (required): Name of the enumeration.
  • entries (optional): Each of the entries that describes the enumeration.

Get a list of all enumerations in the current account

In the root resource, just do a GET to the URL in the enumerations link:

<?xml version='1.0' encoding='utf-8' ?>
<movida>
  ...
  <link rel="enumerations" href="https://movida.bebanjo.net/api/enumerations"/>
  ...
</movida>
$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/enumerations

And:

<?xml version="1.0" encoding="UTF-8"?>
<enumerations type="array">
  <enumeration>
    <id type="integer">135</id>
    <name>Audio Mix Type</name>
    <link rel="self" href="http://www.example.com/api/enumerations/135"/>
    <link rel="entries" href="http://www.example.com/api/enumerations/135/entries"/>
  </enumeration>
</enumerations>

Note: This is a paginated resource. By default, only 50 enumerations 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 enumerations returned using the following attributes:

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

Get a specific enumeration

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

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/enumerations/135

And:

<?xml version='1.0' encoding='utf-8' ?>
<enumeration>
  <id type="integer">135</id>
  <name>Audio Mix Type</name>
  <link rel="self" href="http://www.example.com/api/enumerations/135"/>
</enumeration>

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

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/enumerations/135?expand=entries

This would expand the rel="entries" link inside the enumeration, yielding something like:

<?xml version='1.0' encoding='utf-8' ?>
<enumeration>
  <id type="integer">135</id>
  <name>Audio Mix Type</name>
  <link rel="self" href="http://www.example.com/api/enumerations/135"/>
  <link rel="entries" href="http://www.example.com/api/enumerations/135/entries">
    <entries type="array">
      <entry>
        <id type="integer">314</id>
        <value>Mono</value>
        <description>mono</description>
      </entry>
      <entry>
        <id type="integer">315</id>
        <value>Stereo</value>
        <description>stereo</description>
      </entry>
    </entries>
  </link>
</enumeration>

Last updated November 19th, 2019.