Attachments
Purpose
These commands are used to perform certain actions related to attachments.
Request URL
Upload attachment from URL
Used to fetch a file from the given URL and upload it as an attachment to a new email.
clientsdk.dispatch("fetchAnduploadAttachment", { attachApiXhr:{} }).then(function(mailObj){ });
Download attachments
Used to download attachments using the given metadata. If needed, the file can then be sent to a destination using a callback API.
clientsdk.dispatch("downloadAttachment", { attachInfo:{} callbackApi:{} }).then(function(mailObj){ })
Remove attachments
Used to remove attachments using the given metadata.
clientsdk.dispatch("composeActions", { mode: "removeAttachment", attachId: <tempFileId or attachId>})
Download attachments from compose window
Used to download attachments from the compose window using the given metadata.
If attachId is returned in the Get current compose details SDK.
clientsdk.dispatch("downloadAttachment", { attachInfo: { attachId, entityId, entityType } })
If tempFileId is returned in the Get current compose details SDK.
clientsdk.dispatch("downloadAttachment", { attachInfo: { tempFileId: <Value> } })
Download inline attachments from compose window
Used to remove attachments using the given metadata.
clientsdk.dispatch("downloadInlineAttachment".then((response)= > {console.log(response.inlineBlobs)})
The response will be an array of [externalImageUrls: [], inlineBlobs: [], failedUrls: []]
Request Parameters
| Parameter | Description |
| attachApiXhr | Invoke URL - {fileName:<name>, url:<api url>, type:<request type>, headers:<headers>, payload:<payload>, servicename:<serviceName>, params:<request params need to be sent>} |
| attachInfo | {groupId: "", entityId: "", entityType: "", attachId: ""} |
| callbackApi | Invoke URL - {url:<api url>, type:<request type>, headers:<headers>, payload:<payload>, serviceName:<serviceName>, params:<request params need to be sent>, file: {fileName: <name of the file>, fileParamName: <parameter name in which the file should be sent>, attachPayload:<request body need to be sent along with file upload>} |