Closed advance512 closed 5 years ago
Makes sense - I'll take a look into this
I've got this added into the latest release 3.2.9
as well - you can now pass the data
kwarg directly into that method, and it will URL Encode automatically for you. I've also added the option to pass context
as a dict in the kwargs, which will automatically json.dumps
the contents and add them to the data before URL Encoding.
This simplifies the above into the following:
form_submission_client.submit_form(
portal_id=config.hubspot.HUBSPOT_PORTAL_ID,
form_guid=form_guid,
data=data, # as a dict, will be url encoded for you
context=context # as a dict, will be json.dumps'd and added into data
)
Let me know if you have any issues with that! I'll close the issue, but feel free to reopen - Thanks for the ideas!
Your quick response here is laudable. Awesome job!! Thank you.
To get the Forms API submission to work, I had to do the following:
I think support for URL Encoding the data makes sense here, this should not be required to be done outside of the class itself. Without this, form submission fails.