Skip to content

Developers

How can we help you?

← Go back

External id

⚠️ This feature is coming soon! Reach out to your CSM if you would like more information

Note: external_id_type link in this resource can be expanded using the expand option.

An external id is a resource that represents an identifier assigned to an entity (such as a Brand, Series, Title, etc.) in Mediagenix On-Demand, according to a specific external id type. External ids allow you to associate your own or third-party identifiers with entities in the system.

This is how an external id might look through the API:

  <?xml version="1.0" encoding="UTF-8"?>
  <external_id>
    <id type="integer">3</id>
    <value>EID-123</value>
    <link rel="self" href="https://movida.bebanjo.net/api/external_ids/3"/>
    <link rel="external_id_type" href="https://movida.bebanjo.net/api/external_id_types/185"/>
    <link rel="external_identifiable" href="https://movida.bebanjo.net/api/title_groups/14754"/>
  </external_id>
  {
    "resource_type": "external_id",
    "id": 3,
    "value": "EID-123",
    "self_link": "https://movida.bebanjo.net/api/external_ids/3",
    "external_id_type_link": "https://movida.bebanjo.net/api/external_id_types/185",
    "external_identifiable_link": "https://movida.bebanjo.net/api/title_groups/14754"
  }

External id attributes

  • id (read_only): Mediagenix On-Demand’s internal unique identifier for the external id. This value is assigned by Mediagenix On-Demand and cannot be changed.
  • value: The actual external identifier string.

Get a list of all external ids for an entity

You can list all external ids associated with a specific entity (such as a Brand, Series, Title, etc.) by following the external_ids link from that entity resource.

For example, to list all external ids for a Brand:

  $ curl --digest -u robot_user:password -H "Accept: application/xml" https://movida.bebanjo.net/api/brands/14754/external_ids
  $ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/brands/14754/external_ids

This would return a list of all external ids for the specified entity:

  <?xml version="1.0" encoding="UTF-8"?>
  <external_ids type="array">
    <external_id>
      <id type="integer">3</id>
      <value>EID-124</value>
      <link rel="self" href="https://movida.bebanjo.net/api/external_ids/3"/>
      <link rel="external_id_type" href="https://movida.bebanjo.net/api/external_id_types/185"/>
      <link rel="external_identifiable" href="https://movida.bebanjo.net/api/brands/14754"/>
    </external_id>
    <!-- ... -->
  </external_ids>
  {
    "entries": [
      {
        "resource_type": "external_id",
        "id": 3,
        "value": "EID-124",
        "self_link": "https://movida.bebanjo.net/api/external_ids/3",
        "external_id_type_link": "https://movida.bebanjo.net/api/external_id_types/185",
        "external_identifiable_link": "https://movida.bebanjo.net/api/brands/14754"
      }
      // ...
    ]
  }

Get a single external id

You can retrieve a single external id by doing a GET to its URI (found in the self_link or link rel="self" attribute of an external id).

  $ curl --digest -u your_api_user:your_password -H "Accept: application/xml" https://movida.bebanjo.net/api/external_ids/3
  $ curl --digest -u your_api_user:your_password -H "Accept: application/json" https://movida.bebanjo.net/api/external_ids/3

This will return the full representation of the specific external id:

  <?xml version="1.0" encoding="UTF-8"?>
  <external_id>
    <id type="integer">3</id>
    <value>EID-123</value>
    <link rel="self" href="https://movida.bebanjo.net/api/external_ids/3"/>
    <link rel="external_id_type" href="https://movida.bebanjo.net/api/external_id_types/185"/>
    <link rel="external_identifiable" href="https://movida.bebanjo.net/api/title_groups/14754"/>
  </external_id>
  {
    "resource_type": "external_id",
    "id": 3,
    "value": "EID-123",
    "self_link": "https://movida.bebanjo.net/api/external_ids/3",
    "external_id_type_link": "https://movida.bebanjo.net/api/external_id_types/185",
    "external_identifiable_link": "https://movida.bebanjo.net/api/title_groups/14754"
  }

Create a new external id

To create an external id, send a POST request with the XML or JSON representation of the external id to the external_ids collection of the specific entity you want to associate it with (for example, a Brand, Series, Title, etc.).

For example, to create an external id for a Brand

  curl --digest -u robot_user:password -H "Content-Type: application/xml" -X POST -d @payload.xml "https://movida.bebanjo.net/api/brands/14754/external_ids"
  curl --digest -u robot_user:password -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d @payload.json "https://movida.bebanjo.net/api/brands/14754/external_ids"

Using the following payload in your request:

  <?xml version="1.0" encoding="UTF-8"?>
  <external_id>
    <value>EID-12B</value>
    <link rel="external_id_type" href="https://movida.bebanjo.net/api/external_id_types/185"/>
  </external_id>
  {
    "value": "EID-12B",
    "external_id_type_link": "https://movida.bebanjo.net/api/external_id_types/185"
  }

Note: The external id type URL must be of one external id type that already exists in the system.

Update an external id

To update the value of an existing external id, send a PUT request to the external id’s URI with the updated payload in either XML or JSON format.

For example, to update the value of external id with id 3:

  curl --digest -u robot_user:password -H "Content-Type: application/xml" -H "Accept: application/xml" -X PUT -d @payload.xml "https://movida.bebanjo.net/api/external_ids/3"
  curl --digest -u robot_user:password -H "Content-Type: application/json" -H "Accept: application/json" -X PUT -d @payload.json "https://movida.bebanjo.net/api/external_ids/3"

Using one of the following payload:

  <?xml version="1.0" encoding="UTF-8"?>
  <external_id>
    <value>EID-124</value>
  </external_id>
  {
    "value": "EID-124"
  }

This will return the updated external id:

  <?xml version="1.0" encoding="UTF-8"?>
  <external_id>
    <id type="integer">3</id>
    <value>EID-124</value>
    <link rel="self" href="https://movida.bebanjo.net/api/external_ids/3"/>
    <link rel="external_id_type" href="https://movida.bebanjo.net/api/external_id_types/185"/>
    <link rel="external_identifiable" href="https://movida.bebanjo.net/api/brands/14754"/>
  </external_id>
  {
    "resource_type": "external_id",
    "id": 3,
    "value": "EID-124",
    "self_link": "https://movida.bebanjo.net/api/external_ids/3",
    "external_id_type_link": "https://movida.bebanjo.net/api/external_id_types/185",
    "external_identifiable_link": "https://movida.bebanjo.net/api/brands/14754"
  }

Delete an external id

To delete an external id, send a DELETE request to the external id’s URI.

For example, to delete the external id with id 2:

  $ curl --digest -u robot_user:password -X DELETE "https://movida.bebanjo.net/api/external_ids/2"
  $ curl --digest -u robot_user:password -H "Accept: application/json" -X DELETE "https://movida.bebanjo.net/api/brands/125"

If the deletion is successful, the API will return:

HTTP/1.1 204 No Content