- Creating and Publishing a Form
- Instant Forms
- Conversational Form
- Create Multi Step Forms In WordPress
- Using Calculations in SureForms: A Step-by-Step Guide
- Calculation Formula Guide
- SureForms Login Block – Step-by-Step Guide
- SureForms Registration Block – Step-by-Step Guide
- SureForms – PDF Generation Feature
- GDPR Compliant Forms
- SureForms Integration with ActiveCampaign
- SureForms Integration with AgileCRM
- SureForms Integration with Airtable
- SureForms Integration with LatePoint
- SureForms Integration with FluentCRM
- Connect SureForms To Zapier
- Automate WordPress Forms with the Custom App Builder
- SureForms Integration with Telegram
- SureForms Integration with Breeze
- SureForms Integration with Brevo
- Unable to Upload SureForms ZIP: File Unzipped On Download
- Browser Support for SureForms
- Not Getting Update Notifications
- How To Rollback to Previous SureForms Versions
- Publishing Failed: Invalid JSON Response
- Troubleshooting Email Sending In SureForms
- SureForm Submissions Marked as Spam – How to Fix
- API Request Failed – Nonce Verification Error
- Fixing the “Destination folder already exists” Error When Installing SureForms
- How to Set Up SureForms with Caching Plugins
- srfm_enable_redirect_activation
- sureforms_plugin_action_links
- srfm_quick_sidebar_allowed_blocks
- srfm_integrated_plugins
- srfm_suretriggers_integration_data_filter
- srfm_form_submit_response
- srfm_enable_gutenberg_post_types
- srfm_languages_directory
- srfm_form_template
- srfm_disable_nps_survey
SureForms Pro Native Integrations – Developer Guide (API Based)
Overview
SureForms Pro Native Integrations system lets you create custom integrations with third-party services using JSON configuration.
Key Features
JSON-only configuration – no PHP coding needed.
Multiple auth types – API key, Bearer token, Basic auth.
Dynamic dropdowns – populate from external APIs.
Field dependencies – chain API calls together.
Data transformation – format data for target APIs.
Quick Start Tutorial
Use the available WordPress hook “srfm_pro_native_integrations_json_configs” provided by SureForms to add your integration – this is what we’ll focus on in this tutorial.
Step-by-Step Integration Creation
Step 1: Create the Integration Metadata
Start by defining your service’s basic information:
// In your plugin's initialization file
add_filter('srfm_pro_native_integrations_json_configs', 'add_my_custom_integration');
function add_my_custom_integration($json_configs) {
$my_integration = [
'integrations' => [
[
'integration' => [
'name' => 'My Service',
'icon' => 'https://myservice.com/icon.svg',
'website_url' => 'https://myservice.com',
'docs_url' => 'https://docs.myservice.com/api',
'category' => 'CRM',
'description' => 'Sync contacts with My Service'
],
'provider' => 'generic', // Always use 'generic' for JSON-based integrations
// We'll add auth and actions in the next steps...
]
]
];
json_configs[] = json_encode(my_integration);
return $json_configs;
}Step 2: Add Authentication
Choose your authentication method (most Services use one of these three):
Option A: API Key Authentication (Most Common)
'auth' => [
'type' => 'api_key',
'fields' => [
[
'key' => 'api_key',
'label' => 'API Key',
'type' => 'password', // Hides the key
'required' => true,
'placeholder' => 'Enter your API key',
'description' => 'Find this in your account settings'
]
],
'headers' => [
'Authorization' => 'Bearer {{api_key}}', // How to send the key
'Content-Type' => 'application/json'
],
'test_endpoint' => [
'url' => 'https://api.myservice.com/user', // Simple endpoint to test connection
'method' => 'GET',
'success_criteria' => [
'status_code' => 200
]
]
],Option B: Bearer Token Authentication
'auth' => [
'type' => 'bearer',
'fields' => [
[
'key' => 'token',
'label' => 'Access Key',
'type' => 'password', // Hides the token
'required' => true,
'placeholder' => 'Enter your access token',
'description' => 'Find this in your app settings'
]
],
'headers' => [
'Authorization' => 'Bearer {{token}}', // How to send the token
'Content-Type' => 'application/json'
],
'test_endpoint' => [
'url' => 'https://api.myservice.com/user', // Simple endpoint to test connection
'method' => 'GET',
'success_criteria' => [
'status_code' => 200
]
]
],Option C: Basic Authentication
'auth' => [
'type' => 'basic_auth',
'fields' => [
[
'key' => 'username',
'label' => 'Username',
'type' => 'text',
'required' => true
],
[
'key' => 'password',
'label' => 'Password',
'type' => 'password',
'required' => true
]
],
'headers' => [
'Authorization' => 'Basic {{base64(username:password)}}',
'Content-Type' => 'application/json'
],
'test_endpoint' => [
'url' => 'https://api.myservice.com/auth/test',
'method' => 'GET',
'success_criteria' => [
'status_code' => 200
]
]
],Step 3: Create Your First Action
An “action” is what happens when a form is submitted (like “Add Contact” or “Create Task”):
'actions' => [
[
'name' => 'Add Contact', // Action name shown to users
'description' => 'Add a new contact to My Service', // Brief description
'provider' => 'generic',
'endpoint' => [
'url' => 'https://api.myservice.com/contacts', // API endpoint
'method' => 'POST', // HTTP method
'headers' => [
'Authorization' => 'Bearer {{api_key}}', // Use the auth from Step 2
'Content-Type' => 'application/json'
],
'payload_type' => 'json' // Send data as JSON
],
'fields' => [
// We'll add fields in Step 4...
]
]
]
Step 4: Add Fields
Define what data to collect from the form to map with the action. This field’s object will go in the actions object. These fields will be visible in the Single Form Settings workflow creation, from where you can map them with the form fields.
'fields' => [
[
'key' => 'name', // Field identifier
'label' => 'Full Name', // Label shown to users
'type' => 'text', // Input type
'required' => true, // Is this field required?
'placeholder' => 'Enter contact name',
'description' => 'The contact\'s full name'
],
[
'key' => 'email',
'label' => 'Email Address',
'type' => 'email',
'required' => true,
'placeholder' => '[email protected]'
],
[
'key' => 'status',
'label' => 'Contact Status',
'type' => 'dropdown',
'options' => [
['label' => 'Active', 'value' => 'active'],
['label' => 'Inactive', 'value' => 'inactive']
],
'default' => 'active'
]
]
Dynamic Fields (Advanced)
Dynamic fields populate their options by calling external APIs.
Simple Dynamic Dropdown
[
'key' => 'list_id',
'label' => 'Select List',
'type' => 'select-async', // Options loaded from API
'required' => true,
'placeholder' => 'Choose a list'
],
// Add this to your action configuration:
'apis' => [
'lists' => [
'url' => 'https://api.myservice.com/lists',
'method' => 'GET',
'headers' => [
'Authorization' => 'Bearer {{api_key}}'
],
'response_type' => 'select_options',
'map' => [
'data' => 'lists', // Array path in API response
'label' => 'name', // Display this to user
'value' => 'id' // Store this value
],
'target_fields' => ['list_id'] // Populate this field
]
]How it works:
- User opens the dropdown
- System calls your API
- API response gets mapped to dropdown options
- User sees the list names, but the list IDs are stored
Your complete integration should look like this. Complete Basic Example:
function add_brevo_integration($json_configs) {
$my_integration = [
'integrations' => [
[
// Step 1: Integration Metadata
'integration' => [
'name' => 'My Service',
'icon' => 'https://myservice.com/icon.svg',
'website_url' => 'https://myservice.com',
'docs_url' => 'https://docs.myservice.com/api',
'category' => 'CRM',
'description' => 'Sync contacts with My Service'
],
'provider' => 'generic',
// Step 2: Authentication
'auth' => [
'type' => 'api_key',
'fields' => [
[
'key' => 'api_key',
'label' => 'API Key',
'type' => 'password',
'required' => true,
'placeholder' => 'Enter your API key',
'description' => 'Find this in your account settings'
]
],
'headers' => [
'Authorization' => 'Bearer {{api_key}}',
'Content-Type' => 'application/json'
],
'test_endpoint' => [
'url' => 'https://api.myservice.com/user',
'method' => 'GET',
'success_criteria' => [
'status_code' => 200
]
]
],
// Step 3 & 4: Actions and Fields
'actions' => [
[
'name' => 'Add Contact',
'description' => 'Add a new contact to My Service',
'provider' => 'generic',
'endpoint' => [
'url' => 'https://api.myservice.com/contacts',
'method' => 'POST',
'headers' => [
'Authorization' => 'Bearer {{api_key}}',
'Content-Type' => 'application/json'
],
'payload_type' => 'json'
],
'fields' => [
[
'key' => 'name',
'label' => 'Full Name',
'type' => 'text',
'required' => true
],
[
'key' => 'email',
'label' => 'Email Address',
'type' => 'email',
'required' => true
]
]
]
]
]
]
];
json_configs[] = json_encode(my_integration);
return $json_configs;
}Advanced Features
Field Dependencies
Make one field depend on another (like “Select Folder” then “Select List in Folder”):
'fields' => [
[
'key' => 'folder_id',
'label' => 'Select Folder',
'type' => 'select-async',
'exclude_from_payload' => true // Don't send this to the API
],
[
'key' => 'list_id',
'label' => 'Select List',
'type' => 'select-async',
'dependent_on' => 'folder_id', // Only load after folder is selected
'placeholder' => 'First select a folder'
]
],
'apis' => [
'folders' => [
'url' => 'https://api.myservice.com/folders',
'target_fields' => ['folder_id'],
'dependencies' => [] // Loads immediately
],
'lists' => [
'url' => 'https://api.myservice.com/folders/{{folder_id}}/lists', // Uses selected folder
'target_fields' => ['list_id'],
'dependencies' => ['folder_id'] // Waits for folder selection
]
]Data Transformation
Your form data needs to be restructured before sending to the API. Here are the available transformation types:
- Nested Object Creation
Group multiple fields into a nested object structure:
'payload_transformation' => [
'enabled' => true,
'transformations' => [
[
'type' => 'nested_object',
'target' => 'custom_fields', // Group fields under this key
'source_pattern' => '*', // Include all fields
'exclude_fields' => ['email', 'name'] // Except these main fields
]
]
]
Before: {“email”: “[email protected]”, “name”: “John”, “company”: “Acme”, “phone”: “555-0123”}
After: {“email”: “[email protected]”, “name”: “John”, “custom_fields”: {“company”: “Acme”, “phone”: “555-0123”}}
- Array Conversion
Convert comma-separated strings or single values into arrays:
[
'type' => 'array_conversion',
'field' => 'tags', // Source field
'target' => 'tag_list', // Target field (optional)
'delimiter' => ',', // String delimiter
'description' => 'Convert comma-separated tags to array'
]Before: “tag1, tag2, tag3” → After: [“tag1”, “tag2”, “tag3”]
- Tag Array Conversion
Convert simple tags into complex tag objects with metadata:
[
'type' => 'tag_array_conversion',
'source_field' => 'tags', // Source field with tags
'target_structure' => 'tags', // Target array name
'tag_format' => [ // Template for each tag object
'name' => '{{tag_name}}',
'status' => 'active'
]
]Before: “tag1,tag2” → After: [{“name”: “tag1”, “status”: “active”}, {“name”: “tag2”, “status”: “active”}]
- Field Format Transformations
Apply formatting rules to specific fields (dates, strings, etc.):
[
'type' => 'field_format',
'field_rules' => [
[
'fields' => ['BIRTHDAY', 'DOB', '*BIRTHDAY*'], // Field patterns to match
'format_type' => 'date', // Type of formatting
'input_formats' => ['Y-m-d', 'm/d/Y', 'd/m/Y'], // Accepted input formats
'output_format' => 'm/d', // Required output format
'validation_regex' => '^\\d{1,2}\\/\\d{1,2}$' // Validation pattern
]
]
]Supported Format Types: date, string, number.
- Structure Conversion
Transform simple fields into complex nested structures with auto-detection:
[
'type' => 'structure_conversion',
'conversions' => [
[
'fields' => ['ADDRESS', '*ADDRESS*'], // Fields to transform
'target_structure' => [ // Target structure template
'addr1' => '{{auto_detect_original:addr1}}',
'city' => '{{auto_detect_original:city}}',
'state' => '{{auto_detect_original:state}}',
'zip' => '{{auto_detect_original:zip}}'
],
'use_original_form_data' => true, // Use original form field names
'auto_detect' => [ // Auto-detection patterns
'addr1' => ['address-line-1', 'street-address', 'street'],
'city' => ['city', 'town'],
'state' => ['state', 'province', 'region'],
'zip' => ['zip', 'postal-code', 'postcode']
],
'fallback_to_field_value' => true // Use field value if detection fails
]
]
]- Conditional Field Addition
You can combine multiple transformation types in a single configuration:
'payload_transformation' => [
'enabled' => true,
'transformations' => [
[
'type' => 'array_conversion',
'field' => 'tags',
'delimiter' => ','
],
[
'type' => 'nested_object',
'target' => 'merge_fields',
'source_pattern' => '*',
'exclude_fields' => ['email', 'list_id', 'tags']
]
]
]Advanced: URL Processing
Some APIs (like Mailchimp) need dynamic URLs based on your credentials:
'test_endpoint' => [
'url' => 'https://{{datacenter}}.api.mailchimp.com/3.0/',
'url_processing' => [
'datacenter_extraction' => [
'enabled' => true,
'source_field' => 'api_key', // Extract from this field
'pattern' => '-([a-z0-9]+)$', // Regex to find datacenter
'replacement_token' => '{{datacenter}}' // Replace this in URL
]
]
]Example: In the API key abc123-us1 datacenter is us1, so URL becomes https://us1.api.mailchimp.com/3.0/
Field Types Reference
Basic Field Types
| Type | Purpose | Example |
| text | Simple text input | Name, address |
| Email with validation | Email address | |
| password | Hidden text input | API keys, passwords |
| number | Numeric input | Age, quantity |
| textarea | Multi-line text | Description, notes |
| dropdown | Static options | Status, priority |
| select-async | Dynamic single-select | Choose one list |
| multi-select-async | Dynamic multi-select | Choose multiple tags |
Static Dropdown Example
[
'key' => 'priority',
'label' => 'Priority Level',
'type' => 'dropdown',
'options' => [
['label' => 'High', 'value' => 'high'],
['label' => 'Medium', 'value' => 'medium'],
['label' => 'Low', 'value' => 'low']
],
'default' => 'medium'
]Common Questions
Integration Loading Process
Third-Party Integrations: Added via WordPress hooks
- Use the srfm_pro_native_integrations_json_configs filter
Must include the integrations wrapper array in the JSON structure
Brevo Integration Complete Example
function add_brevo_integration($json_configs) {
$integration = [
'integrations' => [
[
'integration' => [
'name' => 'Brevo',
'icon' => 'https://cdn.brandfetch.io/idiSi980wS/w/1000/h/1000/theme/dark/icon.jpeg',
'website_url' => 'https://brevo.com',
'docs_url' => 'https://developers.brevo.com/reference/getting-started-1',
'category' => 'Email Marketing',
'description' => 'Add and manage contacts in Brevo'
],
'provider' => 'generic',
'auth' => [
'type' => 'api_key',
'fields' => [
[
'key' => 'api_key',
'label' => 'API Key',
'type' => 'password',
'required' => true,
'placeholder' => 'Enter your Brevo API key',
'description' => 'Copy your API v3 key from the SMTP & API page'
]
],
'headers' => [
'api-key' => '{{api_key}}',
'Content-Type' => 'application/json'
],
'test_endpoint' => [
'url' => 'https://api.brevo.com/v3/account',
'method' => 'GET',
'success_criteria' => [
'status_code' => 200
]
]
],
'actions' => [
[
'name' => 'Add/Update Contact',
'description' => 'Add a new contact or update an existing contact in Brevo',
'provider' => 'generic',
'endpoint' => [
'url' => 'https://api.brevo.com/v3/contacts',
'method' => 'POST',
'headers' => [
'Content-Type' => 'application/json',
'api-key' => '{{api_key}}'
],
'payload_type' => 'json'
],
'fields' => [
[
'key' => 'email',
'label' => 'User Email',
'type' => 'text',
'required' => true,
'placeholder' => '[email protected]',
'description' => 'If the contact already exists, it will be updated.'
],
[
'key' => 'folder',
'label' => 'Select Folder',
'type' => 'select-async',
'required' => true,
'placeholder' => 'Select a folder',
'exclude_from_payload' => true // UI-only field
],
[
'key' => 'select_list',
'label' => 'Select List',
'type' => 'select-async',
'required' => true,
'placeholder' => 'Select a list',
'dependent_on' => 'folder' // Depends on folder selection
]
],
'apis' => [
'folders' => [
'url' => 'https://api.brevo.com/v3/contacts/folders',
'method' => 'GET',
'headers' => [
'api-key' => '{{api_key}}',
'Content-Type' => 'application/json'
],
'response_type' => 'select_options',
'map' => [
'data' => 'folders',
'label' => 'name',
'value' => 'id'
],
'target_fields' => ['folder'],
'dependencies' => [] // Loads immediately
],
'lists' => [
'url' => 'https://api.brevo.com/v3/contacts/folders/{{folder}}/lists',
'method' => 'GET',
'headers' => [
'api-key' => '{{api_key}}',
'Content-Type' => 'application/json'
],
'response_type' => 'select_options',
'map' => [
'data' => 'lists',
'label' => 'name',
'value' => 'id'
],
'target_fields' => ['select_list'],
'dependencies' => ['folder'] // Waits for folder selection
]
],
'payload_transformation' => [
'enabled' => true,
'transformations' => [
[
'type' => 'nested_object',
'target' => 'attributes',
'source_pattern' => '*',
'exclude_fields' => ['email', 'folder', 'select_list']
],
[
'type' => 'array_conversion',
'field' => 'select_list',
'target' => 'listIds'
]
]
]
]
]
]
]
];
json_configs[] = json_encode(integration);
return $json_configs;
}We don't respond to the article feedback, we use it to improve our support content.