How to get user's ObjectID using WSAPI

book

Article ID: 74918

calendar_today

Updated On:

Products

CA OPS/MVS Event Management & Automation CA Agile Central On Premise (Rally) CA Agile Central SaaS (Rally)

Issue/Introduction

How can we receive information, in particular the ObjectID, of users using the WSAPI?
Is there a way to receive same information for the logged on requesting user?

Environment

Release:
Component: ACSAAS

Resolution

Using WSAPI use this query:

https://rally1.rallydev.com/slm/webservice/v2.0/user?query=( username = [email protected] )&fetch=objectid

The above query is requesting the 'objectid' for a specific user ([email protected]). Notice the 'fetch' argument that's requesting the 'objectid'. The result is:

<Please see attached file for image>

User-added image

If you omit the Query argument then you it will query the requester's own user object. This example, retrieves the objectid for the logged on user , the one who is making the request:

https://rally1.rallydev.com/slm/webservice/v2.0/user?fetch=objectid

<Please see attached file for image>

User-added image


The above demonstrates how to query a user (or if no user specified then your own user). The 'objectid' can be replaced or extended with any other fields of the user object that you may need to fetch. For example using: 
fetch=objectid,username,emailaddress will return objectid , username and email for the user that's queried.
 

Attachments

1558694059902000074918_sktwi1f5rjvs16mfk.png get_app
1558694057904000074918_sktwi1f5rjvs16mfj.png get_app