Closed missingdays closed 4 years ago
According to Slack API:
https://api.slack.com/methods/chat.postMessage
this endpoint requires token sent in body
, not in Authorization Header
.
The ChannelId
is properly serialized as channel
field in request.
this endpoint requires token sent in body, not in Authorization Header.
Ok, how do I provide it in body then? There is no setToken
method in ChatPostMessageParams.builder()
The ChannelId is properly serialized as channel field in request.
If you debug my code and stop at SlackWebClient#executeLogged, you can inspect request
and see that the parameter is called channelId
Ok, how do I provide it in body then? There is no
setToken
method inChatPostMessageParams.builder()
This is an actual bug that needs to be fixed.
If you debug my code and stop at SlackWebClient#executeLogged, you can inspect
request
and see that the parameter is calledchannelId
Yes, but if you stop a debugger at NingAsyncHttpClient and look at the actual request you will see, that it has channel
not channelId
in a request body - because during conversion there is @JsonProperty
used.
I just wrote my first response because I felt in the same error and try to figure it out by myself.
This is an actual bug that needs to be fixed.
I see, thanks. I've updated issue description
I just hit the same problem that @missingdays reported in the beginning of this post -- a very simple postMessage
call resulting in the invalid_arguments
error.
But I don't think it's because the token has to be supplied in the body. I tracked this down and in my case it was the problem already fixed by https://github.com/HubSpot/slack-client/commit/6498a9ec56b52b7a8b8848f16b28c44887013237
Presumably that behavior changed in Slack since t he last release. I think this library just needs a new release.
It sounds like the underlying issue has since been fixed -- we'll keep an eye out for ways we can improve the debugging here. Going to close this, feel free to reopen if it presents again.
It sounds like the underlying issue has since been fixed -- we'll keep an eye out for ways we can improve the debugging here. Going to close this, feel free to reopen if it presents again.
Sorry, I don't see how the underlying issue has been fixed. Could you please provide a commit that fixed this issue?
Slack Api
chat.postMessage
endpoint requirestoken
parameter to be sent in body instead of Auth header. This leads toincorrect_arguments
error.To Reproduce Steps to reproduce the behavior:
Send new message using standard way (see my example below)
Expected behavior Message is sent, ok result is returned
Actual result No messages are sent, error
invalid_arguments
is returned