Update a category on a node

PUT {{baseUrl}}/v1/nodes/:id/categories/:category_id/

Updates an existing category on a node. Only one category (and its values) may be updated at a time.

The optional 'metadatatoken' parameter may be specified if there is a need to avoid edit conflicts. There are two ways to retrieve the current metadatatoken(s):

  1. Pass in the current metadatatoken when updating the category (see the example below). If the update is successful, metadatatoken(s) will be generated and returned under state.categories and these will be valid for the next category update call.
  2. If you want the current metadatatokens before performing a category update, use the call 'GET /v2/nodes/{id}?state'. The current metadatatoken(s) will be displayed under results.state.categories

The following examples will assume that there is a category (ID 9830) that has the following attributes:
  • TextField (Attribute ID 2)
  • Set (Attribute ID 3) with two rows. The Set has a multi-value Textfield (Set Attribute ID 4) that can have a maximum of 3 values

Change the value of the Textfield:
{9830_2:new value}

Change the value of the Textfield while using the metadatatoken to avoid edit conflicts:
{"9830
1:{metadatatoken:9ec9bcab09f9963db044ff6749e5c5c2},98302:new value}

Change the value of the Set's Textfield in the second row, for the Set Textfield's third value:
{9830324:[,,new value]}

Remove the Set's second row:
{9830
3_2:"}

Request Body

[{"name"=>"{category_id}_1", "value"=>"ullamco laboris est occaecat", "datatype"=>"string"}, {"name"=>"metadata_token", "value"=>"laboris ipsum culpa Duis", "datatype"=>"string"}]

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring