Solved

Salesforce callout with binary data

Posted on 2014-03-31
2
986 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 42

Accepted Solution

by:
Rob Jurd, EE MVE 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now