Persist user input parameter to module in custom app

My custom app uses a webhook to receive an event. Then makes a call to an external system to get more information before passing that along in Make. The external call requires the API Key that the user added as a parameter (tried with both the connection parameter and webhook parameter). But my ‘module’ that has type = instant trigger is that thing that actually needs to make the external API call correct? And in which case can’t access the ‘API Key’ parameter from either the connect or webhook input. So how do you make an API call from the module with the API Key?

I’ve tried storing the apiKey in a ‘temp’ variable and as a ‘data’ output from the webhook, but it seems that both of those cases require the apiKey to be handed back in the response of the webhook, but not as an actual user parameter.

So the simple question is, how do you make an API call with a custom app using the ‘Instant Trigger’ type that uses one of the user input parameters?

Here is an example of a call and header that I have tried adding to the module directly, AND have tried to inherit it from base, AND have tried inherit from webhooks AND have tried inherit from connection. And I have switched out the header variable ‘parameters’ to a million different options. I feel like Im just missing something.

“url”: “https://my-api-call-here”,
“method”: “POST”,
“headers”: {
“x-api-key”: “{{parameters.apiKey}}”
},

I feel that I’ve tried EVERYTHING over the last couple days, so unless there is something I don’t know it doesn’t seem possible. And it seems that the module ‘static parameters’ (which would be the obvious path) isn’t supported anymore because adding fields there won’t actually show up on the module interface.

Welcome to the Make community!

If you’re allowing the user to fill in an apiKey field, your webhook should already output the apiKey as a variable so they can map it in this subsequent module.

Thanks! But there is only a single module here. Let me ask this more simply: how do you access a parameter (user input) in either base or an instant trigger module?

For Base to Inherit from a Module’s parameters, see Advanced inheritance | Make Developer Hub

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

@samliew so the webhook would be able to include the parameter in the response something like this?

{
    "response": {
        "data": {
            "apiKey": "{{parameters.apiKey}}"
        }
    }
}

Ok I figured this out. Good news is that the answer is simple, bad news is that for anyone reading I’m not really sure what I did differently to make it work :frowning:

In short, I create a static parameter in the ‘trigger’ module to collect api key from the user. Then simply passed that in the module’s communication:

{
    "url": "/my-endpoint",
    "headers": {
        "x-api-key": "{{parameters.apiKey}}"
    } 
}

This of course assumes that my base has the rest of the api request parameters needed including the base URL. Hope its helpful for someone :slight_smile:

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.