Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack Web API 'users.profile.get' method question #279

Closed
3 tasks done
DevanB opened this issue Nov 4, 2016 · 5 comments
Closed
3 tasks done

Slack Web API 'users.profile.get' method question #279

DevanB opened this issue Nov 4, 2016 · 5 comments
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented

Comments

@DevanB
Copy link

DevanB commented Nov 4, 2016

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Description

I'm trying to figure out how to call the users.profile.get Slack Web API method from this library. Is it possible? The only thing I can find remotely close is the RTM dataStore method getUserById.

@DevanB DevanB changed the title users.profile.get Slack Web API method question Slack Web API 'users.profile.get' method question Nov 4, 2016
@DEGoodmanWilson
Copy link

Hello, at the moment we don't have an explicit method to call this endpoint. However, you can call any arbitrary endpoint, like users.profile.get with the WebClient.makeAPICall() method, as such:

var WebClient = require('@slack/client').WebClient;
var web = new WebClient(token);

web.makeAPICall('users.profile.get', null /*no required args to this call*/, {
    user: "U123", //optional user param
    include_labels: false //optional include_labels param, defaults to false
}, function(err, info) {
   //err is set if there was an error 
   //otherwise info will be an object that contains the result of the call
   if (!err) {
       console.log(info.howdy);
   }
});

@e-founders
Copy link

Looks like the makeAPICall is actually prefixed by an underscore so use web._makeAPICall :)

@DEGoodmanWilson
Copy link

🤦 you are of course absolutely correct on that, thank you. As it happens, a closely related issue was fixed in #289 and released as part of v3.7.0. A similar fix can be made here as well—I'll get on that this morning.

@DEGoodmanWilson DEGoodmanWilson added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Priority—Medium labels Dec 8, 2016
@DEGoodmanWilson
Copy link

@DevanB @e-founders Please have a look at #297 and tell me if this sorts out your issue! If so, I'll add some tests and merge it in.

@e-founders
Copy link

Works like a charm, thanks @DEGoodmanWilson !

DEGoodmanWilson pushed a commit that referenced this issue Dec 12, 2016
* Add explicit support for `users.profile.*`. Fixes #279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented
Projects
None yet
Development

No branches or pull requests

3 participants