How to pass Category Attribute value from REST API

1.4k Views Asked by At

I am able to upload files or create node through the Content server(16.0.3) REST Api (POST: api/v1/nodes). But How do I pass Category Attribute value while uploading file to opentext Content server..

Because as per DeveloperGuide there are only 3 parameters that I can pass

type,parent_id,name
2

There are 2 best solutions below

0
user202 On BEST ANSWER

To add a category to node, need to pass roles with Category, Category Attribute values in Json formate.For example node (20589) has category with name BillingCat(42069) contains ReferenceID (42069_2) then pass parameters as below

  type: 144,
    parent_id: 20589,
    name: file.name,
    roles: {
      categories: {
        {
          '42069': { // category (42069)
            '42069_2': 'ABC23' //attribute value
          }
        }
      }
3
Irukandji On

Looks like you have to make a second post after node has been created: POST api/v1/nodes/{id}/categories

Hope this helps