List Microsoft Sharepoint Sites with Microsoft Graph - sharepoint

I'm working with Microsoft OneDrive and Microsoft Sharepoint using Microsoft Graph, and as I understood:
Url to get file list from logged in user OneDrive is:
/v1.0/me/drive/root/children
Url to get file list from company Sharepoint Documents is:
/v1.0/drive/root/children
So my questing is:
How to list Sharepoint Sites that user is following and upload files to this Sites

This isn't possible yet. You need to use the direct SharePoint API end point to access content from SharePoint Sites.
Graph API supports accessing OneDrive, OneDrive for Business, and the document library for an Office 365 Group only.

Related

How to get Sharepoint site members with Microsoft Graph API?

I am building an app which checks which member has access to which Sharepoint sites. How do I do that with the Microsoft Graph API?
For OneDrive I can get the user's drives by
graphServiceClient.Users[memberId].Drive.Root.Children.Request()
I would like to do that with Sharepoint sites like this
graphServiceClient.Users[memberId].Sites.Root.Children.Request()
but that is not possible. Any idea waht is the right API to get the all the Sharepoint sites the user have access to?

fetch all places (lists/libraries/items) where permissions are given to 'Everyone' group

I am working on office 365 SharePoint site.
I want to fetch all lists/libraries/items where permissions are given to Everyone group across SharePoint site using CSOM.

Search for Content Across SharePoint Sites

Currently I'm using: /v1.0/sites/{site-id}/drive/root/search(q='{search-text}') but I would like to search across all the sites I have access to.
Is there a Microsoft Graph API which can search a keyword on all sites a user can access in SharePoint without giving site id?
There's no Graph API for a global content search at the moment.
However you can leverage the SharePoint Search API.

How to access a document library in a sharepoint online site using MS graph

I am able to access the documents on my one drive with requests like this one:
https://graph.microsoft.com/v1.0/me/drive/root/children
I am able to access a document library of a root sharepoint site of my company with a request like this:
https://graph.microsoft.com/v1.0/drive/root/children
It gives me the contents of the "root" library:
https://<my company>.sharepoint.com/Shared%20Documents
I am not able to access the document library of a SP subsite I created. e.g. this one:
https://<my company>.sharepoint.com/samplesp/Shared%20Documents
How can I access such a document library with MS Graph?
For accessing SharePoint sites and lists check out documentation of the SharePoint API in Microsoft Graph.
Update:
For those who have problems with accessing default Drive (formerly "Documents" library) on a specific SharePoint site using MS Graph API:
You should look into the documentation for accessing files on OneDrive.
As said in the question, this endpoint gives us a list of files on private OneDrive:
.../me/drive/root/children
Drive on SharePoint's sites works in the same way, but instead of me you should provide global Id of the site you want to access (global Id is <hostName>,<siteCollectionId>,<siteId>).
In conclusion: this endpoint gives us a list of files on a specified site's default drive:
.../Sharepoint/sites/<hostName>,<siteCollectionId>,<siteId>/drive/root/children
If you want to access files on a specific list, all you need is the id of the list:
.../Sharepoint/sites/<hostName>,<siteCollectionId>,<siteId>/lists/<listId>/drive/root/children
Now it should be obvious.

Which set of APIs should be used for Office365 Sharepoint

Which set of APIs should be use to access Office365 sharepoint which includes both sharepoint2013 and sharepoint2016.
Have gone through the following APIs
1) Sharepoint2013 REST APIs(https://msdn.microsoft.com/en-us/library/office/jj860569.aspx).
2) OneDrive new APIs(https://github.com/OneDrive/onedrive-api-docs) through which we can access the Directory folder which contains directory and files. But the present focus of APIs are for OneDrive Personal and Business.
Apart from this is there any other APIs which can access the office365 sharepoint?
You could use SharePoint REST API to retrieve, update, and manage data in Sharepoint Online ,you could find code samples and videos from here.
With Graph API you could get files/users/groups ,but SharePoint sites and lists are not yet available via Microsoft Graph .
In addition ,you could also use SharePoint client object model (CSOM) to manage data in Sharepoint Online,please read below article:
Connect to SharePoint Online using Client Object Model

Resources