Hell Wix Code Community,
I am trying to send user information to a third party api for some calculation, which in turn will return data back to my website to display to the user. Can this be done on WIX?
I did come across wix-http-functions, but it only exposes the functionality.
Thanks in advance for your time and help!
Ay.
Hey
Use Wix-fetch for that, search in the header of this page for wix-fetch and you will get many samples and solutions.
Hi
Wix-fetch retrieves information only from what I understand. How do i sent the data to the 3rd party API?
Hi Ayub,
As Andreas said, you can use Wix-fetch. Wix-fetch will not just “fetch” information but craft an http request to the endpoint and with the verb you need. You can pass, for instance, a JSON payload that will be the representation of the data you need to perform your calculation on. Andreas recently published an article on how to set the request headers if you need authentication, but I can’t find the article just now.
I have personally used the request package, available as an npm download, as I found it better documented.
Hi Andreas and Martin,
Thank you very much for your responses. I will have a look at wix-fetch! Seems I miss understood its purpose.