How to send attachments using Symphony python client

Send a message with a file attachment using the Symphony Python Client by using the code below:

 

message = dict(message = '<messageML>Hello World</messageML>',
attachment = ("filename.ext", open("filepath\\filename.ext", "rb"), "MIMEType")

 

Note: The MIMEType is the MIME type of the file you specified, for example a jpeg will be image/jpeg

 

Note: If a MIME type does not exist for your file, use application/octet-stream which is the MIME Type for binary data

 

Alternatively, there is a client which can be used located here in the Symphony Platform Solutions repository.

 

If you are still experiencing issues sending attachments via Python, please contact the Symphony Support team at support@symphony.com for further assistance.