sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

MSGraphClient not returning data

Open nmnikolov opened this issue 8 years ago • 2 comments

Category

  • [X] Question
  • [ ] Typo
  • [X] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

I am trying to get a file metadata stored in document library in SP Online using MSGraphClient class. The version of SPFx is the latest - 1.6.0. First I get all drives for the selected site collection using: /sites/{tenant}:{site collection}:/drives

then filter the result to get the Id of Documents library, then send another request to get all files in the document library using: /sites/{tenant}/drives/{Document library Id}/root/children

Observed Behavior

The first request successfully returns all document libraries that are in the site collection. The second request always return empty array even that there is a file stored in the document library. Tried the same request in the Graph Explorer with the same user, which is the Global Administrator, and the request returns the file. Have granted all possible options for Microsoft Graph for the tenant - 55 application permissions and 108 delegated permissions but no luck.

nmnikolov avatar Sep 08 '18 14:09 nmnikolov

I think I found the issue. It seems there is some delay for the permissions to apply and MS Graph to start returning the data after Approving then in the Api Management page.

nmnikolov avatar Sep 09 '18 10:09 nmnikolov

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 26 '20 18:01 msft-github-bot