papercups-io / papercups

Open-source live customer chat
https://app.papercups.io/demo
MIT License
5.76k stars 525 forks source link

Is it possible to send messages with attachments via API? #964

Open sooluh opened 3 years ago

sooluh commented 3 years ago

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😀

reichert621 commented 3 years ago

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