AnsweredAssumed Answered

Discrepancies accessing AGO Community users through REST API using PortalPy

Question asked by BrackeH on Dec 5, 2014
Latest reply on Mar 21, 2017 by ANohe-esristaff

I am using the Python Module, PortalPy, found on GitHub to write scripts to run administrative tasks in ArcGIS Online.  PortalPy is great because it keeps me from having to access the REST API myself, which is something I'm not very familiar with.  But I'm running into discrepancies in what is being returned and I'm not sure whether the inconsistency is within the REST API or the PortalPy module.  There are two functions within the module - get_org_users and get_user - that I am having trouble with at the moment


Our organization has implemented custom roles.  I have a script that stores each member's information in json format so that I can access relevant information outside of AGO.  The problem is:


get_org_users returns true 'role' for every user (including custom roles) but returns an empty list for 'groups' for each user. get_user returns only ESRI-defined 'role' for each user (custom role value returned defaults back to ESRI-defined template that custom role is based on?) but returns a populated dictionary for 'groups' for each user.


I need to have the user's true 'role' and 'groups' in the same json file.  Can anybody explain why the two functions do not produce the same results?