Use Config Params
You can fetch and use the configured parameter values using two methods given below:
Note: The fetched configured parameter value is used within the extension and not with other extensions
Get the configured parameter value using Widgets
To fetch the value of the configured config parameter using widget, follow the steps below
- In your local drive, go to your Project folder which you created initially while constructing your widget.
- Open widget.html file.
- Edit the file by including the GET request method to retrieve the values of the configuration parameter.
- Save the file.
- Pack and publish the extension.
Sample Request
CopiedZOHODESK.get("extension.config").then((configResponse)=>{
console.log(configResponse["extension.config"]);
// handle your code here...
},(error)=>{
// handle error here...
})
Get the configured parameter value using Functions
To retrieve and use configuration parameters using functions, follow the steps given below:
- Go to Sigma > Functions > Deluge Script Builder of function which you want to associate with your extension.
In Deluge Script Builder page, provide the Request to retrieve data.
RequestURL : https://desk.zoho.com/api/v1/installedExtensions/{{installationId}}/configParams OAuth Scope : Desk.extensions.READ RequestMethod : GET RequestHeaders : orgId, Authorization
Save and execute the request code
You will get the response as shown:
ResponseResponseCode : 200 Content-Type : application/json Response : #CONFIG_PARAM_API_RESPONSE_OBJECT
- Associate function with corresponding extension.
- Publish the extension.
Sample Request
Copiedhead = Map();
head.put("orgId", data.get('integ_scope_id'));
installationId = data.get('service_app_id');
encapiKey=data.get("encapiKey");
//Get config Param
getConfigParam = invokeurl
[
url: "https://desk.zoho.com/api/v1/installedExtensions/"+installationId+"/configParams"
type: GET
content-type: "application/json"
connection: "testing"
];