Messages

Retrieve a previously sent attachment

Whispir offers the possibility to retrieve attachments that you sent via email to your customers. In order to proceed please find first the message_id of your outbound message, as explained here

Finding the attachments of an email

  • JSON
  • XML

{{codeStart}}

# To get the attachments in a message sent from a User-defined workspace

GET https://api.<region>.whispir.com/workspaces/:workspace_id/messages/:message_id/messageattachments

# To get the attachments in a message sent from the default workspace

GET https://api.<region>.whispir.com/messages/:message_id/messageattachments

 

Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk

x-api-key: your_api_key

Accept: application/vnd.whispir.messageattachment-v1+json

{{codeEnd}}

Sample Response

200 - OK

  • JSON
  • XML

{{codeStart}}

{

"status": "1 to 1 of 1 ",

"messageattachments": [

{

"id": "893CC51DFBFC4CBE",

"name": "TestIcon.png",

"description": "TestIcon.png",

"size": "3794",

"type": "png",

"link": [

{

"uri": "https://api.au.whispir.com/workspaces/5E89F4525738D415/messages/BAE242D3B99BD8244A84A21FD49F9C78/messageattachments/513EA51DFBF7A7EB",

"rel": "download",

"method": "GET",

"host": "api.au.whispir.com",

"port": -1

}

]

}

],

"link": []

}

{{codeEnd}}

Response Body Details

description

A description for the attachment

id

The attachment identifier

name

The attachment title

size

The size of the attachment in bytes

type

The file extension

link

The download link

Download any single attachment

With the previous call we got a list of attachments that were sent along with a specific message_id. Namely, in the example above we had only an element that we will now download

  • JSON
  • XML

{{codeStart}}

# To download an attachment in a message sent from a User-defined workspace

GET https://api.<region>.whispir.com/workspaces/:workspace_id/messages/:message_id/messageattachments/:attachment_id

# To download an attachment in a message sent from the default workspace

GET https://api.<region>.whispir.com/messages/:message_id/messageattachments/:attachment_id

 

Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk

x-api-key: your_api_key

Accept: application/vnd.whispir.messageattachment-v1+json

{{codeEnd}}