Issues sending a submission to Form v3 API

Hi there,
Currently having an issue that I can’t figure out when trying to submit a form via API.
The error I’m getting is:

{"status":"error","message":"Invalid input JSON on line 1, column 360: Cannot build FormSubmissionValue, some of required attributes are not set [value]","correlationId":"13c95bdd-831a-4131-91c8-0b8dcfa4e552"}

I have a console.log() to confirm that the object values are printing appropriately, which they are. My request, as far as I can tell, follows the requirements found in the docs:

let data = {
 "fields": [
 {
 "name": "company",
 "value": contact.company, 
 },
 {
 "name": "firstname",
 "value": contact.firstname,
 },
 {
 "name": "lastname",
 "value": contact.lastname, 
 },
 {
 "name": "email",
 "value": contact.email,

 },
 {
 "name": "phone",
 "value": contact.phone,

 },
 {
 "name": "purchase_order_number",
 "value": contact.purchase_order_number,

 },
 {
 "name": "notes_",
 "value": contact.notes_,

 },
 {
 "name": "repair_return_address_line_1_",
 "value": contact.repair_return_address_line_1,

 },
 {
 "name": "city",
 "value": contact.city,

 },
 {
 "name": "state",
 "value": contact.state,

 },
 {
 "name": "zip",
 "value": contact.zip,

 },
 {
 "name": "country",
 "value": contact.country,

 },
 {
 "name": "check_this_box_for_expedited_service_fees_apply_see_below_",
 "value": contact.check_this_box_for_expedited_service_fees_apply_see_below_,

 },
 {
 "name": "contact_typefinal",
 "value": "Provider",

 },
 {
 "name": "serial_number_2",
 "value": firstObj.serial_number,

 },
 {
 "name": "subject",
 "value": contact.company,

 },
 {
 "name": "part_number",
 "value": firstObj.part_number,

 },
 {
 "name": "initial_repair_reason_",
 "value": firstObj.initial_repair_reason,

 },
 {
 "name": "content",
 "value": firstObj.subject,

 }

 ],"legalConsentOptions":{ 
 "consent":{
 "consentToProcess":true,
 "text":"I agree to allow blank to store and process my personal data.",
 "communications":[
 {
 "value":true,
 "subscriptionTypeId":999,
 "text":"I agree to receive marketing communications from Example Company."
 }
 ]
 }
 }
}
var finalData = JSON.stringify(data)
var options = {
 method: 'POST',
 url: 'https://api.hsforms.com/submissions/v3/integration/submit/OMITTED/4e1e28f2-0844-4d58-a5f1-499a46e699f9',
 headers: {'content-type': 'application/json'},
 body: finalData
 };

 console.log(options)

 request(options, function (error, response, body) {
 if (error) throw new Error(error);
 console.log(body);
 });

@nikodev ,

Did you get this figured out? At first glance, I am not seeing any issues. @tjoyce , do you see anything?

@dennisedson Thanks for taking a look. There was definietely something very strange and buggy going on, I ended up going down a different path for my submission, using the contact and tickets APIs, respectively.
After commenting each object, one by one, getting rid of the “notes_” object allowed me to make the submission. After putting it back in there…I started getting a different error. It was telling me that the form didn’t have a field for that particular property, which, after checking 20 times, wasn’t the case. Fun stuff.
It’s over now.

Keeping life interesting :upside_down_face: