• dev app 1
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 1
    Replies
Hi,
 
I am trying to make HTTP callout To Abbyy cloud(https://cloud.ocrsdk.com/processBusinessCard) , I am getting the below error: Unsupported image file format.
 
Please find the code below:
 
 
      String endPointURL = 'https://cloud.ocrsdk.com/processBusinessCard';
      String userName = '';
      String password = '';
      ContentVersion co = [Select id,pathOnClient,title,versionData  from ContentVersion ];
     String afterblob = EncodingUtil.base64Encode(co.versionData);
   
      Blob headerValue = Blob.valueOf(userName + ':' + password);
      String authorizationHeader = 'BASIC ' +
      EncodingUtil.base64Encode(headerValue);
 
      Httprequest request = new HttpRequest();
      Http http = new Http();
 
          request.setMethod('POST');
          request.setEndpoint(endPointURL);
       request.setHeader('Authorization', authorizationHeader);
        request.setBody(afterblob);         
         
          //Making call to external REST API
          HttpResponse response = http.send(request); 
 
          System.debug('responseBody: '+response.getBody());
 
I need to send the image as request body, but the image is stored base 64 format in content version object in version data field.
 
Can anyone help me how to pass the image as request body in the above call out.
 
 Thanks,
Mahesh.
Hi,
 
I am trying to make HTTP callout To Abbyy cloud(https://cloud.ocrsdk.com/processBusinessCard) , I am getting the below error: Unsupported image file format.
 
Please find the code below:
 
 
      String endPointURL = 'https://cloud.ocrsdk.com/processBusinessCard';
      String userName = '';
      String password = '';
      ContentVersion co = [Select id,pathOnClient,title,versionData  from ContentVersion ];
     String afterblob = EncodingUtil.base64Encode(co.versionData);
   
      Blob headerValue = Blob.valueOf(userName + ':' + password);
      String authorizationHeader = 'BASIC ' +
      EncodingUtil.base64Encode(headerValue);
 
      Httprequest request = new HttpRequest();
      Http http = new Http();
 
          request.setMethod('POST');
          request.setEndpoint(endPointURL);
       request.setHeader('Authorization', authorizationHeader);
        request.setBody(afterblob);         
         
          //Making call to external REST API
          HttpResponse response = http.send(request); 
 
          System.debug('responseBody: '+response.getBody());
 
I need to send the image as request body, but the image is stored base 64 format in content version object in version data field.
 
Can anyone help me how to pass the image as request body in the above call out.
 
 Thanks,
Mahesh.
Hi,
I have a requirement.
Image is stored in Contentversion object in salesforce.
how to get these image through apex and 
How to call this image as request body in HTTP callouts? can anyone help me?

Thanks,
Mahesh
New standard button of custom object is not appearing in SF1 mobile application on Account related list?
How to Query the global fieldvaules in salesforce? can anyone help please
Dear Friends,

I have completed 11 Badges and I received two emails one with subject 'High five! Your t-shirt is on its way.' and another with subject 'Confirm your mailing address to receive your Trailhead t-shirt'. When I try to confirm my address the given link navigating to pardot account.But I don't have pardot account.Please help me...

Thanks,
Hussey
  • February 26, 2015
  • Like
  • 0