Skip to content

Instantly share code, notes, and snippets.

@nmcspadden
Created October 19, 2016 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmcspadden/b25acfe0f4ca92f3525d4fb07b0c36ec to your computer and use it in GitHub Desktop.
Save nmcspadden/b25acfe0f4ca92f3525d4fb07b0c36ec to your computer and use it in GitHub Desktop.
adobe_tools - Get all users of a product config (internal)
def _users_of_product(config_data, product_config_name, access_token):
"""Get a list of users of a specific configuration."""
page = 0
result = {}
userlist = []
while result.get('lastPage', False) is not True:
url = "https://" + config_data['host'] + config_data['endpoint'] + \
"/users/" + config_data['org_id'] + "/" + str(page) + "/" + \
quote(product_config_name)
res = requests.get(url, headers=headers(config_data, access_token))
if res.status_code == 200:
# print(res.status_code)
# print(res.headers)
# print(res.text)
result = json.loads(res.text)
userlist += result.get('users', [])
page += 1
return userlist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment