This may be poorly understood on my end, so please bear with me. I am not a HubSpot developer, but I have a client who has asked us to integrate their HubSpot forms onto their website that we develop for them. They’ve given my a GUID for each of their forms, as well as an authorization API key, but frankly, they haven’t been very responsive beyond that. With that and the documentation I have available, this is my current process.
- GET to the API to retrieve the form’s JSON data
- Parse the data to manually build a form, all of it’s field elements, and a submit button.
- On submit, parse the fields into request data, and POST to the API.
The first and last bit, I’m not having any trouble with. But it’s the middle step that I’m increasingly uncertain about. The result I’m currently putting together is a rather dull collection of labels and html inputs, with no styling whatsoever. And I keep running into alternate cases I have to handle from the JSON data I’m getting back, which is not going to work well if the client wants to be in control of their forms.
Is there either some commonly available way of building an html form from JSON data that I’m not familiar with, or is there documentation somewhere for using the JSON data to properly build a form manually?