Issue in submitting form via V3 api

I was using submit form to add new contact to my hubspot contacts using javascript code and i was getting error as

Blockquote

{“status”:“error”,“message”:“Invalid input JSON on line 1, column 33: Cannot build FormSubmissionValue, some of required attributes are not set [name, value]”,“correlationId”:“4e91576b-fc91-4444-8637-275946ad37ad”,“requestId”:“257d66998300805f1914cd28e4560c1f”}

Blockquote

this was my request body for post request
{“fields”:[{“firstname”:“rakesh”},{“lastname”:“chauhan”},{“email":"rakesh376@gmail.com”},{“primary_industry_type”:“Automotive”}]}

[

request1.PNG1709×887 79.9 KB

](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/7/764f2d1882908bde4dbb1451311c842fbb7b7c17.png)

Hi @rakesh.chauhan, it doesn’t look like the way you’re formatting your body is correct. The docs state your fields should be formatted like so:

"fields": [
 {
 "name": "email",
 "value": "example@example.com"
 },
 {
 "name": "lastname",
 "value": "Example Lastname"
 },
 {
 "name":"multiple_checkbox_property",
 "value":"option_1;option2"
 },
 {
 "name":"date_property",
 "value":1520985600000
 },
 {
 "name":"checkbox_property",
 "value":"true"
 }
 ]

From your example, you’re missing the name property for each value you provide. I created a simple Repl here: https://repl.it/@cbarley10/DefensiveBeigeRuntimes in NodeJS for a Form Submission using the v3 API. I’d recommend emulating the example there if you can! Or please use the example in the sidebar.