make.comintegromat-apps

Integromat app with different URL domains


In the "Base" of my app, I have this URL https://api.opsgenie.com/v2. But for Europe, I must use https://api.eu.opsgenie.com/v2. How to let the user choose his region? I think I can delete the URL from the "Base" and add the URL as a parameter for every module. But I hope there is must be better UX?


Solution

  • You can allow users to set the region in the connection and then use the value from the connection.

    Connection parameters:

    [
        {
            "name": "region",
            "label": "Region",
            "type": "select",
            "required": true,
            "options": [
                {
                    "label": "US",
                    "value": "api"
                },
                {
                    "label": "EU",
                    "value": "api.eu"
                }
            ]
        }
    ]
    
    

    Base:

    {
        "baseUrl": "https://{{connection.region}}.opsgenie.com/v2"
    }