Consuming OTDS API using REST Java
All,
Blocking your calendar to discuss on the below and request you to provide your inputs.
- We have created oauthclient and generated secrete id and passed in the code.
- When we try to consume OTDS API from REST API (Java) we are receiving the error ‘no OTDS ticket’
Please request you to provide in case if you have any code snippet syntax for the above scenario which you have already implemented in one of your engagements.
Thanks
Balaji
Comments
-
can you share the code you are using so we can review and debug ?
0 -
HttpHeaders headers = new HttpHeaders(); headers.add("Authorization", "Basic "+"<<client-id>>:<<client-secret>>"); headers.add("Accept-Encoding", "gzip, deflate, br"); HttpEntity<HttpHeaders> request = new HttpEntity<>(headers); String mlEndpoint = String.format("https://<<otds>>/otdsws/rest/users/%s/", "<<user_id>>"); HttpComponentsClientHttpRequestFactory clientHttpRequestFactory = new HttpComponentsClientHttpRequestFactory( HttpClientBuilder.create().build()); RestTemplate restTemplate = new RestTemplate(clientHttpRequestFactory); ResponseEntity<String> response = restTemplate.exchange(mlEndpoint, HttpMethod.GET, request, String.class); if (response.getStatusCodeValue() == 200) { try { JSONObject myObject = new JSONObject(response.getBody()); System.out.println("The response from OTDS API is " +myObject) } } catch (JSONException e) { e.printStackTrace(); }
0 -
Not seeing the authentication happening clearly in the code, as a simple test try it in something like PostMan to ensure you have it all working.
You will need to authenticate first (authentication/credentials) to get a valid OTDS ticket, which is different from an OTCS ticket used for accessing Content Server.
0 -
would it be great if you are able to share some code snippet here in case you implemented in the past for OTDS please
0 -
relatively simple to get the OTDS ticket as per the above and then call the endpoint, e.g. "'/groups?where_partition_name=’+parName;" to get the details of that partition.
More can be found at https://developer.opentext.com/apis/3a7bfdae-4cd3-465c-8485-c887f65def9b/bb4a87a8-62f4-4f81-a16e-2a258e7a51f1?action=search.
0 -
Thank you!
yes, post getting the auth token it was working fine. Now, we are facing the below challenge where we are unable to sync OTDS and Documentum repositories.
We were able to create users using the OTDS API through JAVA code. Now we need to consolidate the same users between the OTDS and MEDS repository. When we try to consolidate using the below API (https://otds.medsdev.merck.com/otdsws/rest/consolidation/missinguser), getting the 403 error (unauthorized). User which users to sync has all the admin roles in otds. Please request you to advise on this.
0 -
Hi Balaji,
Can you post the code on how you were able to get the access token and then use it for subsequent REST API calls?
Thank you,
Hari
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 151 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories