Sending File attachment JSON format to Slack

955 Views Asked by At

I tried with the below Json format to send file attachment response from by bot to slack but here I get the the same Json object on the client

Here,it's not converting to the attachment format Please below is my json let me know if I'am in a wrong path.

{
"message": {
    "type": "message",
    "channel": "XXXXX",
    "user": "XXXXXX",
    "text": "XXXXXX",
    "ts": "XXXXX",
    "team": "XXXXX",
    "event": "direct_mention"
},
"payload": {
    "attachments": [{
        "jsonVal": {
            "file": {
                "url": "XXXXX",
                "name": "XXX.txt",
                "path": "XXXX"
            },
            "template": {
                "type": "generic",
                "quote": true,
                "content": [{
                    "summary": {
                        "text": "text data"
                    }
                }]
            }
        }
    }]
},
"_msgid": "XXXXXXX"
}
0

There are 0 best solutions below