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.
2 -
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 -
Hi,
I am able to create an OTDS group and add MemberOf groups to that OTDS group. But I am not able to add Members.
The error I am getting is:
{ "status": 2001, "error": "RuntimeException: Invalid DN: OTDS-IPO_Acceptatie_Historie-L", "errorDetails": null}
GroupID —> OTDS-Test_NewGroup@OTDS
member_attr —> entryDN
validate_members —> false
Group members —> {"stringList":["OTDS-IPO_Acceptatie_Historie-L"]}
I think I do not have the correct member_attr value, but where can I check which value I have to set?
Both groups exist in OTDS, in the partition OTDS.
Best regards,
Jeroen
0 -
entryDN is Distinguished Name (DN) of a specific entry within the Active directory. It looks something like this
"oTPerson=6g587hc6-eh490-4d86-8786,orgunit=**** Administrators,partition=ABC-WN-VA-Admins,dc=identity,dc=opentext,dc=net"
So you can either get that from AD or by calling GET /users/{user_id} api
0 -
Hi,
Thank you for your answer!
I would like to add an existing OTDS group (OTDS-IPO_Acceptatie_Historie-L) as a member to the new OTDS group (OTDS-Test_NewGroup). When I use the value:
oTGroup=d26fc870-8527-4de5-9ba3-00d5eace2f3c,orgunit=Root,partition=OTDS,dc=identity,dc=opentext,dc=net
for member_attr I am getting the following error:
{ "status": 3010, "error": "Unsupported attribute for referencing members", "errorDetails": null}
The oTGroup was the value for the OTDS Group to which I would like to add the member.
Using the other oTGroup values gives the same error message.
I hope you have a way to make this work
0 -
Do you have to pass member_attr field? IMO, You dont need to.
The below curl request works for me. I was able to add group to another group.
curl -X 'POST' 'https://«OTDS»/otdsws/rest/groups/test_automation/memberof'
-H 'accept: application/json'
-H 'Authorization: Bearer '
-H 'Content-Type: application/json'
-d '{
"stringList": [
"oTGroup=bbfe4ce0-7ffe7d1,orgunit=groups,partition=Content Server Members,dc=identity,dc=opentext,dc=net"
]
}'0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 150 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