Status: Open
Status: Answered
Status: Closed
Status: Duplicate

Issues with /api/v1/doctemplates/{id}/instances REST API Call - CS 10.5

0
Posted Jun 17 by Maqsood Khan.

Hello,

I'm working on a requirement to create Case Workspaces based on a template (without linking to SAP object) using CS Web Services. Upon deep diving into it, I found there are two ways to acheive this:

  1. SOAP based API (per ECMLink SDK and API documentation - 10.5 SP1)
  2. REST API Support - Binder and Case Creation (per Release Notes of Content Server Module)

I tried the 2nd way using "/api/v1/doctemplates/{id}/instances" and run into 500 internal error. As per OT logs, it seems its trying to connect to SAP system (not sure).

when tried to create a simple node using "/api/v1/nodes", that run into 400 error (Bad request). However, "/api/v1/ping" is responding with API details.

Do I need to install any patch to work with REST API? please help!

thanking you in advance for your help!

13 Answers

1
BEST ANSWER: As chosen by the author.

Can you post your code?


0
BEST ANSWER: As chosen by the author.

I tested it using Postman Rest client (attached).
enter image description here


0
BEST ANSWER: As chosen by the author.

Just to confirm, you said /ping works, when you generated your otcsticket through by passing your credentials through /auth there was no problems with that?

Before troubleshooting the templated workspaces 500 error, we should look into why you are receiving a 400 error for creating a simple node (I'm assuming its a folder youre trying to create).

What update are you on for CS?


0
BEST ANSWER: As chosen by the author.
  • /ping works fine
  • no problem while generating otcsticket
  • Got 400 error while creating node of 0 or 144 subtype
  • Current CS version: Content Server 10.5 Update 2015-03 (version 10.5.0.1641)

0
BEST ANSWER: As chosen by the author.

What does the logs say for the bad request error when creating a node of 0?
Are you trying to create inside your nodes inside node 114186? is this a binder? regular folder? or some other type of container?


0
BEST ANSWER: As chosen by the author.
  • 114186 is a binder.
  • Got 200 as response when created folder, don't know how it started working today. I could see the folder in CS. however, when created document it throws 400 error. I couldn't see any error message related to 400 in trace files. Do I need to check any other file for error logs?

0
BEST ANSWER: As chosen by the author.

No I don't think the web status codes show up in the trace file. It's good to hear creating folders is working now. For your templated workspace are there categories specified on the template? if so what is the categories definition(s) for the categories on the template? Do you use replacement values from your categories on the templated workspace name or any of its sub-items?


0
BEST ANSWER: As chosen by the author.

Yes, there are some categories applied on template workspace with both mandatory and optional attributes. I didn't understand replacement values from categories. What does that mean?


0
BEST ANSWER: As chosen by the author.

Sorry, I believe its called "Placeholders" in the Template Workspaces Installation and Administration Guide (ie <Category_CategoryID_AttributeID /> would be replaced by a value in the categories), I was experiencing some issues with generating workspaces using the REST API when they had a placeholder in its name on my system. Have you tried another template. Are any of the categories currently on your template using a "Partner Set Attribute"? Or any look up tables from the attributes extensions module?


0
BEST ANSWER: As chosen by the author.

Hayden,

Sorry for the delayed response. In an another discussion on OT CWS forum (link below), I've been informed that this could be a bug.
I'm not sure if this is helpful in your case but suggest you to have a look into it once. Also, you can post your case in that thread for support to consider your scenarios too. One of my team member had already opened a ticket with support. Hope to get a solution soon.

https://knowledge.opentext.com/knowledge/cs.dll?func=ll&objId=60282068&objAction=viewincontainer

Regarding your question, I'm guess there are few 'Set Attribute' on categories, however, No lookup tables from the attributes.

regards,

Maqsood


0
BEST ANSWER: As chosen by the author.

Hi All,

Has there been any solution to the problem? I'm getting the exact same issue.

Thanks,
Ravi


0
BEST ANSWER: As chosen by the author.

Hi Ravi,

Are you able to create a binder without any additional metadata? (Code coming out of a Postman example)

    var settings = {
  &quot;async&quot;: true,
  &quot;crossDomain&quot;: true,
  &quot;url&quot;: &quot;http://server/otcs/cs.exe/api/v1/doctemplates/45549/instances&quot;,
  &quot;method&quot;: &quot;POST&quot;,
  &quot;headers&quot;: {
    &quot;authorization&quot;: &quot;Basic xxxxxxxxxxxx&quot;,
    &quot;content-type&quot;: &quot;application/json&quot;,
    &quot;cache-control&quot;: &quot;no-cache&quot;,
  },
  &quot;data&quot;: &quot;{\n    \&quot;parent_id\&quot;:36521,\n\t\&quot;classification_id\&quot;:32117,\n\t\&quot;name\&quot;:\&quot;Created Via Postman APP\&quot;,\n\t\&quot;description\&quot;:\&quot;even the description\&quot;\n}&quot;
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

If you are able to achieve that then you will have two problems:

  • how do you handle additional metadata with required fields
  • how to manage metadata inheritance

At this time I would suggest, confirming the simple scenario works. Then in the second instance use a template with the mandatory metadata filled out. Then run it as two calls:

  • Create Template
  • Update Metadata via a PUT

1
BEST ANSWER: As chosen by the author.

Hi Matt,

I was able to create binders & cases using REST API in CS 10.5 environment. The issue got fixed after deploying a patch pat105000618 even though the patch is not meant to go with the current version of ECMLink we are using but yes that patch fixed the issue. And yes the metadata was also applied with a second REST API call after the creation of binder. Thanks for your help and giving me a head start on REST API.

Thanks,
Ravi


 You have subscribed and will receive email notifications of updates to this topic. To unsubscribe, uncheck the checkbox.

Statistics

Related categories

Related tags

Your answer

To leave an answer, please sign in.