I am trying to build a simple installation page with one input for the Freshservice API key and a multidropdown that needs an API call to set up its options.
Here is my iparams.json:
I want the users to fill in a valid API key, refresh the page and then use the previously saved API key to fetch the dropdown options. But when I make the api_key a secure iparam, this doesn’t work:
If api_key is not secure, this works without issues. Is there any way to use a secure iparam for a Request in the installation page?
EDIT: This seems to only affect local testing, it is working fine for deployed apps.
EDIT2: It also seems that I am able to read secure iparams using client.iparams.get() in the installation page, which (as far as I understood) should not be possible anymore. I am using FDK 9.6.0.
Users are inputting the API key in the first input field. In order to make the logic simpler, I decided to only attempt to fetch the values I need for the second field using the API key when loading the page. If I wrote a custom installation page, I probably would have used a “Verify” button or something for the user to submit the API key without exiting the installation page.
The platform version 3.0 does not support the api_key value for the type attribute.
You can update the iparam field attribute values using utility methods. However, the documentation does not mention how to update the options attribute for a dropdown field. Please try the code below; if it still doesn’t work, please proceed with the custom installation page as you mentioned.
My issue is not setting the dropdown options themselves, but fetching the values I want to use as dropdown options. To do that, I need to fetch some data from the Freshservice API, for which I obviously need an API key. And this API key has been saved by the user in the iparam api_key. My problem now is that when using the Request method to fetch the data, it is somehow unable to access the previously saved iparam api_key. And, as I mentioned, this seems to only affect local execution and does not occur after uploading the app to a Freshservice account.