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;
}