API to get User information
Hi Team
I am using the User API to get information on the User.
projectinsight.net/api/user/
When i pass the ID of the user e.g.
projectinsight.net/api/user/57cb6d4e-0b51-485d-a064-887581076dd6 it returns just a few fields of data
{"FirstName":"Mario","LastName":"Noronha","PhotoThumbnailUrl":"","PhotoMediumUrl":"","Initials":null,"CustomFieldValue_Id":null,"Id":"57cb6d4e-0b51-485d-a064-887581076dd6","IdExternal":null}
As per the user guide
https://www.projectinsight.net/api-docs/help/get-user-id It should return a list of values
I basically need the Group that the user is associated to. Is there a way to get that information?
Thanks
Mario
-
Most of the items will not return every data field because there are so many data fields and usually only a few of those data fields needed for any single purpose. Use the User Model Properties to specify which data fields you like to get. This gives you access to data you need and helps optimize bandwidth by not downloading the data you don't need.
0 -
Thanks Wes
I was trying that by passing the param name= city or appending modelproperties after the Id eg ?modelproperties=all or modelproperties=firstname. But it doesn't give the right result.
I have tried this for getting project info and it works.
Would you be kind enough to share the exact syntax or URL to get value of city or group user belongs to.Appreciate your help
Thanks
Mario0 -
Hello Mario,
You will be able to "select" the properties on the model to be returned with a modelProperies query param. An example can be found below or in the documentation below.
projectinsight.net/api/user/57cb6d4e-0b51-485d-a064-887581076dd6?modelProperties=FirstName,Address1,Company,IsActive,City
https://www.projectinsight.net/api/custom-properties-output
Let us know if you have any further questions.
Thank you,
Robert
0 -
In your example, you can get the city as follows:
projectinsight.net/api/user/57cb6d4e-0b51-485d-a064-887581076dd6?modelproperties=cityI tested that and it did return the correct city for my user.
For further syntax assistance when retrieving multiple modelproperties, I tested first name, last name and city:
projectinsight.net/api/user/57cb6d4e-0b51-485d-a064-887581076dd6?modelproperties=firstname,lastname,cityAs for getting the list of groups for the user, I am still testing that and either I or somebody else will respond soon.
0 -
Sorry Mario, but groups are not available by user through the API right now.The good news is that thanks to your post we will make it available in the next build!
0
Please sign in to leave a comment.
Comments
5 comments