I built a small Vue.js app that runs under a subdomain (same main domain as WordPress) and uses the axios package to submit a form to the contact form 7 rest API. Unfortunately I always get only "status: spam" back as a response. I have already set up a recaptcha for the Vue.js app and at the recaptcha of the WordPress on the main page I have also whitelisted the new subdomain.
If I turned off the Recaptcha it works as expected.
const formData = new FormData();
formData.append('customerName', this.formInput.customerName);
formData.append('customerEmail', this.formInput.customerEmail);
formData.append('customerPhonenumber', this.formInput.customerPhonenumber);
formData.append('date', this.formInput.date);
formData.append('privacy', this.formInput.privacy);
axios.post('https://MY_DOMAIN/wp-json/contact-form-7/v1/contact-forms/1347/feedback', formData)
.then((response) => {
console.log(response);
this.result.status = response.data.status;
this.result.message = response.data.message;
if (response.data.status === 'mail_sent') {
this.formInput.customerName = '';
this.formInput.customerEmail = '';
this.formInput.customerPhonenumber = '';
this.formInput.date = '';
this.formInput.privacy = 0;
}
});