I have created a feedback survey, where I am asking a question like “what is your email?” which is a contact property. When I try to retrieve the responses of that survey, it does not the email question’s responses.
Looks like the feedback_submissions endpoint only returns properties found in this properties endpoint:
property_list as you can see below is a dynamic list of all feedback_submission properties along with email which is a ''contact property". Sorry, I should have been more specific there. Please let me know if you have any other questions.
Attached is a snippet of code I am using to get all surveys.
sub_url = "https://api.hubapi.com/crm/v3/objects/feedback_submissions"
prop_url = "https://api.hubapi.com/crm/v3/properties/feedback_submissions"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
}
# Get properties
params = {"archived": False}
response_properties = requests.get(prop_url, headers=headers, params=params)
properties = response_properties.json()
prop_df = pd.DataFrame(properties["results"])
# Get submissions for a specific hs_survey_id in batches
# adding email here in case it survey email question was created using a contact property
properties_list = prop_df["name"].unique().tolist() + ["email"]
sub_list_all = []
params_sub = {
"properties": properties_list,
"limit": 100,
}
while True:
response_submissions = requests.get(sub_url, headers=headers, params=params_sub)
submissions = response_submissions.json()
sub_list = [sub["properties"] for sub in submissions["results"]]
sub_list_all += sub_list
if "paging" in submissions.keys() and "next" in submissions["paging"]:
next_page = submissions["paging"]["next"]["after"]
params_sub["after"] = next_page
if not next_page:
break
else:
break
sub_df_all = pd.DataFrame(sub_list_all)
logger.info(f"Survey Ids found: {sub_df_all.hs_survey_id.unique()}")
The survey creation feature seems to currently be facing some issue where this page is not loading. I can share the snippet where the contact property ‘email’ is being used once this is back running.
Thanks for the extra information regarding your API request.
I can’t seem to create a test survey where it’s possible to use Contact properties (e.g. Email) as a form field
Regardless, what I think you’ll want to consider doing is specifying in your request that you’d like specific Feedback Submission properties and associated Contacts to be returned. For example: