2

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
too_cool
  • 1,164
  • 8
  • 24

2 Answers2

2

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
          }
        }
      }
user202
  • 758
  • 10
  • 26
0

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

Hope this helps

Irukandji
  • 1,208
  • 10
  • 22
  • That's to add a category to a node. I don't think that is the same as giving a node's category a value. – Tyler Oct 11 '17 at 19:23
  • I see. Have a look at the put method api/v1/nodes/{id}/categories/{category_id}/ (Updates attributes values on the specified category and node) – Irukandji Oct 11 '17 at 19:47
  • What if the Attribute is Required Field..Then you cant upload the file with out specifying that – too_cool Oct 12 '17 at 10:24