Creating a form with the REST API
-
I am trying to use angularJS and wp rest api to create a ContactForm7 form in the backend.
But when i go to ContactForm7 admin there is no post created. Is there something i’m missing? Is this even posible?
$scope.asdfg = function(){ $http({ url:'/wp-json/contact-form-7/v1/contact-forms', method:'POST', data: { title: "asda", locale: "en_EN", mail:{ active: true, subject: "bla bla bla", sender: "[email protected]", recipient: "[email protected]", body:"body goes here" }, properties: { form: "<label> Your Name (required)\n [text* your-name] </label>\n\n<label> Your Email (required)\n [email* your-email] </label>\n\n<label> Subject\n [text your-subject] </label>\n\n<label> Your Message\n [textarea your-message] </label>\n\n[submit \"Send\"]", }, } }).then(function(response){ $scope.contactFormCreate = response.data; console.log($scope.contactFormCreate); }, function errorCallback(response){ $scope.err = response; console.log($scope.err); }) }
- The topic ‘Creating a form with the REST API’ is closed to new replies.