botframeworkmicrosoft-skype-bot

Attach .txt, .pdf or zip file with skype bot using botframework rest-api


I was trying to attach .txt and .pdf file to skype bot using rest-api but got this error:

{
"error": {
    "code": "BadArgument",
    "message": "Unknown attachment type"
}

}

Meanwhile I found Rest API attachment error, can anyone confirm if pdf or text file attachment are restricted or not as there is no clear declaration in their api? I tried with this format:

 {
    "type": "message",

   "recipient": {
        "id": "xxxxxxxJ0niMZOII93xxxxL1E"
    },
    "text": "Here's a picture of the duck I was telling you about.",
    "attachments": [
        {
          "contentType": "application/pdf",
          "contentUrl": "myfileurl",
          "name": "filename.pdf"
        }
    ]
}

Thanks in advance.


Solution

  • Sending attachments such as PDFs is not supported in bots yet due to security concerns. Skype can only send media attachments such as audio and video.

    You can refer it here