Using WP REST API in Nodejs APP
-
Hi guys,
I’m developping a nodeJS web app using VueJS (and nuxtJS) and I would like to send email using an existing contact form through WP REST API. (Created on the back-office of my wordpress site)
I’m using JWT Authentication for WP REST API and AXIOS for HTTP requests.
This is my request (inside my app) :
axios.post('https://domain-name/wp-json/contact-form-7/v1/contact-forms/ID/feedback', { body: { // Form fields corresponding to CF7 yourName: this.name, yourCompany: this.company, yourEmail: this.email } }, { headers: { Authorization: 'Bearer ' + token, 'Content-Type': 'application/json;charset=UTF-8' } }) .then((res) => { console.log(res.data) })The response has an error message: “one or more fields contain errors…” with the status code : “validation_failed”
I cannot find helpfull documentation about CF7 related to WP Rest API, and I’m not sure how to make “proper” request to do the trick and send the email through my JS app using CF7 & WP REST API.
Thanks for you time and your incoming responses.
Regards- This topic was modified 7 years, 7 months ago by .
- This topic was modified 7 years, 7 months ago by .
- This topic was modified 7 years, 7 months ago by .
- This topic was modified 7 years, 7 months ago by .
- This topic was modified 7 years, 7 months ago by .
- This topic was modified 7 years, 7 months ago by .
The topic ‘Using WP REST API in Nodejs APP’ is closed to new replies.