papercups icon indicating copy to clipboard operation
papercups copied to clipboard

Is it possible to send messages with attachments via API?

Open sooluh opened this issue 3 years ago • 1 comments

As you guys know, I'm building a PHP library for Papercups. I'm also building an app and making use of this Papercups, but I paused when I didn't know how to upload an attachment and send it at the same time.

I tried monitoring Network on DevTools and found /api/upload, and I managed to write code like here and here.

With that function I get a response like this

{
  "content_type": "image/jpeg",
  "file_url": "https://papercups-files-test.s3.amazonaws.com/...",
  "filename": "...",
  "id": "fb15ed9c-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "object": "file"
}

Then I tried to send a message with an additional key, namely "attachments" with the resulting value from the json above, but when the webhook arrived on my server, the attachment only contained an empty array and on the Papercups dashboard there was no attachment.

Are attachments not supported for the API yet? Thank you😀

sooluh avatar Sep 09 '21 08:09 sooluh

at the moment this is not possible, but we'll fix it soon!

reichert621 avatar Sep 23 '21 15:09 reichert621