Is there a /submission api endpoint that accepts a json object which can be send to FF and that triggers the Highrise Add On to create a new contact?

By: Victor Labigar | Asked: 09/05/2023
ForumsCategory: How-toIs there a /submission api endpoint that accepts a json object which can be send to FF and that triggers the Highrise Add On to create a new contact?
Victor Labigar asked 8 months ago

I'm curious if there's a solution in FF like some kind of /submissions endpoint just like Gravity Forms has.

Example from GF documentation:

curl --location --request POST 'https://example.com/wp-json/gf/v2/forms/1/submissions' \   --header 'Content-Type: application/json' \ --data-raw '{     "input_1": "value",     "input_2": "another value",     "input_4_3": "first",     "input_4_6": "last" }'  

I have created a custom lead generator tool where users has to answer a few questions and based on the answers a quote on the page gets rendered. Below is out of scope but for the sake of clearity here's an example of the quote that gets generated:

"I'm looking for X in Y in the X, that are A, B in size. The data will be used for our C. Our D budget is €0."

The page is currently build with static form fields in a page template and working with the Gravity Forms API. At the end of the wizard the user sees a form which he/she has to submit, and the rendered quote is with javascript attached to a hidden input that should also be sent to FF.

The input fields are corresponding with the gravity forms fields via the name attribute. On a POST request I send the form data to a submit endpoint and it all works. I'm looking for a similar solution with Formidable Forms. Can somebody help me with this or point me in the right direction?

The crucial thing that I think it's missing is a /submission endpoint that creates a new entry in a form with id X.

Example markup of the last step in the wizard are attached as screenshots.

Attachments
3 Answers
Best Answer
Victor Labigar answered 8 months ago

Got it working. For those who are interested... here's the solution. I needed a way to get all the values of my static form fields and send them with a POST request to the formidable forms API which eventually should trigger the Highrise Add-on that creates a new Contactperson. 1. I created a form in FF with all the required fields.
2. I've installed the Highrise Add-on
3. I've created an Application Password in Wordpress for the Basic Authentication
4. Since I'm developing locally I've installed the WP plugin "WordPress REST API Authentication"
5. In the Highrise add-on you make sure to map the fields accordingly
6. Make a POST request for testing in Postman with the endpoint '/wp-json/frm/v2/entries'and basic auth enabled with your WP username and Application Password.
7. The body data should be json and should at least contains the key "form_id" and the required fields with the field ID as the key and dummy value.Example json:

{ "form_id": 22, "389": "Petrus", "rn4am": "Koblenko", "nymkk": "[email protected]", "yxzk2": "0123456789", "18n89": "Koblenko BV", "5o8gx": "Value xyz", "394": "Additional notes here as type of text", "l395y": "a", "9kyfh": "b", "9bact": "c", "fj5ii": "d", "9r2x2": "e", "zal19": "f", "9pkpa": "g", "u1h2e": "h", "bicb3": "i", "x470b": "j", "2uqol": "k", "17a3t": "l", "hzstd": "m", "ec2ja": "n", "tpbqe": "o" }  

 Important to know, if you want to have access to the admin-ajax.php in your frontend you have to define such variable yourself.   wp_register_script('sage/main.js', asset_path('scripts/main.js'), ['jquery'], null, true);wp_localize_script('sage/main.js', 'ajax_params', ['ajax_url' => admin_url('admin-ajax.php')] ); wp_enqueue_script('sage/main.js' );

Victor Font answered 8 months ago
That seems to be a lot of extra work when the Highrise Add-on does this for you. https://formidableforms.com/knowledgebase/formidable-highrise/. The Highrise add-on is available with Plus licenses or higher. https://formidableforms.com/pricing/
Victor Labigar replied 8 months ago

I've access to the Pro plugin. The point is that my form fields are static/hardcoded. And due to the design requirements I'm not able to build it with the FF Pro plugin. So using FF shortcodes is not an option for me.

Victor Font replied 8 months ago

If you can't use Formidable to create a new form that's not static, then you need to research two things: the Formidable Webhooks API add-on that provides you with REST endpoints that may suit the need, but it won't trigger the HighRise add-on to create the new entry in the CRM. https://formidableforms.com/knowledgebase/formidable-api/

The other thing to research is building your own endpoint with the WordPress REST API. https://developer.wordpress.org/rest-api/

Victor Labigar replied 8 months ago

Thanks for reply @Victor Font.

The latter option seems the way to go for my purpose. But curious why FF doesn't have a similar endpoint as GravityForms has? Isn't that a must have feature? Is it possible to submit features that the dev team will look into?

Victor Labigar replied 8 months ago

Can you explain in short what steps are required to build my own endpoint that corresponds with Highrise CMS?

Victor Font replied 8 months ago

I just looked at the source code image you provided. You can do the same exact thing with Formidable that you are doing with GF. That code is nothing more than a PHP function used as a callback for an AJAX request made by your static form.

The URL you would use is yoursite.com/wp-json/frm/v2/entries. Everything else would remain the same. You need to use the Webhooks API add-on. You've already got the code, you just need to make it work with Formidable.

Victor Labigar replied 8 months ago

Thanks for your response andyou're right! I've succeeded to make a POST request with Postman. The entry is now captured by FF and Highrise CMS.

The only thing that i need to figure out is which add_action hook i need to use? The documentation isn't really clear to me.

Same goes for the endpoint that you've mentioned. I would expect an example of how the body data request should look like, which parameters such like "form_id" are required.

Nevertheless I'm very happy that it's possible with FF! 🙂

Victor Labigar replied 8 months ago

@Victor Font got it working now!

Victor Labigar answered 8 months ago
Screenshots of my code, since the code snippets aren't working here.  
Attachments

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right