Page 1 of 1

How to handle a getAppController.sendRequest response?

Posted: Wed Sep 11, 2019 8:43 pm
by rcardozo1987
Hi guys,

I need to check a response for a CreateSignatureRequest (I need to get its ID) and I don't know how to do it. I am using this kind of request:

Code: Select all

 
 
   var request = jsonObj.BatchRequest;
   
   request.CreateSignatureRequest = { _jsns:"urn:zimbraAccount", requestId:"0" };
   request.CreateSignatureRequest.signature = {
           name : signatureContent.name ,
      content : {
         type : signatureContent.contentType,
         _content: signatureContent.content
      }
   };
   
   // send CreateSignatureRequest
   appCtxt.getAppController().sendRequest ({
           jsonObj:jsonObj,
           asyncMode:true,
           errorCallback:errorCallback,
           callback:successCallback
       });
   


Does anyone have any tips? Is the response being sent to successCallback function? Thanks!

Re: How to handle a getAppController.sendRequest response?

Posted: Fri Sep 13, 2019 2:47 am
by rcardozo1987
Hey everyone,

I've just found how it works... the 'response' object is sent to the callback function as its first argument... so, you can have a .getResponse() method within your callback :)

Simple like that.