I am trying to send a formatted JS object on Slack using the API.
Best I could do was sending to chat.postMessage as:
const testObj = {a: "Hello", b: "World"};
...
data: {
channel: "#my-channel"
text: JSON.stringify(testObj, null, "\t")
}
But it's still not formatted well and can't be minimized like JSON file on Slack.
How can I send it better formatted or as a JSON file?