I was attempting to build some functionality into my slackbot using the Ephemeral Message and discovered that the baseline call is no longer working. Here is my example code: The top block is how I am calling the provided function, and the bottom block is me building the same call using the Api call.
This call fails with response.error having the value invalid_arguments.
client.PostEphemeralMessage((response) =>
{
Console.WriteLine("built in call {0}", response.error);
}, channelId, "built in call", userId);
This succeeds and I see the message show up properly in my slack channel.
var request = new List<Tuple<string, string>>();
request.Add(new Tuple<string, string>("channel", channelId));
request.Add(new Tuple<string, string>("text", "Direct API call"));
request.Add(new Tuple<string, string>("user", userId));
var callback = new Action<PostEphemeralResponse>((response) =>
{
Console.WriteLine("Direct API call {0}", response.error);
});
client.APIRequestWithToken(callback, request.ToArray());
In both cases I am using the same channelId and userId with the same token.
Perhaps I am calling the function incorrectly, so let me know if that's the case.
I was attempting to build some functionality into my slackbot using the Ephemeral Message and discovered that the baseline call is no longer working. Here is my example code: The top block is how I am calling the provided function, and the bottom block is me building the same call using the Api call.
This call fails with
response.error
having the valueinvalid_arguments
.This succeeds and I see the message show up properly in my slack channel.
In both cases I am using the same
channelId
anduserId
with the same token. Perhaps I am calling the function incorrectly, so let me know if that's the case.