Agile Central - WSAPI: How can I get a list of all users of a given workspace using Web Services API

Document ID : KB000109088
Last Modified Date : 02/08/2018
Show Technical Document Details
Question:
How can I get all Users of a Workspace named: "ABC" using WS-API ?
Answer:
1. Query the Workspace endpoint to get the ObjectID of the workspace. Make certain you specify 'ObjectID' in the Fetch argument (unless you use Fetch=True, to return all fields):

Query String:    (Name = "ABC") 

2. Use the ObjectID of the workspace and query the WorkspacePermission endpoint. 
(Workspace.ObjectID = <ObjectID retreived by step1>)

This query will return the total count of users for that workspace. If you are interested with the number then stop here and read the TotalResultCount.

3. If you need further information about these users (such as First Name, Last Name etc.. ) then you will need to refer to the actual User endpoint using the User._ref attribute in the JSON you just received in step #2.

So you need to loop over all your Users in the JSON from step 2, then call the User endpoint using the User._ref field, then read the user fields you're interested with and continue to your next user in the loop.