79412917

Date: 2025-02-04 20:15:05
Score: 0.5
Natty:
Report link

Ok, I managed to solve the issue. It's missing in the documentation but it's necessary to set the AppId with setAppId(<BEGINNING_OF_CLIENT_ID>) and the argument should be the beginning of your client id in google cloud console.

function onPickerApiLoad() {
    const oauthToken = '<YOUR_OAUTH_TOKEN>'; // Retrieved from backend securely
    const picker = new google.picker.PickerBuilder()
        .addView(google.picker.ViewId.DOCS)
        .setOAuthToken(oauthToken)
        .setDeveloperKey('<YOUR_API_KEY>')
        .setCallback(pickerCallback)
        .setAppId(<BEGINNING_OF_CLIENT_ID>)
        .build();
    picker.setVisible(true);
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: kamipeer