In order to make an external request from the app, I am using client.request.invoke to call a server method to create and handle the request. My understanding is that the iparams are appended to the options parameter and this seems to work in local testing and as a private app.
However in the current published version and during QA testing calling options.iparams.param_key seems to be failing. Is there a better way to access iparams during a POST request?
{
"cwControl_url": {
"display_name": "ConnectWise Control Url",
"description": "Please enter the url for your ConnectWise Control instance, e.g.
'https://yourUrl.screenconnect.com'",
"type": "text",
"required": true
},
"cwControl_api_token": {
"display_name": "ConnectWise Control API Token",
"description": "Please enter your ConnectWise Control API token",
"type": "text",
"required": true,
"secure": true
},
"freshdesk_whitelabel": {
"display_name": "Freshdesk White-label Text",
"description": "Optional text to replace reference to 'Freshdesk' in guest invitation email. Defaults to 'Freshdesk'.",
"type": "text",
"required": true
}
}
I can observe that cwControl_api_token is a secure iparam. Secure iparams should ideally be accessed via iparam templating. Can you use <%= iparam.cwControl_api_token %> instead of directly accessing?
For example, inside the headers object, you could access the iparams like so, (assuming that you are making use of Request method
I tried changing to using that instead of accessing the iparams from the options object and I got the string “<%= iparam.cwControl_api_token %>” as the token. However getting the url this way did work.
That’s great to hear @Noah Pl. feel free to share the challenges you faced in getting it right. We’ll be happy to take it as feedback for docs/feature !