Hi I am currently designing a quoting form. this happens in 2 parts.
for the first part the user clicks a link which redirects them to an external site to complete the first part of the quote (this is working fine using the wixLocation.to() method.)
The second part requires the first part of the quote (from the external site) to be returned so that the quote can completed on our site.
Looking through the documentation I cannot see a way to post data to a page. the data that is returned is a JSON object so once it is returned I will be adding it to a data collection (the easy bit).
I assume that the external site allows you to configure a redirect to a page (otherwise, how does it know where to redirect you to?).
If that is the case, can you try using query parameters at the page - it is possible with wixLocation.query .
when I send the user to the external site I specify a callback url (where the post data gets set) the site sends the JSON object to the callback URL using the post method, so there will be nothing in the query parameters in the url. so is it possible for wix pages to handle Post Requests?
Yes, it is possible to expose your site’s functionality as an API using http-functions .
In general the process should be as follows:
Form is submitted on the external site, a post request is sent to the exposed http-function on your Wix site.
The function digests the received data and stores it in a collection. Then it returns a success response to the external site in addition to a uniquely generated id string.
The external site receives the success message and navigates to a dynamic page (on your Wix site) while passing the generated ID string within the url.
On your Wix site, the dynamic page is loaded and fetches the matching info from the database collection for further processing by the user
SBUSA- I know this is an old thread. But if this has been resolved, can you please share the code how you resolved it?
I have designed a form using JotForm which I embedded in Wix Site. After submitting the form, the JotForm can re-direct the thank you page to wherever we want (e.g. Wix Site page). But I am getting a 4 03 forbidden error.
I guess there is some Wix Code I need to add to the page to accept the data which is what I need example of.