kirypto
kirypto

Reputation: 139

Google Sharing API Leads to 500 Error and "Sharing is Unavailable" Message

I am attempting to set up the sharing ability on a web application that I am making. I have followed the steps on Google's Drive Sharing Instruction Page to the best of my ability. However, when I click the button, I get the expected popup, but with the message "Sorry, sharing is unavailable at this time. Please try again later."

The code I have is slightly different, as the init function name is being used elsewhere. The code I have is:

function initializeGoogleApis() {
    /*
    self._shareClient = {
        'showSettingsDialog': function() {
            devConsole.warning(0, "The sharing ability has not yet been implemented.");
        }
    };*/

    gapi.load('drive-share', function() {    
        self._shareClient = new gapi.drive.share.ShareClient();
        self._shareClient.setOAuthToken(self.clientId);
        self._shareClient.setItemIds(self.realtimeUtils.getParam("id"));
    });


}

Note the commented section. I had this to insure that the 'share' button on my page is loaded properly and calling the function, which it is. As explained in the title, when I click the button, I get a 500 error in the console.

At the bottom of the Google page listed above, it says the following:

I am also testing on the actual host, not on localhost as it states this will not work.

All the same, I get the following error:

GET https://drive.google.com/sharing/share?id=xxxxx_xxxxxxxxxx8&fore…
d=false&client=postMessage&embedOrigin=http://www.example.com 500 ()
    _.k.$l @ cb=gapi.loaded_0:651
    _.k.S @ cb=gapi.loaded_0:651
    _.k.Ql @ cb=gapi.loaded_0:794
    ys.kc @ cb=gapi.loaded_0:791
    Ts.OV @ cb=gapi.loaded_0:822
    Zs @ cb=gapi.loaded_0:814
    FM @ cb=gapi.loaded_0:818
    Ts.Ph @ cb=gapi.loaded_0:818
    pt.Na @ cb=gapi.loaded_0:829
    onclick @ ?id=xxxxx_xxxxxxxxxxxxxxxxxxx:97

Any help would be appreciated

Upvotes: 0

Views: 195

Answers (1)

Jason Clawson
Jason Clawson

Reputation: 1027

It looks like you are passing in your clientID instead of your OAuth token.

Upvotes: 1

Related Questions