APIs & Integrations

tmcmillan99
Contributor | Elite Partner
Contributor | Elite Partner

Submit form api assistance

I do not have any experience with APIs so any guidance would be greatly appreciated.

A client has a form in Cognito Forms that we would like to have submissions posted to Hubspot. I set up a form in my developer account to test with first. It's has custom contact properties (in addtion to the standard contact properties) set up to match all of the fields from the 3rd party form.

The only integration option that Cognio Forms has is through their webhook. The form has the following setting that can be turned on:

PostJson-Endpoint.png

 

Is this where I would use the Hubspot form submit api, replacing the 2 ids with the appropriate values? (https://api.hsforms.com/submissions/v3/integration/submit/:portalId/:formGuid

If so, are there any other parameters that I would need to include in the url?

 

Thanks,

Terry McMillan

 

0 Upvotes
6 Replies 6
tmcmillan99
Contributor | Elite Partner
Contributor | Elite Partner

Submit form api assistance

@dennisedson 

I did some more testing over the last few days. I did use the webhooks.site to grab the json that was being presented by Cognito forms. I matched up the internal field values on both sides. I am now able to get a successful submission through the API. However, I am getting No Contact Record and it's not actually bringing in any data.

Will the capitalization of the internal field values in the json file make a difference on the import? All of the Hubspot values are lowercase whereas the Cognito form values are capitalized. Even though I can modify those values, it automatically reverts them back to being capitalized. I have not contacted Cognito about that yet.

 

Thanks,

Terry

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Submit form api assistance

@tmcmillan99 

Submitting with a capital first letter should not affect the submission process....

Are you provided with a success message or errors?

@Teun , @Anton, @Josh   have either of you used this form builder?

0 Upvotes
tmcmillan99
Contributor | Elite Partner
Contributor | Elite Partner

Submit form api assistance

@dennisedson 

The only success message that I see if the one from the form which is the typical "thank you" for your submission message.

I have 4 submissions listed when I look at the form in Hubspot. The first submission is my test using Postman (which did have a success message) and the other 3 are actual submissions from the Cognito form. Is there someplace I can check API messages or errors?

 

Here is what I see when viewing the submission-

form-submission.png

 

 

 

 

 

 

 

 

 

 

 

Hopefully I can get this resolved so we don't have to move the client's form to a different form vendor. 

 

Thanks,

Terry

0 Upvotes
tmcmillan99
Contributor | Elite Partner
Contributor | Elite Partner

Submit form api assistance

More research...I used Postman to look at the form submissions. This is the returned json which is to be expected based on the No Contact Record message.

    "results": [
        {
            "submittedAt": 1645657483989,
            "values": [],
            "pageUrl": null
        },
        {
            "submittedAt": 1645657141174,
            "values": [],
            "pageUrl": null
        },
        {
            "submittedAt": 1645655792240,
            "values": [],
            "pageUrl": null
        },
        {
            "submittedAt": 1645655378407,
            "values": [],
            "pageUrl": null
        }
    ],

 

Could the issue be that json file from Cognito Forms is not formatted in a way for Hubspot to recognize the fields and values? Here part of the json file produced by Cognito:

  "Step2ContactInformation": {
    "Name": {
      "First": "Terry",
      "FirstAndLast": "Terry McMillan",
      "Last": "McMillan",
      "Middle": null,
      "MiddleInitial": null,
      "Prefix": null,
      "Suffix": null
    },
    "Address": {
      "City": "Temple",
      "CityStatePostalCode": "Temple, TX 76502",
      "Country": "United States",
      "FullAddress": "100 S Adams, Temple, TX 76502",
      "FullInternationalAddress": "100 S Adams, Temple, TX 76502, United States",
      "Latitude": null,
      "Line1": "100 S Adams",
      "Line2": null,
      "Line3": null,
      "Longitude": null,
      "PostalCode": "76502",
      "State": "TX",
      "StreetAddress": "100 S Adams",
      "Type": "Home"
    },
    "Email": "jdoe@email.com",
    "Phone": "5558889999",
    "Company": "ABC Company",
    "JobTitle": "CTO",
    "BusinessManager": "Robert"
  },

Thanks,

Terry

0 Upvotes
tmcmillan99
Contributor | Elite Partner
Contributor | Elite Partner

Submit form api assistance

@dennisedson 

Thanks for the reply and info. I had previous ran a test and didn't receive any submissions. As you suggested, I think my next step is reviewing the json that Cognito Forms is producing to make sure my field names are matching correctly. I will post an update after some more testing.

 

Thanks,

Terry

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Submit form api assistance

Hey Terry!

Having never used this forms tool, I am only going to  be able to guess 🤣

On first glance, that looks like the correct place. You will want to make sure the names of the fields are the same as the names of the fields on the corresponding HubSpot form.   Make sure you are getting the internal values for the HubSpot form.  For example, If I have a field property called Favorite Animal, the internal value will probably be favorite_animal

 

If you after you add the Forms URL and you are not getting anything inside of HubSpot, you can check out what json is being sent by using the URL provided on this site
There you will see a unique URL that you can copy and paste into the Submit Entry Endpoint of your forms tool.  Once you submit a form, you should see the data come up on that site.

 

Let us know how it works out!

0 Upvotes