Best Of
Re: dqman runs but keeps crashing
Re: Setting document creation date as source while creating document using REST API
Thank you @PramodMohandas as you mentioned the date format working fine in postman.
In Java code also the same date format needs to be handled as below,
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd=HH:mm:ss");
categoryJson.put(category_attribute_id, sdf.format(new Date()).replace("=", "T"));
So that, the date format will be passed in proper format to Java http post request.
Formatted Date using Java code: 2020-09-02T13:30:00
After this date format, it is working fine with Java code too.
Re: Document creation with Category Metadata not set in single shot using Rest and CWS SOAP Web service.
Date I was able to do it like this
{
"type": 144,
"parent_id": 2000,
"name": "apooppan",
"roles": {
"categories": {
"51279": {
"51279_2": "bbb",
"51279_3": "2020-09-02T13:30:00"
}
}
}
}
I think the Date that you give is a Date locale i tried like this as well
51279_3": "2020-09-02" in my category which I created for test it looks like this I didn't include time
Re: Content Server API - older versions
I see what you mean now guys, my apologies! I didn't realize that the link resided within the document itself. Let me bring this to Product Management for an update.
Re: Document creation with Category Metadata not set in single shot using Rest and CWS SOAP Web service.
When you use REST API to create a document, categories are not assigned to the new node from the parent folder or from the workspace type automatically, as you know it from Classic UI. You have to include them in the request body explicitly in the "roles" property. The same goes for classifications and other scenarios like copy or move. A REST client is supposed to enquire about the needed metadata to be able to add them to the creation or modification request. (Smart UI uses /api/v1/forms/nodes/create?parent_id=20013&type=144.)
If you need an example of a more complicated payload, you can configure such scenario in CS and then upload a document using Smart UI. The body of the POST or PUT request will show you an example for your code.
Re: Document creation with Category Metadata not set in single shot using Rest and CWS SOAP Web service.
Thank you @Appu Nair, As you mentioned I have tried with single String attribute based on your screen shot now document is getting created with Category. Thanks a lot.
Re: Document creation with Category Metadata not set in single shot using Rest and CWS SOAP Web service.
Glad I could be of help. It always amazes me what POSTman does so does SOAPUI. Sometimes POSTman code adds hidden headers etc so when possible create a new form from scratch and take baby steps. Also as you can see in HTML form terminology the body and file are two name-value pairs that travel with it...
I was creating a form for an RH and I had forgotten the ground rules so when I forgot that ENCTYPE I never got the file from my browser...I spent
hours chasing it looking at code I had written like thousands of times....
<form method="post" action="`url`" ENCTYPE="multipart/form-data">
Hopefully, now you can send it with more than one category....



