1

The word press website I am creating involves quite a lot of form filling. I've tried using a ninja forms and contact-form-7 and I want to fetch my form submissions through REST API. But ninja forms just doesn't have much documentation for this and contact-form-7 gives me an error:

http://localhost/wordpress/wp-json/contact-form-7/v1/contact-forms

ERROR

{
    "code": "wpcf7_forbidden",
    "message": "You are not allowed to access contact forms.",
    "data": {
        "status": 403
    }
}

How should I go about this? Is there any way to use REST API for form data on wordpress? If anyone could point me in the right direction I would be so thankful

1
  • Your CF7 error can be resolved by authenticating as a valid user.
    – radscheit
    Feb 16, 2020 at 15:06

1 Answer 1

1

Contact Form 7 (<=5.1.4) does not store any submission data in the database. I've tested Contact Form CFDB7 (<=1.2.4.8), Contact Form Entries (<=1.0.8), Flamingo (<=2.1) add-ons for Contact Form 7 and none of those provide Rest API endpoints to collect form submission data ether.

Ninja Forms (<=3.4.21) does not expose any Rest API endpoints.

You have couple options at this point:

  • Submit a request to CF7 or/and Ninja Forms developers requesting a feature.
  • Look for existing plugin / extension that does this (free or premium).
  • Implement Rest API yourself. It's not very complicated and can be implemented as separate plugin. You will not have to modify CF7/Ninja Forms plugins to make it work. Here is WordPress documentation: https://developer.wordpress.org/rest-api/extending-the-rest-api/
1
  • Pretty much what I am doing. These form plugins only provide visual interface help and nothing more Nov 12, 2019 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.