API Form submission with ticket automatically generated

Hi,

Is it possible to send ticket data to a form via api form submission like this :

// Create the new request
 var xhr = new XMLHttpRequest();
 var url = 'https://api.hsforms.com/submissions/v3/integration/submit/id/id // Example request JSON:
 var data = {
 "submittedAt": Date.now(),
 "fields": [
 {
 "name": "email",
 "value": this.email
 },
 {
 "name": "firstname",
 "value": this.firstname
 },
 {
 "name": "lastname",
 "value": this.lastname
 },
 {
 "name": "company",
 "value": this.company
 },
 {
 "name": "jobtitle",
 "value": this.job
 },
 {
 "name": "phone",
 "value": this.formatted_phone
 },
 {
 "name": "TICKET.subject",
 "value": "Contact"
 },
 {
 "name": "TICKET.content",
 "value": this.message
 }
 ],
 "context": {
 "pageUri": "https://spurred.io/contact-us",
 "pageName": "Contact us"
 },
 "legalConsentOptions":{ // Include this object when GDPR options are enabled
 "consent":{
 "consentToProcess": this.process_data,
 "text":"I agree to allow to store and process my personal data.",
 "communications":[
 {
 "value": this.communication,
 "subscriptionTypeId":999,
 "text":"I agree to receive marketing communications from."
 }
 ]
 }
 }
 }

When I try i got this error : “Error in ‘fields.TICKET.content’. Field ‘TICKET.content’ isn’t in form definition”,“errorType”:“FIELD_NOT_IN_FORM_DEFINITION”

Hi @Jrpersico

Currently whilst it is possible to submit submissions and pass some ticket information to your Portal, the Forms API is not designed nor optimised to handle this data and so it would not work as desired.

It is our current recommendation that if you wish to automate ticket actions with Form Data, you use our Forms API and Ticket API together.

I hope this helps!