What are the various User related activities that can be accomplished using Clarity's REST APIs?
Following are some samples. Please test thoroughly in your own system before deploying in Production.
GET http://example.com/ppm/rest/v1/users
GET http://example.com/ppm/rest/v1/users/5085111
API Endpoint: POST http://example.com/ppm/rest/v1/users
Payload: { "lastName": "Account", "firstName": "Demo", "userName": "demo_account", "resourceName": "demo_account", "email": "[email protected]", "language": "1" }
API Endpoint: PATCH http://example.com/ppm/rest/v1/users
Payload: {"d":[ { "userGroups":["5000003"], "_internalId":5085364 } ] }
5000003 is the Internal ID of the Group from Clarity
API Endpoint: PATCH http://example.com/ppm/rest/v1/users
Payload: {"d":[ { "userGroups":[], "_internalId":5085364 } ] }
Notice that the "userGroups" does not have any values assigned to it
API Endpoint: PATCH http://example.com/ppm/rest/v1/users
Payload: {"d":[ { "status": "200", "_internalId":5085364 } ] }
Notice that the Internal ID of the account has to be passed. An additional REST API call can be made, where an user account is filtered by using the Username. From the output of this call, the Internal ID of the account can be determined.
GET http://example.com/ppm/rest/v1/users?filter=(userName = 'demo_account')
API Endpoint: PATCH http://example.com/ppm/rest/v1/users
Payload: {"d":[ { "status": "201", "_internalId":5085364 } ] }