Unable to use secure iparams in iparams.js

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:

{
    "api_key": {
        "display_name": "Freshservice API Key",
        "type": "text",
        "required": true,
        "secure": true
    },
    "excludeCustomFields": {
        "display_name": "Blacklist",
        "description": "...",
        "type": "multiselect",
        "options": [],
        "default_value": []
    }
}

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.

Hi @chrism

From the above code, change the value for the type attribute to “api_key”.

I want to better understand the context here, specifically, how users are storing the API key, and why a page refresh is required.

If you are using iparams.json and iparams.js, you can use the utility methods to set and get iparam values easily

Hello @Kithiyon,

According to the official docs, the iparam type “api_key” should not exist anymore:

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.

Hello @chrism

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.

utils.set(‘excludeCustomFields’, {options: [opt1,opt2,opt3]});

@Thakur_Ganeshsingh inputs please

Hello @Kithiyon,

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.

Hey @chrism

You can get the api_key by using utils.get(‘<iparam_key>’); . Try this and let me know.

Hello @Kithiyon,

This works (already mentioned this in my initial description), but shouldn’t I be unable to fetch secure iparams using utils.get()?

Hello @chrism

You mentioned that client.iparams.get() in your initial description, not utils.get(). For more information, please visit here.