Solved

Salesforce callout with binary data

Posted on 2014-03-31
2
968 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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is about my first experience with programming Arduino.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

771 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

11 Experts available now in Live!

Get 1:1 Help Now