1

I am working on a slash command in PHP and have the username, but I need the user id in order to make some API calls.

I am aware of the users.list method, but that's a lot of extra information I don't need. Is there a more efficient way to do it, or do really I need to retrieve the whole list for the team and go through it until I find the unique username?

Thank you in advance!

Edit: This is not a duplicate of the proposed question as I am not using the user's email address to pull their information. I am trying to pull the user's profile by using their username and trying to avoid using users.list, as it pulls everybody's information instead of just the user I am interested in. Thanks!

Irina
  • 1,333
  • 3
  • 17
  • 37
  • 1
    yes. that is the only way. and its only one API call, so pretty efficient – Erik Kalkoken Jul 06 '17 at 03:26
  • Thank you, that's unfortunate. I understand it's just one API call, but it retrieves the entire user list when I only need the information for one. I appreciate the quick answer, though! – Irina Jul 06 '17 at 04:10
  • 3
    Slack commands can be configured to expand `@user` to its id before delivering the command arguments to your endpoint. See my answer [here](https://stackoverflow.com/a/51469610/2392172). – sshaw Jul 22 '18 at 22:04

0 Answers0