function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DeepikareddyDeepikareddy 

Send the image using the callout Rest api

how to send the image in salesforce rest callout using <inpu
<div >
                                            <apex:inputFile  value="" ></apex:inputFile> 
                                         
                             <input type="button" c value=" Choose File" />
                                            <span class="file-info">  No file Chosen</span>
                                        </div>

i should have to select a image form the choose file  and send in the form of json .. to the third party api , how it should process,in the json Post request?

and later to preview using the Get request..? 


 
Best Answer chosen by Deepikareddy
Ajay K DubediAjay K Dubedi
Hi Deepika,

You can use the below links: 

1.https://salesforce.stackexchange.com/questions/180311/send-blob-file-via-apex-rest-callout

2.https://salesforce.stackexchange.com/questions/189247/apex-rest-callout-form-data-blob-help

3.https://forum.ionicframework.com/t/sending-image-to-post-rest-api/119694.

4.https://docparser.com/blog/post-file-salesforce-apex-external-http-webservices/.

5.https://stackoverflow.com/questions/38568792/cannot-upload-image-or-attachment-to-salesforce-chatter-rest-api.


I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com