You need to sign in to do that
Don't have an account?

Error while calling REST Analytics API in Apex
Hi,
I'm trying to call the Analytics REST API in my Apex code. I'm getting an Read Time Out exception. Can someone look at it and let me know what can be the issue.
The code snippet and debug log is given below:
HttpRequest req = new HttpRequest();
//Set HTTPRequest header properties
req.setMethod('GET');
req.setHeader('content-type', 'application/json.');
req.setHeader('Content-Length','1024');
req.setEndpoint( URL.getSalesforceBaseUrl().toExternalForm() + '/services/data/v29.0/analytics/reports/00OQ0000000epc5');
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
Http http = new Http();
try {
//Execute web service call here
HTTPResponse res = http.send(req);
} catch(System.CalloutException e) {
}
Debug Log:
21:27:35.060 (60501282)|CALLOUT_REQUEST|[28]|System.HttpRequest[Endpoint=https://test.salesforce.com/services/data/v29.0/analytics/reports/00OQ0000000epc5, Method=GET]
21:27:45.079 (10079369700)|EXCEPTION_THROWN|[28]|System.CalloutException: Read timed out
Also, what happens when you:
Did you find any solution to solve that exception comes while calling the REST analystics? I have same kind of requirement to do. Help wold appriciated Thanks!!!!