RestAPI OTDS create a group
Hi, I am looking for an example of creating a new OTDSGroup in OTDS via RestAPI.
This OTDS group must be created in a specific existing user partition.
Also the authentication part for OTDS. is still unknown if there are any examples for that as well that would be appriciated.
Thx
Answers
-
- access your OTDS swagger UI using https://<otds server>/otdsws/api/index.html?rest
- Click on authorize and login as otds-api (no need to provide client-secret)
- Use "try it out" button in the "Create a Group" API and provide name and location in the request
- Click on Execute to send the request to OTDS
- Check the curl request and implement accordingly in your application.
0 -
there is an authentication API available (/authentication/credentials). Enter username/password in the request and you should get OTDSTicket in the response. Which you can then use it in subsequent request's header.
If you use SSO, then use the Authenticate by HTTP Headers (/authentication/headers) API to get the OTDSTicket.
OTDS Documentation available on
Hope this helps.
0 -
Hi,
In C# code i do the folllowing:
string otdsRestAPIURL = @"https://URL:1234/otdsws/rest/";
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(otdsRestAPIURL);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("multipart/form-data"));
List<KeyValuePair<string, string>> parameters = new List<KeyValuePair<string, string>>();
parameters.Add(new KeyValuePair<string, string>("username", "MyUser"));
parameters.Add(new KeyValuePair<string, string>("password", "MyPassword123"));
parameters.Add(new KeyValuePair<string, string>("ticketType", "OTDSTICKET"));
HttpResponseMessage response = client.PostAsync("authentication/credentials", new FormUrlEncodedContent(parameters)).ConfigureAwait(false).GetAwaiter().GetResult();
if (response.IsSuccessStatusCode)
{
string s = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
}But this fails with a status code 415.
{StatusCode: 415, ReasonPhrase: '', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
X-OneAgent-JS-Injection: true
Server-Timing: dtRpid;desc="192376001", dtSInfo;desc="0"
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
Keep-Alive: timeout=120
Connection: keep-alive
Cache-Control: no-store, no-cache
Date: Thu, 21 Nov 2024 11:36:12 GMT
Set-Cookie: dtCookie=v_4_srv_11_sn_0F8798559D61C11120DFC6A8D6E0889E_perc_100000_ol_0_mul_1_app-3Adadffc70e35e12c2_1_rcs-3Acss_0; Path=/; Domain=.MyDomain; SameSite=Strict; secure
Server:
Content-Length: 1
Content-Type: text/html; charset=ISO-8859-1
}}Any Idea why this is not working?
I use the same constructions as for the Content Server RestAPI calls.
Best regards,
Jeroen
0 -
Compare it with this working code
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://otds_server/otdsws/rest/authentication/credentials");
var content = new StringContent("{\r\n "userName": "myuser",\r\n "password": "mypass"\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());0
Categories
- All Categories
- 122 Developer Announcements
- 53 Articles
- 149 General Questions
- 148 Thrust Services
- 56 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 917 Cloud Fax and Notifications
- 84 Digital Asset Management
- 9.4K Documentum
- 31 eDOCS
- 181 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories