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
Manish Sharma 12Manish Sharma 12 

Getting invalid http Responce error from box.com

Hi friends,

We are fetching the data(Folder and files) from box.com using the custom code and sometimes it generates the error message "Invalid Http response".
We are using the rest Api (https://api.box.com/2.0/folders) to fetch folders and files.
Kindly suggest.

Regards
Manish Sharma
Vinit_KumarVinit_Kumar
The way I would approach is to check in debug logs as what I am getting as HTTP response .
Manish Sharma 12Manish Sharma 12
Hi Vinit,

Thanks for your quick responce. I have checked in debug logs this message is appearing in debug log.
Vinit_KumarVinit_Kumar
Can you post your code ??

I am assuming you are not getting a valid JSON response.

Can you try sending the request using any HTTP tool like Fiddler,Rest Client 
Magdiel HerreraMagdiel Herrera
I've got this error before when a plain html page is returned instead of a xml response probably a proxy blocking access to the endpoint just to mention one thing could be wrong,

The request you did probably produced an unhandled error in the other side and then something weird is returned,

Since this is an integration between two cloud solutions, you'll need to first make sure both sides work before running the real thing, 

to test the box.com's api try a rest tool like suggested, could be SoapUI from eclipse or a browser plugin from firefox or chrome,

to test salesforce apex code, write the test class for this callout with the xml response you got from the first test you run locally,
(http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_testing_httpcalloutmock.htm)

if both are successful then you can make the real callout, if something goes wong, then there is a lot of debuggin you'll need to do,

posting the body of the response you're receiving will help on getting your issue solved.