How to call MS Graph Search API for get SharePoint list items using react applicaiton - microsoft-graph-api

I want to call Microsoft graph search API or Graph API to get SharePoint list items using React Application (Single page application).

You can follow the doc to setup and call graph API in your react app,
Use below code snippet to get SharePoint list items
getGraphClient(result.accessToken)
.api('/sites/{site-id}/lists/{list-id}/items/{item-id}?
expand=fields')
.responseType(ResponseType.RAW)
.get()

Related

How can I use Graph API to list event instances which are deleted?

Now we are trying to migrate to Microsoft Graph API from EWS SDK, but after we investigate the Graph API, we found it seems that we can not use list instances API to get the deleted instances quickly except we scan the whole instances ?

Get role inheritance state for document library in SharePoint Online

I work with SharePoint Online drives(document libraries) with Microsoft Graph API (/drives call). With this API I can download/upload files but cannot work with permissions.
That's not a problem - I can do it with SharePoint Online REST API (with calls _api/web/GetListByTitle('Title')/hasuniqueroleassignments).
The main problem here is matching drive from MS Graph API and a corresponding list from SharePoint REST API. For now I match by title but I have several examples, when name field in MS Graph API is equal to "OneDrive", but title in List entity is Shared Pictures.
My question is: is there any way to match more precisely entities from Graph API and SharePoint REST API?
Thank you.
The Drive Item object has a SharePointIds property that will provide the information necessary to call the SharePoint REST API.
https://learn.microsoft.com/en-us/graph/api/resources/sharepointids?view=graph-rest-1.0
Use List resource, you could get list id.
Then use id to call rest api.
/_api/web/Lists(guid'54ca94c0-364e-4201-8fe7-a4c804769009')/hasuniqueroleassignments

Get SharePoint Groups (not AD groups) using Graph API

Is there a method to retrieve SharePoint Groups using Microsoft Graph?
I can get Azure Directory groups using https://graph.microsoft.com/v1.0/groups but what I'm looking for are SharePoint Groups.
I could get a SiteCollection using https://graph.microsoft.com/beta/sites/{id} but I couldn't seem to get the SharePoint Groups in site collection.
This is not very easily accessible in just the Microsoft Graph. If you had some access to the SharePoint API, you could get the GUID from the "User Information List" - which seems hidden from the Microsoft Graph at this time. That SharePoint API call would be
GET HTTP https://sometenant.sharepoint.com/_api/web/lists?$select=title,id&$filter=Title%20eq%20%27User%20Information%20List%27
Once you have that GUID for that list you could do the Graph call:
https://graph.microsoft.com/beta/sites/{site id}/lists/{list ID from the SharePoint API}/items
That will get you the full list of members, including groups. This is still a hack since the groups you'd have to filter by contentType/name eq 'SharePointGroup' - which seems buggy in Graph Explorer anyways. Trying to programmatically access that, would be difficult at this time.

ODATA service for to get sharepoint listview

I using SharePoint 2013 server, i need to develop an application which need to fetch SharePoint listview using ODATA service.
I could able to get SharePoint list data, but i need to get list view for that particular list.
regards,
RK

Get URL from search task

I have seen many examples where a search task was launched from application but no examples where application could get some info back from that task.
For example, is it possible to get a list of found sites or URL that user have chosen in task (instead of navigating user to that URL)?
There is no built-in API in WP8 that would allow getting the results of a web search into your app. You should use a 3rd party framework for that.
Bing has an official Web API you can use for that but it starts costing money after 10,000 API calls per month. You can read more about it # https://datamarket.azure.com/dataset/5BA839F1-12CE-4CCE-BF57-A49D98D29A44
Note that Bing did use to have a proper C# API with API keys and what not, but V2.0 of that API has been depercated in favour of the new Azure Data Marketplace service.
Google doesn't have an API for search results. But for the past few years developers have used Google's AJAX webservice to get those. See a C# code sample # http://answers.oreilly.com/topic/2165-how-to-search-google-and-bing-in-c/

Resources