If we setup a support form to create conversations directly into our support inbox as detailed here: https://www.hubspot.com/product-updates/support-conversations can that form receive submissions via the forms API like a normal HubSpot marketing hub form?
Aug 12, 20192:33 AM - edited Aug 12, 20196:13 PM
Top Contributor
Can support forms be submitted via the forms API?
SOLVE
Went ahead and tested it, and yes, you can submit via the API. Just have to grab the API name for the issue and details fields (which are TICKET.subject and TICKET.content respectively, in case anyone else is wondering)
Aug 12, 20192:33 AM - edited Aug 12, 20196:13 PM
Top Contributor
Can support forms be submitted via the forms API?
SOLVE
Went ahead and tested it, and yes, you can submit via the API. Just have to grab the API name for the issue and details fields (which are TICKET.subject and TICKET.content respectively, in case anyone else is wondering)
@kaious are you using the AJAX method? I've tried submitting these fields as you describe, but I'm still unable to get past validation. If I add "TICKET.subject" to the fieldname I get an "Error in 'fields.TICKET.subject'. Field 'TICKET.subject' isn't in form definition".
I can confirm that the fields TICKET.subject and TICKET.content are only accepted when skipValidation is set to true.
But with skipValidation, the API does not decline invalid email addresses. If I submit an email address like "abcdef", the API responds with status code 200 but has not created a ticket. So te end user submits our custom form, our server receives a status code 200, but the submitted ticket content is lost.
How can I ensure that a ticket has been created or get a failure status code if not?
If it's just email address you want to validate, could you not build the validation on the form directly rather than waiting for the API response? (just a javascript regex validation on field update or something along those lines)
I'm already validating the email address on the form, but I don't know the exact validation algorithm hubspot uses. If for some reason my validation passes but hubspot declines the email address, there is no ticket in hubspot but the end user did not get an error message.
I think if you're ensuring the email address follows the valid pattern for an email address, you'll be pretty safe. Here's something on how HS validates, not sure if it's useful.