How to submit form data via the rest API?

I have tried following the V2 API document ‘entries’ endpoint code for submitting data via the rest API via Javascript but have not been successful. The endpoint /wp-json/gf/v2/entries does not seem to work at all. I can create an entry with blank fields when I use /wp-json/gf/v2/[form-id]/entries. With passing the data, I’ve tried:
const data = { input_values: { '1': 'John Doe', '3': 'john@example.com' } };

and also
const data = { 'form_id' : '76', // the form ID '1': 'John Doe', '3': 'john@example.com' };

But these json objects are not getting results. An entry is created but the fields are blank. Could someone please share code that works for submitted data to a form?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.