I have a lambda function build on nodejs.
export const handler = async (event) => {
return {
statusCode: 200,
body: JSON.stringify({
"response_type": 'in_channel',
"text": 'hello'
})
};
};
the response i get in slack is: {"response_type":"in_channel","text":"hello"} instead of hello;
What is happening? how can i fix this?
the response i get in slack is: {"response_type":"in_channel","text":"hello"} instead of hello;
What is happening? how can i fix this?
This probably happens because the content type is not specified.
export const handler = async (event) => {
return {
statusCode: 200,
headers: {
"content-type": "text/plain"
},
body: JSON.stringify{
"response_type": 'in_channel',
"text": 'hello'
})
};
};