Problem with required fields in category using REST Api
Hi,
I'm using REST Api to upload a document in Content Server and add to this document a category with required attributes.
I'm using the following call:POST /nodes/{id}/categories and i'm getting the following error:
org.springframework.web.client.HttpClientErrorException: 400 Bad Request
This error is obtained because the category contains a required attribute which is empty. With other categories without a required attribute the document is uploaded without problems.
How can i set the value for this required attribute in the call? Is there any other Rest call to upload a document with categories with the attributes filled?
Best regards.
Comments
-
It should be possible with the latest patch,`by including the attribute values in the request body. But it does not work on my machine. Uploading a new document with catts & atts works:
POST /api/v1/nodes Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryMRYGBMFzBICDtNEA ------WebKitFormBoundaryMRYGBMFzBICDtNEA Content-Disposition: form-data; name="body" {"name":"test","parent_id":7611,"type":144,"roles":{"categories":{"52271":{"52271_2":"test"}}}} ------WebKitFormBoundaryMRYGBMFzBICDtNEA Content-Disposition: form-data; name="file"; filename="test.txt" Content-Type: text/plain ... ------WebKitFormBoundaryMRYGBMFzBICDtNEA--
Attribute keys are in the format
{category_id}_[{set_id}_{set_row}]_{attribute_id}
.0 -
Hi Ferdinand Prantl,
I tried that and it works correctly.
Thanks.
Best regards.
0 -
Hi Ferdinand Prantl,
This last message worked in two different calls. A call to create the node and another to assign metadata. Now I need to do it in one call because the doc inherits metadata from the parent folder. I have tried what you indicated in your previous message and didn't work for me. You said taht in your machine was not working. Is there any evidence about this works?
Thanks,
Best regards.
0 -
I am not sure how the inheritance with the CS REST API works. I think that you should inspect what catts & atts are to be inherited by one call and add the needed catts & atts data to the document creation call.
0 -
Someone knows, how to do it in Postman?
without the Roles/CAT object it works fine, but how to handle the Roles with Postman (as form-data)? who to do it as "raw"?
0 -
in my JS sample I dont have quotes around categories.
0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 102 General Questions
- 123 Services
- 40 OpenText Hackathon
- 33 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 901 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 127 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax