Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (19.9k points)

I am trying to use the api call users.profile.get to find a users profile picture. The problem is that the request requires not JSON, but URL encoded queries (I think?). I have the user id already, but I need to know how to send it to slack correctly, preferably with the api_call method.How would I go along doing this?

1 Answer

0 votes
by (25.1k points)

You can do it like this:

slackclient v1

response = sc.api_call(

  "users.profile.get",  

  user="U12345678"

)

assert response["ok"]

user_data = response["profile"]

slackclient v2

response = sc.users_profile_get(user="U12345678")

assert response["ok"]

user_data = response["profile"]

Browse Categories

...