How to switch form data submission from InfusionSoft to HubSpot integration

I’m working on a form in my CMS application that currently sends data to InfusionSoft. Now I need to change it so it submits to HubSpot instead. I’ve been looking through the HubSpot API docs but can’t find clear examples for this type of migration. Does anyone have experience with this kind of switch or know where I can find better documentation?

Here’s my current form model:

public class UserRegistrationModel {

    [StringLength(40), Required, Display(Name = "Given Name")]
    public string GivenName { get; set; }

    [StringLength(40), Required, Display(Name = "Family Name")]
    public string FamilyName { get; set; }

    [StringLength(40), Required, Display(Name = "Position")]
    public string Position { get; set; }

    [Display(Name = "opt_regional_data")]
    public bool Regional_Data { get; set; }

    [Display(Name = "opt_financial_analysis")]
    public bool Financial_Analysis { get; set; }
}

And here’s how I handle the submission in my controller:

[HttpPost, Themed]
public ActionResult ProcessRegistration(UserRegistrationModel userData) {    
    // Prepare form data collection
    NameValueCollection submissionData = new NameValueCollection();
    submissionData["form_id"] = formIdentifier;
    submissionData["form_type"] = formCategory;
    submissionData["api_version"] = apiVersion;
}

Did this same migration 6 months ago - the biggest gotcha was how different HubSpot’s contact properties work vs InfusionSoft. You’ll need HubSpot’s Contacts API, not form submissions. HubSpot wants each property wrapped in a properties object, so ditch the NameValueCollection and use JSON serialization instead. Map your fields to HubSpot’s contact properties first - you might need to create custom properties in your portal before the API calls work. Auth is bearer token based, not key-based like InfusionSoft. Test with a few sample contacts first because the error messages suck when property mapping breaks.

just switched from infusionsoft to hubspot last month. use /crm/v3/objects/contacts - it’s way simpler than the forms api. ditch the NameValueCollection and go with straight json using HttpClient. hubspot uses different field names, so map givenname to firstname, familyname to lastname, etc. their sandbox’s solid for testing before you mess up production.