Sample Implementation


Sample Snippet to Access Input Parameters  

This Sample Snippet given show how to  Access Input Parameters and invoke the storage API from functions.


result=Map();
deskDomain =  data.get("service_domain");
appId = data.get("app_install_id");
scopeId = data.get("integ_scope_id");
encapiKey = data.get("encapiKey");
sigmaDomain = data.get("sigma_domain");
appVersion = data.get("version");
installationId = data.get("service_app_id");
encapiKey = zoho.encryption.urlEncode(encapiKey);
serviceData=data.get("service_data");
info data;
info encapiKey;
if(!deskDomain.contains("https://")){
    deskDomain="https://"+deskDomain;
}

storagemap = Map();
storagemap.put("key", "state");
storagemap.put("queriableValue", "state");
valueMap = Map();
valueMap.put("myString", "from function");
storagemap.put("value", valueMap.toString());
storageAPIResponse = invokeUrl
[
    url : deskDomain + "/api/v1/installedExtensions/"+installationId+"/storage"
    type : POST
    parameters : storagemap.toString()
    connection : "function_test"
];
info storageAPIResponse ;