Onedrive-api-docs: [OneDriveSDK] Failed due to unknown error

Created on 19 Aug 2020  路  3Comments  路  Source: OneDrive/onedrive-api-docs

Category

  • [x] Question
  • [ ] Documentation issue
  • [ ] Bug

I'm trying to run a sample OneDrive picker. But it didn't seems to work.

Observed Behavior

A popup opens asking to login. As soon as I enter my email address and hit the next button. The popup closes and there is this error in the console.

image

Steps to Reproduce

Here is my index.html and odcallback.html

index.html

<!DOCTYPE html>
<html>
  <head>
    <script
      type="text/javascript"
      src="https://js.live.net/v7.2/OneDrive.debug.js"
    ></script>
  </head>
  <body>
    <button onclick="createPicker()">Open OneDrive</button>
    <script type="text/javascript">
      function createPicker() {
        var odOptions = {
          clientId: "CLIENT_ID_HERE",
          action: "download",
          multiSelect: true,
          advanced: {
            redirectUri: "http://localhost:8000/odcallback.html",
          },
          success: function (files) {
            console.log(files);
          },
          cancel: function () {},
          error: function (error) {
            console.error(error);
          },
        };
        OneDrive.open(odOptions);
      }
    </script>
  </body>
</html>

odcallback.html

<html>
  <script type="text/javascript" src="https://js.live.net/v7.2/OneDrive.debug.js"></script>
</html>

Here is my app registration

image

Did I missed something in configuration ?

Thank you.

Docs Picker backlogged

Most helpful comment

image

Enabling those two options worked for me. But was not able to find it in documentations though.
I was using this documentation for Setting up https://docs.microsoft.com/en-us/onedrive/developer/controls/file-pickers/js-v72/?view=odsp-graph-online.

All 3 comments

Thank you for your contribution to OneDrive API Docs. We will be triaging your incoming issue as soon as possible.

image

Enabling those two options worked for me. But was not able to find it in documentations though.
I was using this documentation for Setting up https://docs.microsoft.com/en-us/onedrive/developer/controls/file-pickers/js-v72/?view=odsp-graph-online.

Thanks for your feedback. We'll tag this item to go to our documentation backlog.
If you wish, you may also contribute a PR to address this issue.

Was this page helpful?
0 / 5 - 0 ratings