const { createClient } = require('@typeform/api-client')
const typeformAPI = createClient({ token: 'token' })
var data = {
"value": {"fields":{"title": "First Name", "type": "short_text", "validations": { "required": true }}}
}
//form updation
const res1 = typeformAPI.forms.update({ id: 'hfiBOz3P', data:[data] }).then((response1) => {
console.log("response1 : ", response1)
return response1
}).catch((err) => {
console.log("error: ", err)
})
I am using the upper mention code using in node Js to add an extra field to an existing form, but getting error(”Error: The payload is invalid.”). Help me with correct payload.