1

i had a working implementation of the google drive api.

Now stopped working and I get following error logged in the browser's console:

GET https://content.googleapis.com/discovery/v1/apis/drive/v3/rest?pp=0&fields=kind%2Cname%2Cversion%2CrootUrl%2CservicePath%2Cresources%2Cparameters%2Cmethods%2CbatchPath%2Cid&key=581000403558-9bno5mqs81fu452qearbqjkrl24jrqln.apps.googleusercontent.com 502 (Bad Gateway)
$h @ cb=gapi.loaded_0?le=scs:169
h @ cb=gapi.loaded_0?le=scs:169
ai @ cb=gapi.loaded_0?le=scs:170
(anonymous) @ cb=gapi.loaded_0?le=scs:170
d @ cb=gapi.loaded_0?le=scs:128
b @ cb=gapi.loaded_0?le=scs:124
trumbowyg.clouddrive.google.min.js:45 gAPI initialization failed with following error: gapix.client.GapiClientError: API discovery response missing required fields.

The code i use to initialize the gapi is:

window.WaXCode.gAPI.onload    = () => {
            console.log('gAPI Loaded.');
            // #region Check for API Key.
            try         { var apiKey = jQuery.trumbowyg.XC.CloudStorage.Browser.refTrumbowyg.o.plugins.WaXCode_OnlineStorage_Google.clientID ;}
            catch( X )  {
                console.error('Google / Drive - API Key not available (is the "Google / Drive (cx_editor)" - TypoScript included in your template?). Unable to initialize Google Drive. Internal: ');
            
                throw X ;}
            // #endregion Check for API Key.
            // #region Load gAPI.
            gapi.load('client', async () => {
                try {
                    await gapi.client.init({
                        apiKey          : apiKey,
                        discoveryDocs   : ['https://www.googleapis.com/discovery/v1/apis/drive/v3/rest']});
                
                    gAPI_Initialized = true ;}
                catch( X ) { console.log('gAPI initialization failed with following error: ' + X );}
            // #endregion Load gAPI.
        });}

Google Cloud Console show that everything is fine with the API-Key etc.

Can't figure out what the problem is.

Any ideas?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.