Recording data from an external ROI calculator via HubSpot APIs

JWalden
Participant

I’d like to know the process of creating an API that records data from an ROI Calculator (located on an external webpage, following a HS landing page with HS form) against a contact’s timeline. I want to record not only what the contact enters into each field but also their results.

I understand that I can do this through form APIs, but I’m not a developer and would appreciate a ‘how-to’ regarding this integration.

0 Upvotes
3 Replies 3
3PETE
HubSpot Employee

Let’s try and walk through this a little bit then. Your ROI calculator is going to live on a separate server somewhere. The web page hosted by this server should have a form that the end user can input their revenue/cost/etc. Then you can do the math and fill in the last text field in the form for the ROI. When the calculation is completed you will want to make a call to our forms API to submit the form to HS(Make sure you make the form on our end first to receive it). We have examples up on our website that can help depending on which language you are working in. I hope that helps! Let me know if you make any progress or get stuck anywhere.

0 Upvotes
JWalden
Participant

Hi

Thanks so much for your input. I still have a few specific things I’m unclear about, maybe you could help:

  1. when writing the API call, what else should it consist of other than the POST link?
  2. what’s your website address? I want to see the examples you mentioned.
  3. Where exactly should this API call be placed on my external page, at the bottom of the code which calculates the ROI?

Thanks, any help is appreciated.

0 Upvotes
3PETE
HubSpot Employee

Jack,

For the examples I was referring to our API documentation.

API Overview | HubSpot API

The API is built to allow you to create a functional application or integration quickly and easily. We know from experience - these are the APIs that power the HubSpot application. The ecosystem of developers creating integrations on top of the APIs...

That might help answer both questions 1 and 2 for you.

As for question 3. A common way to do this would be to do the math when someone enters the information for both cost and revenue. You could use JQuery’s onChange or blur method as an example of how you could accomplish that part. Then at the top of the form you could use the onSubmit(myCall.php) method and reference the server side file that will hold your API call. So the API call will be on a a server side file where as the math and form would be done on a client side file which the end user sees. The client side file would then call the server side file to make the API call.

Note: you would replace the myCall.php with what ever the name of your file is. The file will get called when some one clicks the submit button at the bottom of the form.

0 Upvotes