{% import '_includes/forms' as forms %} {% import 'verbb-base/_macros' as macros %} {% set displayName = integration.displayName() %} {% set instructions %} ### Step 1. Connect to the {name} API 1. Go to {name} and login to your account. 1. In the main menu, on the top-right, click the **Settings** icon and select **Setup**. 1. In the left-hand sidebar, click on **Apps** → **App Manager**. 1. Click the **New Connected App** button. 1. Fill out all required fields. 1. In the **API (Enable OAuth Settings)** section, tick the **Enable OAuth Settings** checkbox. - In the **Callback URL** field, enter the value from the **Redirect URI** field below. - In the **Selected OAuth Scopes** field, select the following permissions from the list and click **Add** arrow button: - **Manage user data via APIs (api)** - **Access unique user identifiers (openid)** - **Perform requests at any time (refresh_token, offline_access)** 1. Click the **Save** button. 1. Copy the **Consumer Key** from {name} and paste in the **Consumer Key** field below. 1. Copy the **Consumer Secret** from {name} and paste in the **Consumer Secret** field below. 1. Click on the **Manage** button. 1. Click on the **Edit Policies** button. 1. In the **OAuth policies** section: - In the **Permitted Users** field, select **All users may self-authorize**. - In the **IP Relaxation** field, select **Relax IP restrictions**. - In the **Refresh Token Policy** field, select **Refresh token is valid until revoked**. 1. In the **Session Policies** section: - Untick **High assurance session required**. 1. Click the **Save** button. ### Step 2. Test Connection 1. Save this integration. 1. Click on the **Connect** button in the right-hand sidebar. 1. You‘ll be redirected to {name}, where you must approve Formie to access your {name} account. {% endset %}
{{ instructions | t('formie', { name: displayName }) | md }}
{{ macros.proxyField(fieldVariables, 'textField', { readonly: true, label: 'Redirect URI' | t('formie'), instructions: 'Use this URI when setting up your {name} app.' | t('formie'), value: integration.getRedirectUri(), }) }} {% if not craft.app.config.general.allowAdminChanges %} {{ 'Integration settings can only be editable on an environment with `allowAdminChanges` enabled.' | t('formie') | md(inlineOnly=true) }} {% endif %} {{ macros.proxyField(fieldVariables, 'autosuggestField', { label: 'Consumer Key' | t('formie'), instructions: 'Enter your {name} {label} here.' | t('formie'), name: 'clientId', required: true, suggestEnvVars: true, value: integration.settings.clientId ?? '', warning: macros.configWarning('clientId', 'formie'), errors: integration.getErrors('clientId'), }) }} {{ macros.proxyField(fieldVariables, 'autosuggestField', { label: 'Consumer Secret' | t('formie'), instructions: 'Enter your {name} {label} here.' | t('formie'), name: 'clientSecret', required: true, suggestEnvVars: true, value: integration.settings.clientSecret ?? '', warning: macros.configWarning('clientSecret', 'formie'), errors: integration.getErrors('clientSecret'), }) }} {{ macros.proxyField(fieldVariables, 'booleanMenuField', { label: 'Use Sandbox' | t('formie'), instructions: 'Whether to use the {name} sandbox.' | t('formie'), name: 'useSandbox', includeEnvVars: true, value: integration.settings.useSandbox ?? false, warning: macros.configWarning('useSandbox', 'formie'), errors: integration.getErrors('useSandbox'), }) }} {% set useCredentials = integration.settings.useCredentials ?? false %} {{ macros.proxyField(fieldVariables, 'booleanMenuField', { label: 'Use Credentials' | t('formie'), instructions: 'Whether to use the {name} username/password credentials.' | t('formie'), name: 'useCredentials', value: useCredentials, includeEnvVars: true, warning: macros.configWarning('useCredentials', 'formie'), errors: integration.getErrors('useCredentials'), toggle: 'credentials', }) }}
{{ macros.proxyField(fieldVariables, 'autosuggestField', { label: 'Username' | t('formie'), instructions: 'Enter your {name} {label} here.' | t('formie'), name: 'username', suggestEnvVars: true, value: integration.settings.username ?? '', warning: macros.configWarning('username', 'formie'), errors: integration.getErrors('username'), }) }} {{ macros.proxyField(fieldVariables, 'autosuggestField', { label: 'Password' | t('formie'), instructions: 'Enter your {name} {label} here.' | t('formie'), name: 'password', suggestEnvVars: true, value: integration.settings.password ?? '', warning: macros.configWarning('password', 'formie'), errors: integration.getErrors('password'), }) }}