'How to see results of Slack web API call in Python?
I'm learning about using APIs in Python, so I'm trying to get a list of users from a Slack workspace that I'm the owner of. I don't get any errors or even any warnings, but I'm unable to figure out what to do with the resulting "method" object so that I can actually see the list. Here's basically what I have:
import slack_sdk
slackClient = slack_sdk.WebClient(<token>)
slackMembers = slackClient.admin_users_list
But what the heck do I do with the resulting slackMembers object? For instance, I'd like to now see the email addresses of the users that I assume are in that object, but Python is telling me it's a "method" object so it's not an iterable and has no methods itself. I've tried looking through all sorts of pages on the Slack API web site and elsewhere, but they're either not for this sort of request (e.g., they're for how to post a message) or they're using the now deprecated slackclient module in the examples.
(For the token, I have an actual token through an app I generated that should give me admin privileges. I'm not sure how to create a minimal reproducible token for you all here.)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
