I am using botkit by howdy to make the api call for postMessage method. Its giving me invalid_array_arg
error when I am passing attachment property. Is something wrong with the way its getting POSTed
bot.api.chat.postMessage(
{
channel : '#general',
text : 'hi',
parse : true,
username: '@' + bot.identity.name,
as_user : true,
icon_url: listOfMessages.logoUrl,
attachments: [{"pretext": "pre-hello", "text": "text-world"}]
}, function (err,res) {
if(err) console.log(err);
console.log(res);
}
);
I was running into this same issue and fixed it by stringifying the array.
attachments: JSON.stringify([{"pretext": "pre-hello", "text": "text-world"}])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With