As documentation evolves, it may be necessary to modify the metadata associated with it. This web service adds to, updates, or replaces metadata for the publication defined in the endpoint, using the values specified in the request body.
- Users or API keys with the
CONTENT_PUBLISHERrole can only update the metadata of a publication published through a source they have permissions for. - Reuploading a publication with its original metadata overrides changes made using this web service. Whenever possible, update the source content instead of using this web service.
- It is not necessary to reprocess content for the metadata update to take effect.
- It is necessary to provide an
Ft-Calling-Appvalue when using Fluid Topics web services. See Fluid Topics calling app. - It is possible to update or replace all custom metadata with this web service.
- It is possible to update or replace the following built-in metadata with this web service:
ft:title,ft:locale,ft:openMode,ft:originUrl,ft:clusterId,ft:lastEdition,ft:editorialType, andft:description.
| Method | Endpoint |
|---|---|
PUT |
|
| Query string parameter | Type | Required? | Description |
|---|---|---|---|
metadata=value |
String | Yes | Any metadata key-value set that is unique to the publication to update. The document's originId is often a good candidate for use in the endpoint as it is the publication's unique identifier.The metadata targeted in the endpoint is only used to identify the publication to be updated and is not itself updated. |
Targeting publications by using the same metadata key with two different values (category=training&category=guides) relies on the configuration of the Metadata menu. If the Filter selection mode value of the category metadata key is:
- Match any filter: all publications with either
category=training, orcategory=guides, receive the metadata update. - Match all filters: only publications with both
category=trainingandcategory=guidesreceive the metadata update.
Request example
The following example shows a JSON request body for this web service:
{
"mode": "update",
"metadata": [
{
"key": "product",
"value": "Fluid Topics"
},
{
"key": "audience",
"values": [
"public",
"internal"
]
},
{
"key": "versions",
"hierarchicalValues": [
[
"3.x.x",
"3.6.x",
"3.6.2"
],
[
"3.x.x",
"3.6.x",
"3.6.3"
]
]
}
],
"inheritance": false
}
The request body expects the following fields:
| Field | Type | Required? | Description |
|---|---|---|---|
mode |
String | No | The default value of mode is update. If the value of mode is update:
mode is replace:
By default, a document's topics inherit the updated metadata. It is possible to override this behavior by setting the value of the inheritance parameter to false in the JSON request body. |
metadata |
Array | Yes | Expects the list of the new metadata key-value sets. |
key |
String | Yes | The metadata key associated with the values to be updated. |
value |
String | Yes | Defines a single value for the selected key. To update a metadata key with multiple values, the request field must be values instead of value. |
values |
String | Yes | Defines values for the selected key. |
hierarchicalValues |
Array | Yes | Defines hierarchical values for the selected key. It can have an unlimited number of arrays, each representing a hierarchical metadata key. Inside an array, the first string is the value highest in the hierarchy. Each following value is one level down. |
inheritance |
Boolean | No | true by default. If true, the document's topics inherit the updated metadata. If false, the document's topics do not inherit the new metadata.If mode is set to replace and inheritance is set to true, metadata are replaced at the document level but updated at the topic level. |
| Return code | Description |
|---|---|
202 ACCEPTED |
The update instruction was sent to the Fluid Topics processing pipeline. |
400 BAD REQUEST |
Invalid query. |