REST API. How to get an attribute of a user

With
https://<server>:9710/gwadmin-service/domains/<domain>/postoffices/<postoffice/users/testuser
I get a whole bunch of information of the user testuser. Good.
But what I really would like as an output is only one attribute of this user, e.g. visibility.

To append ?attrs=visibility to the above URL does not work.

Also with
https://<server>:9710/gwadmin-service/diagnostics/object/
USER.<Domain>.<Postoffice>.testUser
I have no luck.

What can be done to retrieve only on attribute?

Best regards, Uwe.

  • Suggested Answer

    0  

    Using the URL like that just shows the full "record" so no filter there but you could use this 

    https://gwserver:9710/gwadmin-service/list/user.csv?attrs=domain,postoffice,name,visibility&filter=name%20eq%20%27userID%27

    where %20 is a space and %27 is a single quote

    The above will create a csv file with the columns as in the attrs and for the user equal to the name provided, without the filter= all users in the system will be in the csv file. Also you can filter on there things like PO etc

    Using the URL as you mentioned in an application/script you could parse the json data and get the visibility from there, the data you can see simply using Curl like this from a Linux server command line

    curl -k --user admin:novell -X GET -H "Content-Type: application/json" https://gwserver:9710/gwadmin-service/domains/DOM/postoffices/PO/users/userID



  • Verified Answer

    +1 in reply to   

    Hi Rob,

    that was very helpful and exactly what I was looking for!

    With my test data and used with curl this URL produced:
    doms01,pols01,name,visibility ,,SpechtB-S01,SYSTEM

    Thank you very much!
    Best regards, Uwe.