mulesoft/salesforce-connector — Issue #17: Attachment/Document Base64 Encoded Data Support
Author: djat
Created: 2011-12-06 19:49:34+00:00
State: open

The Attachment and Document Objects in Salesforce (there could also be others) require the Body field to be base64 encoded:

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_attachment.htm#topic-title
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_document.htm#topic-title

When I try to insert an Attachment record in Salesforce I get this error:

sfdcattachpayload=[[SaveResult errors='{[1][Error fields='{[1]Body,}'
message='Body: value not of required type: IklEIiwiQWNjb3VudF9OQU1FIgoiIiwiSGVsbG8gSm9obiBBY2NvdW50IgoiMDAxVTAwMDAwMDVYVUlRSUE0IiwiVW5pdGVkIE9pbCAmIEdhcywgVUsiCiIwMDFVMDAwMDAwNVhVSVJJQTQiLCJVbml0ZWQgT2lsICYgR2FzLCBTaW5nYXBvcmUiCiIwMDFVMDAwMDAwNVhVSVNJQTQiLCJFZGdlIENvbW11bmljYXRpb25zIgoiMDAxVTAwMDAwMDVYVUlUSUE0IiwiQnVybGluZ3RvbiBUZXh0aWxlcyBDb3JwIG9mIEFtZXJpY2EiCiIwMDFVMDAwMDAwNVhVSVVJQTQiLCJQeXJhbWlkIENvbnN0cnVjdGlvbiBJbmMuIgoiMDAxVTAwMDAwMDVYVUlWSUE0IiwiRGlja2Vuc29uIHBsYyIKIjAwMVUwMDAwMDA1WFVJV0lBNCIsIkdyYW5kIEhvdGVscyAmIFJlc29ydHMgTHRkIgoiMDAxVTAwMDAwMDVYVUlYSUE0IiwiRXhwcmVzcyBMb2dpc3RpY3MgYW5kIFRyYW5zcG9ydCIKIjAwMVUwMDAwMDA1WFVJWUlBNCIsIlVuaXZlcnNpdHkgb2YgQXJpem9uYSIKIjAwMVUwMDAwMDA1WFVJWklBNCIsIlVuaXRlZCBPaWwgJiBHYXMgQ29ycC4iCgoK'
statusCode='INVALID_TYPE_ON_FIELD_IN_RECORD'