Skip to content

Instantly share code, notes, and snippets.

Created Mar 25, 2022
What would you like to do?
List organization active members
import json
import requests
api_key = input_data.get("api_key")
if not api_key:
raise Exception("Please enter an API Key into the required field")
organization_id = requests.get(f"{API_ROOT_URL}/me", auth=(api_key, "")).json()["organizations"][0]["id"]
response = requests.get(
auth=(api_key, ""),
params={"_fields": "memberships"},
headers={"Content-Type": "application/json"},
output = [{"id": x["user_id"], "name": x["user_full_name"]} for x in response["memberships"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment