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 as attachment to a new email.

clientsdk.dispatch("fetchAnduploadAttachment", attachApiXhr).then(function(mailObj){ });

Download attachments

Used to download attachment using the given metadata. If needed, the file can then be sent to a destination using a callback API.  

clientsdk.dispatch("downloadAttachment", { attachInfo:{} callbackApiXhr:{} }).then(function(mailObj){ })

Request Parameters

ParameterDescription
apiXhrObjInvoke 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: ""} 
callbackApiXhr 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>}