Microsoft Graph Sharepoint subsite list - sharepoint

Is it possible get list and items of a subsite in SharePoint using the Microsoft Graph?
There is a way to get a subsite but not the items of a subsite.

Once you have a subsite, you can make subsequent queries by using the identifier of that subsite.
For instance, if I fetch https://graph.microsoft.com/v1.0/sites/root/sites, I can see the subsites available, each of which has an id.
I can then make a subsequent query to https://graph.microsoft.com/v1.0/sites/<subsite id>/lists to fetch the lists for this sub-site.
It is also possible to use OData query options and request the 'lists' for each sub-site expanded in the request to get subsites. I can make a call to https://graph.microsoft.com/v1.0/sites/root/sites?$expand=lists and see entries for each of their sub-sites, and also their lists.

Related

Filtering a SharePoint list based on the user profile

I am using Sharepoint online from an Office 365 solution.
On a Sharepoint list, I would like to display elements based on the profile of the visitor/user.
Some users should be able to view/modify all elements from the list, and some other users must only be able to view/modify a few elements they are responsible for.
I thought about filtering the list based on the profile of the visitor.
I created different views, where I can add filters on the list but couldn't use visitor infos as filtering parameter.
The audience targeting doesn't seem to answer the question as well.
I manage to give an access (or not) to the full list, but not adapt which elements from the list are accessible based on the profile of the user.

Microsoft Graph API - Search content over a sharepoint site

We are creating a Sharepoint webpart that enable searching a Sharepoint site contents using Microsoft Graph Api. I am able to get the Lists and subsites
using graph Api, but not sure how to search any content at site level.
Looking for any pointers if this is even achievable.
Below are some of the API calls that work-
https://graph.microsoft.com/v1.0/sites/tenants/lists?select=id,name
https://graph.microsoft.com/v1.0/sites/tenants:/sites/sitename:/sites?search=subsitename
https://graph.microsoft.com/v1.0/sites/tenants:/sites/sitecollection:/lists
here is an example filtering on a list items
https://graph.microsoft.com/v1.0/sites/myThing.sharepoint.com,ffffffff-ffff-ffff-ffff-ffffffffffff,12345678-1234-1234-1234-123456789012/lists/25dd5a71-69a9-44f8-b60f-ed16718eae54/items?expand=fields(select%3DTitle,ID,ContentType,myLookupID)&top=1000&filter=fields/ContentType eq 'My Page'

Showing list of VSTS work items in Sharepoint document

In a Confluence page, you can show a list of Jira items via a JQL query.
I'm looking at migrating to VSTS work items and Sharepoint. In Sharepoint, is it possible to show a list of VSTS work items on a page? How to do this?
There is Work Items Rest API that could retrieve work item data from VSTS, so you can access external data with REST in SharePoint.

Retrieving SharePoint site author and permissions through Graph API

I would like to retrieve Sharepoint subsites authors & permissions (public or private, and if private : allowed groups/members), preferably using Graph API.
For Outlook Groups and Teams sites, I can use endpoints /groups/<groupID>, /groups/<groupID>/owners and /groups/<groupID>/members to achieve that, but it seems that there is no equivalent for sites created through the following process:
Load "root site" https://<yourdomain>.sharepoint.com
Click on "Site contents" > "New" > "Subsite"
The only "interesting" Graph API endpoint I found yet, is /sites/root/sites/<siteID>/lists, returning some site metadata (collections of data like "master pages", "designs"...), along with a createdBy structure (containing a user.id property) for each of those collections.
However, using it would look hacky, a "direct" property/structure author or owners would be preferable. Moreover, the /sites/.../lists endpoint is only available in beta version of the API (has somebody any info on its release date ?), and still, that does not tells me which users are allowed to view the site.
Attempts with other APIs like this one did not provide any closer info to what I need.
Thanks for any piece of advice.
SharePoint has site collections > sites > lists > folders > items. By default each object inherits permissions from its parent, but you can break inheritance at any level. So in order to get a complete picture of the permissions a subsite has, you will need to enumerate every object inside that subsite (lists, folder, items) and check if it inherits permissions from its parent or not. As far as I know Microsoft Graph doesn't expose an API that lets you do this, but you can instead use SharePoint CSOM (client side object model) or SharePoint REST APIs.

How to retrieve data from SharePoint?

I have a web application. When the user clicks on a button in my web application, I'd like to retrieve data from SharePoint on behalf of the user. I have read quite a few articles on SharePoint but I'm still not sure how to proceed. Should I create a provider hosted SharePoint App and use the SharePointREST API? Thank you in advance for your help.
You don't need to create a Provider to use the SharePoint Rest Services.
Quoting http://msdn.microsoft.com/en-us/library/office/jj164022(v=office.15).aspx :
One advantage of using REST is that you don’t have to add references to any SharePoint 2013 libraries or client assemblies. Instead, you make HTTP requests to the appropriate endpoints to retrieve or update SharePoint entities, such as webs, lists, and list items. See Get started with the SharePoint 2013 REST service for a thorough introduction to the SharePoint 2013 REST interface and its architecture.
Inside the page you will find videos and code examples that will help you to connect and execute operations.
It's Correct. Data in SharePoint is Stored in Lists or Libraries (to files).
You can use the Client Object Model, to get data remotely from a SharePoint Server (on-premise or Online). The Client Object Model can be used through Assemblies (DLL files) or REST services provided by SharePoint. Generally you should know the location of the data you are going to get, that is, as I initially mentioned, the data in SharePoint are stored in Lists or Libraries, therefore you must know the name of the List or Library Additional Site or Sub-site of the List or Library is.
If the name of the list where the information is stored is "employees" and the HR website, the URL could be formed as follows:
http://spserver.company.com/HR/Employees
For REST services, simply complete URL of the list you want to see, so that you retrieve the information from the list. If you want to apply filters, sorting, to retrieve specific columns, you must do it through CAML queries which the add on REST service call.

Resources