Via AGOL web interface, I can see group members full name, but can't via API

431
2
Jump to solution
04-13-2020 01:22 PM
JimmyKnowles
Occasional Contributor II

I'm the owner of a group and via the AGOL web interface, I can see all members of the group (even those in other organizations), I can see their usernames, and I can see their full names.

When I try and do this via the api, I can only see certain properties of those users that are not members of my organization. I can see username and id and that's about it. If I can see their full name via the AGOL web interface, why can't I see it via the api.

I'm using the following code snippets:

group = gis.groups.search("name of my group")
members = group[0].get_members()
for user in members['users']:
    ago_user = gis.users.get(user)
    name = ago_user.fullName
    user_id = ago_user.username

For those users of my org, I get their fullName fine, but I get an empty string on those outside my organization. Is this by design? If so, why can I see their full names via the web interface, but can't via the api?

0 Kudos
1 Solution

Accepted Solutions
VictorCoelho
New Contributor III

I was able to reproduce this issue as well, seems to be a bug. I suggest you to contact Tech Support to log a Bug.

As an alternate solution you can use the same request that Portal is using to retrieve the list of user. The call will return a .json with the list of users, if you inspect the requests sent from the browser it will be something like:

sharing/rest/community/groups/8039803e729b439bacff9de0633332cd/userlist?

View solution in original post

2 Replies
VictorCoelho
New Contributor III

I was able to reproduce this issue as well, seems to be a bug. I suggest you to contact Tech Support to log a Bug.

As an alternate solution you can use the same request that Portal is using to retrieve the list of user. The call will return a .json with the list of users, if you inspect the requests sent from the browser it will be something like:

sharing/rest/community/groups/8039803e729b439bacff9de0633332cd/userlist?

JimmyKnowles
Occasional Contributor II

Thanks a lot Victor. That workaround works and provides me with all the 'fullNames' of my users. I'll get a bug filed w/ tech support.

0 Kudos