Configuration Options

About Configuration Options

Configuration Options are the form fields that you can present to your users when they configure your adapter within a Flow Setup. They let you collect setup information from your users which will be sent to you with every call to your webhook.

Use cases for configuration options include:

  • Capture authentication details so you know who is submitting the webhook
  • Conversion tables for fields like mode, unit of measure, container size, etc
  • Flags to alter how your webhook responds based on different customer needs

Submitting Configuration Options

When you register your adapter, you can provide a configuration_options array to the Create Adapter or Update Adapter endpoints.

{
  // other adapter fields go here
  "configuration_options": [
    {
      "name": "customerNumber",
      "label": "Customer Number",
      "support_url": "https://docs.co2-co.sample/help#customerNumber",
      "description": "Your CO2-Co customer number",
      "config_type": "regex",
      "required": false,
      "regex_config": {
        "regex": "^[0-9]{5}$",
        "regex_error": "Your customer number must be exactly 5 digits."
      }
    },
    {
      "name": "customerSecret",
      "label": "Secret Key",
      "support_url": "https://docs.co2-co.sample/help#customerSecret",
      "description": "Your CO2-Co shared secret",
      "config_type": "password"
    }
  ]
}

Configuration Types

Use the configType to indicate the input type that the user should see. The table below explains the input types, how they will appear to the user, and the additional configuration details you must provide.

Config Type

HTML Input Type

Required Configuration Attribute

Notes

string

Text

n/a

Standard text input

password

Password

n/a

Same as string except values will be masked like *****

regex

Text

regex_config

Same as string except values are validated against the regular expression you provide in the regex attribute and the user sees the error you provide as regexError if the validation fails.

number

Number

number_config

Accepts min, max, and step attributes as defined by the HTML5 Number type.

list

Select

list_config

Accepts an options array property that contains objects with label and value keys. If you only provide value attributes, then the user will see these values in the dropdown. If you provide both value and label attributes, then the user will see the labels and you will receive the values in your webhook.

boolean

Checkbox

n/a

table

Table

table_config

Creates a table where the user can add/remove rows. You provide a columns array which defines the table columns. Each element in the columns array should be a configuration option object.

You cannot nest tables within other tables.