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

Unable to post via chat API #25

Closed
gep13 opened this issue Jun 12, 2018 · 5 comments
Closed

Unable to post via chat API #25

gep13 opened this issue Jun 12, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@gep13
Copy link
Member

gep13 commented Jun 12, 2018

Trying to use this code:

var slackToken         = "blah";
var slackChannel        = "blah";

try
    {
        Information("Sending message to Slack...");

        var postMessageResult = Slack.Chat.PostMessage(
                    token: slackToken,
                    channel: slackChannel,
                    text: "this is a test"
            );

        if (postMessageResult.Ok)
        {
            Information("Message {0} successfully sent", postMessageResult.TimeStamp);
        }
        else
        {
            Error("Failed to send message: {0}", postMessageResult.Error);
        }
    }
    catch(Exception ex)
    {
        Error("{0}", ex);
    }
});

results in:

Failed to send message: not_authed

Seems like there was a breaking change in Slack API, as the token is no longer passed in JSON payload, but rather as part of the URL.

@jzeferino
Copy link
Member

Any update on this? @gep13 @devlead

@jzeferino
Copy link
Member

Please guys take a look at my PR #26.

@luisvitela
Copy link

When can we have a release for PR #26 ? @gep13 @devlead

@devlead devlead added this to the 0.12.0 milestone Jul 3, 2018
devlead added a commit that referenced this issue Jul 3, 2018
* jzeferino-feature/fix_token_issue_#25:
  Fixes authorization issue posting to chat api. #25.
@devlead
Copy link
Member

devlead commented Jul 3, 2018

Fixed by #26

@devlead devlead closed this as completed Jul 3, 2018
@gep13
Copy link
Member Author

gep13 commented Jul 3, 2018

@devlead thanks for getting this pulled in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants