RTC REST or OSCL API : how to archive a user / contributor ?
Accepted answer
If there is no REST API for this, the Plain Java Client Libraries are available and can modify users.
See:
- https://rsjazz.wordpress.com/2013/01/08/maintaing-user-photos-with-the-plain-java-client-libraries/
- https://rsjazz.wordpress.com/2012/10/12/changing-the-jazz-user-id-using-the-rtc-plain-java-client-libraries/ (Does not work for DNG)
- https://rsjazz.wordpress.com/2017/03/29/managing-contributor-licenses-using-the-plain-java-client-libraries/
3 other answers
You can find documentation on the foundation users API referenced from
235240: JFS Users API doc. Specifically, https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.Attachment/117381.
You can query for users using a GET on contextRoot/users?query=query
The syntax of the query is described in https://jazz.net/wiki/bin/view/Main/JFSApplicationQueryLib#Query_Syntax
The syntax of the query is described in https://jazz.net/wiki/bin/view/Main/JFSApplicationQueryLib#Query_Syntax
The syntax seems similar to OSLC query, but the API is not an OSLC query capability.
For example, you might use a query string (unencoded) of foaf:name="Firstname Lastname" or foaf:mbox="user@domainname.com".
Remember that query parameters should be URL encoded. For example:
GET https://jazz.net/jazz/users?query=foaf%3Aname%3D%22Firstname%20Lastname%22
For example, you might use a query string (unencoded) of foaf:name="Firstname Lastname" or foaf:mbox="user@domainname.com".
Remember that query parameters should be URL encoded. For example:
GET https://jazz.net/jazz/users?query=foaf%3Aname%3D%22Firstname%20Lastname%22
The response is an atom feed with mime type
application/atom+xml
Comments
I have searched this forum and find the users API confusing.
The CCM Rootservices.xml lists
<jfs:users
rdf:resource="https://elm.example.com:9443/jts/users" />
This returns 405 if called. You can call it using https://elm.example.com:9443/jts/users/<userID> and then you get the user and can modify it. (header only accept required, I used application/rdf+xml)
I can get the users by calling https://elm.example.com:9443/ccm/oslc/users with an accept header like above and header OSLC-Core-Version 2.0. This provides me with the JTS links for all the users. I wonder where I could discover this information.
The reportable rest is also listed in several examples to allow getting the users, especially in the context of project areas.
Have you tried a GET followed by a PUT?
For example: GET <userUri> with Accept=application/rdf+xml
This might provide:
Try that.
This might provide:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:jfs="http://jazz.net/xmlns/prod/jazz/jfs/1.0/"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<rdf:Description rdf:about="https://clmwb.com:9443/jts/users/TestJazzAdmin1">
<foaf:mbox rdf:resource="mailto:jazzdt@info.com"/>
<foaf:nick>TestJazzAdmin1</foaf:nick>
<foaf:name>TestJazzAdmin1</foaf:name>
<jfs:archived rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
>false</jfs:archived>
<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
</rdf:Description>
</rdf:RDF>
Change the jfs:archived property to true, then perform a PUT.
Try that.