Solved

Salesforce callout with binary data

Posted on 2014-03-31
2
1,021 Views
Last Modified: 2016-02-16
I need to send data to a web service from Salesforce using an APEX REST call out method.

Sending basic text data is no problem.
But apparently there is no way to send a blob or binary data.
Therefore there is no easy way to attach a file to the web service call out.

My question is, can I somehow encode/re-encode the binary attachment into plain text that can then be de-coded on the other end?

Thanks,

Kevin.
0
Comment
Question by:kevinvw1
2 Comments
 
LVL 43

Accepted Solution

by:
Rob earned 500 total points
ID: 39968834
the wiki on APEX REST https://wiki.developerforce.com/page/Creating_REST_APIs_using_Apex_REST.

Scroll down to "Accepting Binary Data from RESTRequest Object" for an example.

I was about to say just base64 encode your binary data and send as an image before coming across this, which says that's not required.
0
 

Author Comment

by:kevinvw1
ID: 39970119
Hi, thanks for the info.

Unless I am mis-understanding something it sounds like the example is to push an attachment IN to SFDC.

I am trying to push an attachment OUT of SFDC using a call out.
But apparently the call outs do not support binary type.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Domain Service Not Responding 14 35
troubleshoot a python script 8 70
How to post data to an API using ASP Classic 3 25
Record locking on classic ASP 3 36
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question