• Hello!
    I am having trouble getting a form to submit using the wp rest API
    Just wish to check if my setup and submission is good!
    I think some fields might be wrong on but still wish to gain any help if anyone can do so.

    So its a VueJs SPA so the form is hooked up via a component I have built.

    I have create the form in wordpress and used the ID, I send to the URL:

    /wp-json/contact-form-7/v1/contact-forms/${formId}/feedback

    So the Data I sent is like so:

    const data = new FormData();
    data.append(‘_wpcf7’, this.$store.state.form_id);
    data.append(‘_wpcf7_version’, ‘4.8’);
    data.append(‘_wpcf7_locale’, ‘en_GB’);
    data.append(‘_wpcf7_container_post’, 2);
    data.append(‘_wpcf7_unit_tag’,’wpcf7-f422-p390-o1′);
    data.append(‘_wpcf7_nonce’,this.nonce);
    data.append(‘youremail’, this.email);
    data.append(‘yourname’, this.name);

    then data gets passed as part of the ajax call (using axios).

    Now I keep getting told the attempt is spam and rejected. I think it is the nonce, but pretty sure it is fine as if I deploy it normally it works.

    Am I using all the fields above correctly?
    Or Do I need to put the data together differently?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Rest API submit form’ is closed to new replies.