on 12-17-2018 4:36 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
User | Count |
---|---|
79 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.