My (first) android app is working quite nicely but i am left with 1 very major issue i am trying to solve for several days now
I am trying to use Graph to access an Excel document in my OneDrive from another account. This file is declared public to all by a sharing link.
I am using the next GET to retrieve the file
The only problem is that the file must be on the user shared folder which i would like to avoid for security reasons.
I am using onedrive for business but if that is a problem, i can use a personal account, though the users of the app must use business since i grant access only to a certain organization.
[UPDATE Sep-27 2018]
With regards to the file shouldn't need to be in a shared folder, the following is the why I think this (I hope I'm wrong):
while in my business onedrive account, i share the file as public and retrieve the sharing link:
https://MY_ORGANIZATION.sharepoint.com/:x:/g/personal/MY_USER/Eabkxa2md3JEsW0qQEuYRK4BKnnnHeJqNuspeZ6TEdkWsQ
I enter Graph Explorer and run the command to retrieve same file as excel JSON:
https://graph.microsoft.com/v1.0/drives/MY_DRIVE/MY_EXCEL_FILE/workbook/worksheets/Data/tables/TableData/rows
Graph explorer replys with an
HTTP 200
and the correct JSON (as noted, also working correctly on my android app).I log out from Graph Explorer and OneDrive and make sure the shared link is still working.
I connect Graph Explorer using a different account (same organization) and run the same command to retrieve excel JSON:
https://graph.microsoft.com/v1.0/drives/MY_DRIVE/MY_EXCEL_FILE/workbook/worksheets/Data/tables/TableData/rows
This time i get "Failure - Status Code 404":
{ "error": { "code": "itemNotFound", "message": "The resource could not be found.", "innerError": { "request-id": "6d095277-fa07-40ba-bfcb-c93e96660fdc", "date": "2018-09-27T15:43:28" } } }
If I enter the shared link using my browser, the file is shown in the shared list (below "Recent" and above "Discover" folders on browser):
https://MY_ORGANIZATION.sharepoint.com/:x:/g/personal/MY_USER/Eabkxa2md3JEsW0qQEuYRK4BKnnnHeJqNuspeZ6TEdkWsQ
When I return to Graph Explorer and run the command again, I get an
HTTP 200
response.https://graph.microsoft.com/v1.0/drives/MY_DRIVE/MY_EXCEL_FILE/workbook/worksheets/Data/tables/TableData/rows
My conclusion is that file must be inthe shared folder. Please correct me if I am missing something.
ps: After file appears on the 2nd account's "shared" folder, looking at the OneDrive "Manage Access", I now see the 2nd account's inisitals. This is probably to indicate file officially accessed and shared. Deleting the file from his shared folder, keeps its initials and proper response from Graph explorer. Only canceling the share link seems to cancel the share.
[UPDATE Sep-27 2018 - 2]
Since another comment from Mr. Marc, i modified the question a bit and would like to point out i also tried the next link using the my actual sharing link. This had similar response (not sure the exact error code) + other issue in getting the actual excel.