Get LGF submission data from Hubspot API

Hello,

Our marketing team recently created an integration between LinkedIn and Hubspot, so that we can see LGF submission data directly in Hubspot :

Is there a way to export this data from Hubspot using the Hubspot API ? I couldn’t find it in the documentation.
Maybe I have to use the LinkedIn API directly ?

Best,

Arnaud

Hi @ArnaudStephan,

Have you tried using the HubSpot Forms API?

There is an endpoint that allows retrieving submissions of a particular form.

https://api.hubapi.com/form-integrations/v1/submissions/forms/:form_guid

Hello @evaldas

It’s the first thing I tried, but those forms are not retrieved via the forms API. I guess it’s because they are created in LinkedIn and then fetched by Hubspot.

Since you can see the “FR_Télécharger_CahierDesCharges” form and the associated submissions in the HubSpot UI, theoretically it should still work.

According to the documentation:

Note: This endpoint can only be used to get submissions for the following form types:

  • HUBSPOT - HubSpot marketing forms
  • FLOW - HubSpot pop-up forms (formally lead flows)
  • CAPTURED - Data collected for non-HubSpot forms

I am guessing your form would be classified as “CAPTURED” and should still qualify.

Have you tried to use the API endpoint with a different form just to make sure you have the API call set up correctly or that it works in your portal in general?

It should work, but this is what I get when trying to call the API :

{“message”:“Submissions can’t be exported for this form.”,“errorType”:“FORM_TYPE_NOT_ALLOWED”,“correlationId”:“0a3f2597-83fb-4c40-b971-ec9a92acd7e4”}

And furthermore, I need the form_guid in order to make the API call. For the regular forms, to get the submissions, I first use the forms endpoint to get a list of all my forms ids, and then I loop on the ids to get the submissions form by form.

But the LGF forms don’t get returned from the forms API. I could find a workaround by looping on them manually, but that would mean having to maintain an up to date list of all our LGF forms.

I see. It’s possible this may fall into a type of form that may not be supported by the API.

Just to double check, when you run this:

https://api.hubapi.com/marketing/v3/forms/{formId}

What value do you see in the “formType” in the reponse?

I get this answer :

{"status":"error","message":"The FormDefinition f38a6749-6359-464a-a3e2-46975863cac0 does not exist.","correlationId":"b23613d2-f859-4be3-9875-09295aeb3c87","context":{"id":["f38a6749-6359-464a-a3e2-46975863cac0"]},"category":"OBJECT_NOT_FOUND"}

I thought maybe I had the wrong ID but no, because if I input a random string I get this :

{"status":"error","message":"The form ID isn't valid. Please check the form ID and try again.","correlationId":"6a197f38-b9bc-45ca-af2f-2736783d29d5","context":{"id":["f38a6-6359-464a-a3e2-46975863cac0"]},"category":"VALIDATION_ERROR","subCategory":"FormError.FORM_ID_INVALID"}

So I guess what I’m trying to do is just not possible.

The first answer means that the form with that ID does not exist.

The second answer means that the form ID has incorrect syntax.

This likely means that currently there isn’t a way to retrieve LGF form submissions through the Forms API.

You could probably utilize the CRM API to retrieve contacts that came through LGF but as I understand that is not what you were looking for.