Overview
Add support for Clientify v2 API in FormsCRM while maintaining full backwards compatibility with v1. The plugin should automatically detect which API version the user's account uses, so they don't need to reconfigure their form field mappings when the underlying API changes.
Motivation
Clientify v2 introduces a new API with different field structures. Without automatic detection, users would need to manually recreate all their form field mappings after migrating to v2, which is a poor user experience.
Requirements
Automatic version detection
- On credentials validation (
login()), detect whether the account is on Clientify v1 or v2 (e.g. by probing a version-specific endpoint or inspecting the API response).
- Store the detected version (e.g. as a setting or derived at runtime) so subsequent calls (
list_modules, list_fields, create_entry) use the correct API path.
Shared interface
- Both v1 and v2 must implement the same
CRMLIB_Clientify interface: login(), list_modules(), list_fields(), create_entry().
- Consider splitting the implementation into two internal classes (
CRMLIB_Clientify_V1, CRMLIB_Clientify_V2) with a factory/dispatcher in CRMLIB_Clientify that delegates based on the detected version.
Field mapping compatibility
- Existing v1 field mappings saved in the DB must continue to work without requiring the user to remap fields.
- If v2 uses different field keys, add a mapping/translation layer so saved v1 mappings can be applied to v2 payloads transparently.
No UX disruption
- Users already configured on v1 should experience no change.
- Users on v2 should be able to set up and use the integration without any extra steps beyond entering their credentials.
Acceptance Criteria
Related
Closes #174 (Clientify v2 reverted due to 500 errors)
Overview
Add support for Clientify v2 API in FormsCRM while maintaining full backwards compatibility with v1. The plugin should automatically detect which API version the user's account uses, so they don't need to reconfigure their form field mappings when the underlying API changes.
Motivation
Clientify v2 introduces a new API with different field structures. Without automatic detection, users would need to manually recreate all their form field mappings after migrating to v2, which is a poor user experience.
Requirements
Automatic version detection
login()), detect whether the account is on Clientify v1 or v2 (e.g. by probing a version-specific endpoint or inspecting the API response).list_modules,list_fields,create_entry) use the correct API path.Shared interface
CRMLIB_Clientifyinterface:login(),list_modules(),list_fields(),create_entry().CRMLIB_Clientify_V1,CRMLIB_Clientify_V2) with a factory/dispatcher inCRMLIB_Clientifythat delegates based on the detected version.Field mapping compatibility
No UX disruption
Acceptance Criteria
Related
Closes #174 (Clientify v2 reverted due to 500 errors)