How to handle a getAppController.sendRequest response?

Interested in talking about Mash-up's? This is the place.
Post Reply
User avatar
rcardozo1987
Posts: 23
Joined: Tue Sep 10, 2019 9:14 pm
ZCS/ZD Version: NETWORK edition, Patch 8.8.15_P11

How to handle a getAppController.sendRequest response?

Post 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!
User avatar
rcardozo1987
Posts: 23
Joined: Tue Sep 10, 2019 9:14 pm
ZCS/ZD Version: NETWORK edition, Patch 8.8.15_P11

Re: How to handle a getAppController.sendRequest response?

Post 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.
Post Reply