Skip to Content

Google Calendar API call from Fiori App developed in WebIDE

Hi,

Building a Fiori app to change an event on the Google Calendar using the API published by Google.

APIs from Google Calendar are available in api.js. Trying to figure out howo to integrate the same.

Appreciate any help on this.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 18, 2018 at 06:00 AM

    Hello Kedar

    You need to consume the googleapis via an XHR request to the API. Did you try that if yes what issues you are facing. For reference you can check this blog

    Thanks

    Nabheet

    Add comment
    10|10000 characters needed characters exceeded

    • Kedar if you check the first blog code it is loading the library in the sample code. it is loading gapi via apis.google.com and the second example doing the authorization also.

      <html>
        <head>
          <script src="https://apis.google.com/js/api.js"></script>
          <script>
            function start() {
              // Initializes the client with the API key and the Translate API.
              gapi.client.init({
                'apiKey': 'YOUR_API_KEY',
                'discoveryDocs': ['https://www.googleapis.com/discovery/v1/apis/translate/v2/rest'],
              }).then(function() {
                // Executes an API request, and returns a Promise.
                // The method name `language.translations.list` comes from the API discovery.
                return gapi.client.language.translations.list({
                  q: 'hello world',
                  source: 'en',
                  target: 'de',
                });
              }).then(function(response) {
                console.log(response.result.data.translations[0].translatedText);
              }, function(reason) {
                console.log('Error: ' + reason.result.error.message);
              });
            };
      
            // Loads the JavaScript client library and invokes `start` afterwards.
            gapi.load('client', start);
          </script>
        </head>
        <body>
          <div id="results"></div>
        </body>
      </html>