Skip to content

Developers

How can we help you?

← Go back

Mapping

The mapping is used to name the values given on an enumeration entry

A mapping looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<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>
{
  "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"
}

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

Valid attributes

  • name (required): string used internally to identify that entry.
  • enumeration (optional): The enumeration it belongs to.

Get a list of all mappings for an enumeration

Mappigns are accessed via the Enumeration they belong to, as in the example below, through the link identified by the mappings link:

<?xml version='1.0' encoding='utf-8' ?>
<enumerations type="array">
  <enumeration>
    <id type="integer">879</id>
    <name>BeBanjo: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>
{
  "resource_type": "enumeration",
  "id": 879,
  "name": "BeBanjo: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 https://movida.bebanjo.net/api/enumerations/879/mappings
$ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/enumerations/879/mappings
<?xml version="1.0" encoding="UTF-8"?>
<mappings type="array">
  <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>
  <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>
</mappings>
{
  "entries": [
    {
      "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",
      "id": 8,
      "name": "Channel Brand",
      "self_link": "https://movida.bebanjo.net/api/mappings/8",
      "enumeration_link": "https://movida.bebanjo.net/api/enumerations/879"
    }
  ]
}