I have a form to book a flight with standard fields: Flight date, from, to , flight hour, flight min, etc…
My request is from all the information’s I get from clients, I want to create an event in a google calendar when the client click on submit the flight ?
Any ideas how I can deal this quite complex requirement ?
wix code allows you to integrate with APIs available on the web, in this example a short google search came up with this
please learn more about the api you need, the format of the data needed and authentication options, then implement a backend code that will integrate with it that will be invoked on the user action
Many thanks for your answer.
I checked the google link. I understood the logic…
I am quite new in wix and java and I don’t see how I can implement a backend code and integrate it wix ?
Wix code lets you write code under the backend folder in your editor, using JavaScript, and invoke it as a simple function. please see the following example here:
basically, it means you can invoke any api available out there in the web using REST (http) from your site backend.
How can I know which parameters I have to setup ?
Sorry for my questions, I have difficulties to transpose the sendGrid example with my google request…
the above are scripts to be downloaded and use in your user’s browser, since you’d need to allso provide your calendar id and credentials this is not the way we want to do it, actually i recommended you use their http api from your backend code, just like the example of using sendgrid api to send an email, just here it is google calendar.
please have a look at the parameters google allow you to use here:
i guess some of the data will be taken from the user input while the other like calendar id etc will be provided by you, just like the send grid example.
I tried to modify the sendgrid example without success, with a backend file, i can’t really debbug…
This is really difficult for me, i am gonna tried to find example with work on the google api instead of sendgrid
start with a small example of backend code, just to get the gist of it, if you will write console.log in the backend , and use preview you should see the logs in the wix-code developer console.
then add a simple wix-fetch http call just to see you are able to make a simple example, i recommend you use this free service to see you can modify your request data, headers etc, and continue from there
then send the needed parameters from the user browser in javascript to the backend method.
i am not familiar with google api but i can have a look later today or tomorrow
I am faced with the same issue… I have been able ro do construct the data with id, description etc. But I inserting the json is an issue.
Can you help me about insertion, update and delete?