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
Vijaya AmarnathVijaya Amarnath 

http request is getting delayed

Hi All,


We are integrating from salesforce to one of our client server using REST API, here we are not sending any data to the endpoint. In the endpoint we are just sending one AgentId based on the current logged in User. This one we are doing from Vf page and class, through a custom button. Here the problem is most of the times the request reaching to the client server very late and also some times it's getting Timeout. Can anyone help us, how to resolve this?..

 
RD@SFRD@SF
Hi Vijaya,

Can you try increasing the timeout setting in the connected app settings in the org. Usually it is not set and takes in default value.

Heres a excerpt from salesforce documentation

"Session Policies
Session policies apply to all connected apps.
Session Timeout Value—Specifies when access tokens expire to end a user’s connected app session. You can control how long a user’s session lasts by setting the timeout value for the connected app, user profile, or org’s session settings (in that order). If you don’t set a value or None is selected (the default), Salesforce uses the timeout value in the user’s profile. If the profile doesn’t specify a timeout value, Salesforce uses the timeout value in the org’s Session Settings. "

Hope it helps
RD
Vijaya AmarnathVijaya Amarnath
Hi @RD@SF,

Already I given timeout value.. Here is the code..

HttpRequest req = new HttpRequest();
req.setTimeout(120000);
HttpResponse res = new HttpResponse();
Http http = new Http(); 
req.setEndpoint('http://---clientServerIP--/apps/appsHandler.php?transaction_id=CRM&agent_id={!AgentId}&resFormat=1');
req.setMethod('GET');
res = http.send(req);

It's a open Api, and AgentId we are passing dynamically..