Get download links to the original files of a message's attachments
const url = 'https://open-api.replyco.com/openapi/bytefiles/messageattachments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/links';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://open-api.replyco.com/openapi/bytefiles/messageattachments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/links \ --header 'Authorization: Bearer <token>'Returns a direct download link to the original, full-resolution file of every attachment of the message, together with its name, MIME type, size and thumbnail ID.
Using the links:
- Download a file with a plain GET request to its ‘url’, without the Authorization header
- Links to files stored by Replyco are valid for about 24 hours. Request fresh links when you need them instead of saving them
- Links to files hosted by eBay are returned exactly as eBay provided them
- ‘url’ is null when no download link is available for an attachment
Sample request:
GET /openApi/byteFiles/messageAttachments/3fa85f64-5717-4562-b3fc-2c963f66afa6/links
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The ID of the message to retrieve attachment links for
Responses
Section titled “Responses”Returns the list of attachment links; empty when the message has no attachments
A link to download the original, full-resolution file of a message attachment.
object
The name of the file including its extension (e.g., “invoice.pdf”, “image.jpg”)
Direct download link to the original file. Open it with a plain GET request, without the Authorization header. Links to files stored by Replyco are valid for about 24 hours, so request fresh links instead of saving them. Links to files hosted by eBay are returned exactly as eBay provided them. Null when no download link is available for the attachment.
MIME type of the file, detected from its extension (e.g., “image/jpeg”, “application/pdf”)
Size of the file in kilobytes, when known
ID of a small 180x120 cropped thumbnail of the attachment, available from GET /openApi/byteFiles/{id}. Null when no thumbnail was generated (for example, for files hosted by eBay)
Example
[ { "fileName": "damaged-parcel.jpg", "url": "https://files.example.com/attachments/damaged-parcel.jpg?signature=abc123", "mimeType": "image/jpeg", "sizeInKiloBytes": 412, "previewId": "c3d7a1e9-5f2b-4c8d-9e6a-0b4f8d2c7a15" }]User is not authenticated or authorized
Message with the specified ID was not found