0

We have a API callout from aura component which gets invoked on a button press. Our org has about 150+ users using it. Nowadays , few users are complaining of API not getting called from aura components intermittently.[Checked from the server side , it does not get request] Is this some scaling issue or there is a limit on API callouts from Aura components. Code used for calling api -

callApi : function(component,helper,jForm){
        let resource = component.get("v.resourceInfo");
        var urlEndpoint = resourceInfo['url'];
        $.ajax({
            url: urlEndpoint,
            data: jForm,
            isProcessData: false,
            isContentType: false,
            mimeType: "multipart/form-data",
            type: 'POST',
            headers:{
                "Authorization" : "Basic " + resource['api_key']
            },
            error: function(error) {
                component.set("v.error",error['statusText']);
                component.set("v.showSpinner",false);
            },
            success: function(data) {

                var obj = JSON.parse(data);
              if(resourceInfo['user'] == undefined ){
                    let stringJson = JSON.stringify(obj['msg']['file']) ;
                    if(stringJson){
                        attachmentURL = '[' + stringJson + ']';
                    }
                } else {
                    let stringJson = JSON.stringify(obj['attachment']) ;
                    if(stringJson){
                        attachmentURL = '[' + stringJson + ']';
                    }
                }
                
            }
        });
    }

P.S. - code does not work in one of the production org but works everywhere else.

8
  • I don't think this is related to scaling issue or api limits at Salesforce org. There are no daily limits for outbound API callouts and since you are making the callouts from lightning component, apex callout limitations don't apply here. By Checked from the server side, did you mean you are able to check at the server were the service is hosted?
    – arut
    Commented Mar 31, 2022 at 13:14
  • Are you able to replicate the problem? And, why use jQuery when you can get this done via Lightning/ Apex?
    – arut
    Commented Mar 31, 2022 at 13:24
  • Yes, I checked from server where the service is hosted. Also, this code is in managed package and not able to replicate the issue elsewhere.
    – Rohit
    Commented Apr 1, 2022 at 15:03
  • Regarding jQuery, this is legacy code in managed package due to which cannot change it or add logs.
    – Rohit
    Commented Apr 1, 2022 at 15:06
  • Hard to point out the problem since this seems to be happening in only one of the production orgs. Are you able to replicate (I mean are you at least able to observe this behavior once in x # of callouts)? If yes, you could try reaching out Salesforce support and check if the callout was made in the first place (or if the server did not respond)?
    – arut
    Commented Apr 1, 2022 at 17:44

0

You must log in to answer this question.

Browse other questions tagged .