What is the better way to call the multiple REST calls in screen actions i.e Login

Hi,

What is the better way to call the multiple REST calls in screen actions i.e LoginOnclick.


ON Login click:

1-I need to call login API then based on success, with the help of token I need to call other 2 services one by one on login screen actions only.

What is the best way, or is there any better apporaoch for this as I am seeing performance overhead there.


Thanks

Dileep.

Hi, I think as long as you need to call your REST endpoints one by one or they depend on previous calls there's no better way than just call them one by one.

If you can do that simultaneously there are some workarounds in web and there are async calls in mobile.

Hi Dileep,

That is a normal behavior to be followed especially when your login click will have several api calls in order to authenticate and authorize a particular user. for example if your authentication is ping federated but again you need to connect Salesforce to get the user account details,then this approach is viable. Having said that, if the authentication and authorization happens remotely, then making multiple api calls at single click is very much needed.