how to get worksheets of a shared workbook /workbook/worksheets. I am able to get worksheets for personal workbooks but get invalid resource for shared workbooks
Asked
Active
Viewed 243 times
2
-
1Have you checked all scopes? Maybe for a shared workbook you need a different one – BytesOfMetal Jul 06 '17 at 10:57
-
Yes, I have checked all scopes. There is no documentation for a different scope required for shared workbooks. – Viraf Jul 06 '17 at 11:13
1 Answers
2
Finally got it to work!
In order to get workseets of shared workbooks in office 365 need to use the following endpoint
https://graph.microsoft.com/v1.0/drives/{remoteItem.parentReference.driveId}/items/{remoteItem.id}/workbook/worksheets
In order to get {remoteItem.parentReference.driveId} and {remoteItem.id} use following endpoint
Thanks to @Petaflop for suggesting to check all the scopes. For some reason the you can list the files using Read permisson but need Read.All for listing the worksheets.(@Petaflop would have given your answer the tick if it were not deleted :))
https://graph.microsoft.com/v1.0/me/drive/search(q='.xlsx')?select=name,id,parentReference

Viraf
- 746
- 4
- 11