You need to sign in to do that
Don't have an account?
During Salesforce to SAP Business One Integration, Throwing error: Read Timeout Error
Step 1: I have used SAP Business one login API and get the sessionId and these session id is used for authentication in another API.
Step 2: I have tested order API using sessionId and it is working fine in postman.
Step 3:
Now I am testing same api with Salesforce anonymous window:
I executed below code using Salesforce anonymous window but it is not working and throwing Read timeout error.
String url = 'http://3.64.141.168:50001/b1s/v1/Orders?$filter=DocEntry lt 8 and((DocEntry lt 8 or DocEntry gt 116)and startswith(CardCode,\'C20000\'))';
String B1SESSION = 'B1SESSION=0e9f02f8-d8d2-11eb-8000-0a0e85552c48';
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setHeader('Cookie', B1SESSION);
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept', '*/*');
req.setEndpoint(url);
//Request Send
HTTPResponse res = http.send(req);
Integer responseCode = res.getStatusCode();
System.debug('response Code::'+responseCode);
System.debug('response Body::'+res.getBody());
When I removed query parameter from URL then after it is working fine so I am not getting why it is not working with $filter query parameter?
So it is salesforce bug or salesforce is not supporting complex query parameter like below?
Odata Query Parameter:
$filter=DocEntry lt 8 and((DocEntry lt 8 or DocEntry gt 116)and startswith(CardCode,'C20000'))';
If you have observed this behaviour recently without any changes in the org or after following best practices to make a API callout then, It would be recommended to reach out to the Salesforce support team for a better assistance on the above issue.
While raising a case, please mention the details about the implementation and first date when the issue was observed with components involved.
Resource:
https://help.salesforce.com/articleView?id=sf.workcom_contact_support.htm&type=5
Hope above information helps. Please mark as Best Answer so that it can help others in future.
Thanks.