Link relation taxonomies:create-or-update-entry-bulk

Overview

A bulk call to create or update a set of entries of the taxonomy.

HTTP method

PUT

URL template parameters

-

Query parameters

-

Request body

A JSON array. Each item of the array is a taxonomies:entry resource with the information you want to set. For each item:

  • If the ID of the entry is null or empty, a new top-level entry is created.

  • If the ID is given and the entry exists, the entry is updated. The updated entry may receive a new ID and have a new self link. A client must evaluate the response body to learn of the ID of the entry after the update.

  • If the ID is given, but the entry doesn’t exist, a new top-level entry is created. The created entry may have the given ID. However, the client must not rely on that, because the system may decide to assign a different ID and generate a different self link. The response will contain the new ID.

Example request body for two entries of an MediaCentral Asset Management legal list:

[
  {
    "id": null,
    "labels": {
      "en": "New entry"
    },
    "attributes": [
      {
        "name": "index",
        "value": 3
      }
    ]
  },
  {
    "id": "4",
    "attributes": [
      {
        "name": "index",
        "value": 2
      }
    ]
  }
]

This request will do the following operations

  • Create a new entry with English label "New entry" and index 3.

  • If an entry with ID "4" exists, it will set the index for the entry to 2, leaving all other properties as they are. If an entry with ID "4" doesn’t exist, it will create an entry, probably with ID "4", but the client must not rely on that.

HTTP response

200 OK

Response body

An array with one result entry for each given entry. For each successfully handled entry, the result entry contains:

  • success: true

  • data: a taxonomies:entry resource for the entry.

  • httpStatus (optional): the same HTTP status code that the non-bulk call would return. Here:

    • 201 (Created): the entry was created.

    • 200 (OK) or null or not present: the value was updated.

For each requested entry that caused an error:

  • success: false

  • httpStatus: same response code as for the taxonomies:entry-by-entryid link rel. Typical example: 404 (Not Found).

  • errorCode (string, optional): machine-readable error code that the non-bulk call would return for this item

  • errorMessage (optional, string): human-readable error message that the non-bulk call would return for this item

Example response if the first entry was created, the second updated (abbreviated):

[
  {
    "success": true,
    "data": {
      "id": "16",
      "labels": {
        "en": "New entry"
      },
      "attributes": [
        {
          "name": "index",
          "value": 3
        }
      ],
      "_links": { ... },
    },
    "httpStatus": 201
  },
  {
    "success": true,
    "data": {
      "id": "4",
      "labels": {
        "en": "Some existing entry"
      },
      "attributes": [
        {
          "name": "index",
          "value": 2
        }
      ],
      "_links": { ... }
    }
  }
]

Available in

Description

A bulk call to create or update a set of entries of the taxonomy.