[ngw] Rest-API call for associate users to directory

Morris Blackham mblackham at gw.novell.com
Sat Nov 22 18:06:30 UTC 2014

Uwe,  here's the data to POST:  (in json format)

data = {'directoryId':'edir202',

if you use commit:false,  you get a list of object that matched,  setting it to true will associated all matched users.

another keyword you can use is overwrite:true/false  (default is false) to overwrite existing associations.

Hope this helps..

>>> "Barth Uwe" <Uwe.Barth at stadt-chemnitz.de> 11/22/2014 9:06 AM >>>

in Admin Console under 'System > Directory Association' I can link users to my directory based on a specified OU via GUI. Because there are a lot of users in my lab environment I want to call this with a Rest-API call. 

I read the documentation that Admin-Service gives me (the API-docs at novell.com are to old and often not correct) 

Methods POST
Link the users in the specified container to the directory users returned from the   LDAP search specified.
acceptable request representations:
- application/json dirLink
- application/xml dirLink
available response representations:
- application/xml
- application/json

and build the following curl commandline based of my understanding of what 'dirLink' could mean

curl -k --user admin:123456 --header "Content-Type:application/xml" --data "<directoryLink><directoryId>ActiveDirectory_lab</directoryId><ldapDn>OU=Users,DC=mydomain,DC=local</ldapDn></directoryLink>" -X POST https://grpwise.mydomain.local:9710/gwadmin-service/system/directorylinks

As result I get a 'BAD REQUEST' message

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiStatus xmlns:ns2="http://www.w3.org/2005/Atom"><error>true</error><httpStatus>BAD_REQUEST</httpStatus><httpStatusCode>400</httpStatusCode></apiStatus>

Is there anywhere a documentation of the used parameters like 'dirLink' or can someone point me where my failure in the curl command is?


ngw mailing list
ngw at ngwlist.com

More information about the ngw mailing list