0 votes
1 view
in Python by (7.4k 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 (14.6k 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"]

...