WSAPI: How can I get a list of all users of a given workspace using Web Services API
search cancel

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

book

Article ID: 109088

calendar_today

Updated On:

Products

Rally On-Premise Rally SaaS

Issue/Introduction

How can I get all Users of a Workspace using WSAPI ?

Environment

Release:
Component: ACSAAS

Resolution

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).

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

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.