Skip to main content
8 votes
Accepted

How can I get the office 365 group id for a modern site I've just provisioned?

To solve your issue, instead of provisioning Modern team sites using CreateSiteAsync method, you should provision your site using the CreateUnifiedGroup method of PnP. This will return your Office ...
Gautam Sheth's user avatar
  • 30.9k
7 votes
Accepted

Graph API and SharePoint on-premise

I don't think Microsoft Graph API will be available for on-premises. Microsoft graph is part of Azure infrastructure and does not know anything about your local environment. To use Graph API you need ...
Denis Molodtsov's user avatar
7 votes
Accepted

How to do Microsoft Graph API Filter on Lookup Column in SharePoint List Items?

The the following expression demonstrates how to filter by lookup field id: &filter=fields/<LookupFieldName>LookupId eq '<LookupFieldValue>' Pay attention to lookup field name ...
Vadim Gremyachev's user avatar
6 votes

spfx context undefined

This is because the msGraphClientFactory is an object on the SPFx web part context and not the react component context. You will need to pass the msGraphClientFactory object explicitly as a property ...
Vardhaman Deshpande's user avatar
5 votes
Accepted

How to make a POST call to Microsoft Graph in SPFx (using MSGraphClient)?

MSGraphClient is still in preview and will not work in production tenants as of writing this. Have tested the below the code and it works in Developer tenant. Add the below import statement: import {...
Gautam Sheth's user avatar
  • 30.9k
5 votes

Does the Microsoft Graph support driveItem change notifications for SharePoint Online?

I just implemented such a feature for our webapp accessing a customer's SharePoint site. So to make the process for anyone searching for this a bit less painful than it was for me, here's a quick ...
Jonas Völcker's user avatar
4 votes
Accepted

Get all the user info using Microsoft Graph

Since the GraphHttpClient provided with the SharePoint Framework is limited at the moment, you have to use ADAL JS instead. You can read more about the approach and it’s considerations at https://docs....
Waldek Mastykarz's user avatar
4 votes

SPFx: Can you use WebPartContext in components different than the main one?

Are you passing the context down as part of props? According to this other answer, this.context.pageContext is only available in the top level class/component that inherits from BaseClientSideWebPart,...
Dylan Cristy's user avatar
  • 12.8k
4 votes

SPFx: Can you use WebPartContext in components different than the main one?

You can pass it through the props: In your other component define props interface: export interface IProps { description: string; ctx: WebPartContext; } Declare your second component as ...
Sergei Sergeev's user avatar
4 votes
Accepted

sharepoint graph api filtering based on a list column value

You can try filtering list items by using similar query as given below: For List on root site: https://graph.microsoft.com/beta/sites/mytenant.sharepoint.com/lists/MyListName/items?expand=fields(...
Ganesh Sanap - MVP's user avatar
4 votes
Accepted

Expertise from Delve via Graph API

I had the exact same question, hunted around and could not find the answer. It's not listed on: https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0 But through some Trial ...
PSaul's user avatar
  • 156
4 votes

How to restrict App Only permissions to one site

This is indeed not possible yet (still not, 7 months after you posted this). Here is proof: https://github.com/SharePoint/sp-dev-docs/issues/5730 Microsoft did however announce they will solve this ...
frevd's user avatar
  • 141
3 votes
Accepted

SharePoint Rest API : Recent SharePoint Sites

I dont know if you have gotten a answer to this question some other way but here is a possible solution to your Office graph is disabled problem. By simply adding an extra header to your request it ...
Johan Brännmar's user avatar
3 votes
Accepted

Where is the "Service Principal Permissions Management Page"?

The exact URL of the page is as below: https://tenant-admin.sharepoint.com/_layouts/15/online/ AdminHome.aspx#/webApiPermissionManagement It is available as part of the new Admin center. You should ...
Gautam Sheth's user avatar
  • 30.9k
3 votes
Accepted

Microsoft Graph API - SharePoint List Items not returning

I'm not sure if you are still having the problem, but I was experiencing the same. I could perform the query using Graph Explorer but not when I tried in code. I could get all the way to the SP List ...
guyleejr's user avatar
  • 111
3 votes

Oauth Authentication for SharePoint REST API

As of this moment, access to SharePoint endpoint via Graph API is possible only through the beta endpoint. Your URL should be as below: https://graph.microsoft.com/beta/sites/tenantname.sharepoint....
Gautam Sheth's user avatar
  • 30.9k
3 votes
Accepted

Outlook Calendar in SharePoint Online. Graph API?

Ended up using Layer 2 Cloud Connector to sync O365 Resource calendar (which can auto accept invites) events to a SharePoint list then in SharePoint used jquery FullCalendar. Layer 2 Exchange data ...
user2180163's user avatar
3 votes
Accepted

Get "lastModifiedDateTime" with MS Graph or REST

You could use SP API _api/web/Lists/GetByTitle('listName') endpoint which returns list informations and deal with LastItemDeletedDate and LastItemModifiedDate. Here's a working code: var requestUri = ...
Salah's user avatar
  • 364
3 votes

Problems with MSGraph POST in SPFx React

This doesn't answer all your question, but this is to the first error MSGraphClient.serviceKey, Since 1.6 the MSGraphClient and AadHttpClient classes no longer expose a serviceKey property which ...
Karthik Jaganathan's user avatar
3 votes
Accepted

Access Graph API from localhost (SharePoint extension)

The Leverage the Microsoft Graph & 3rd Party APIs training module shows how to configure your project to use the Microsoft Graph. The training module shows how to do so in a web part project, but ...
Rob Windsor's user avatar
  • 12.7k
2 votes
Accepted

How can I deploy a SharePoint Framework webpart with a Microsoft Graph API query as an add-in?

I was trying to connect to Graph API in SPFx environment and mostly failed. But now SPFx has GraphHttpClient available, which is still in development phase but can able to read groups. You can have a ...
ThinkB4Code's user avatar
  • 2,970
2 votes

How to save image as attachment in List using CSOM C#?

There 2 ways you can add attachments to list items. Option 1 - .AttachmentFiles.Add(attachmentInfo) as below using FileStream: var list = context.Web.Lists.GetByTitle("CustomList"); var listItem = ...
Gautam Sheth's user avatar
  • 30.9k
2 votes
Accepted

How to save image as attachment in List using CSOM C#?

I have used this in PowrShell Scripts May be it will help you foreach($item in $Items) { if($item.Attachments -ne $null) { try { foreach($attachment in $item.Attachments) { ...
Akshay Dattatray Nangare's user avatar
2 votes

Does Anyone Have idea about Stream?

As of today, there is provision for using Stream videos only in SharePoint Online. Link - Microsoft Stream webpart for SharePoint Online But, we can expect Microsoft to release their administrative ...
Satyajit Paul's user avatar
2 votes
Accepted

Work with Files and DocumentLibraries with Microsoft Graph

First you can get the libraries data: https://graph.microsoft.com/beta/sites/{hostName}:/{optionalSubsiteUrl}:/drives example: https://graph.microsoft.com/beta/sites/yoursite.sharepoint.com:/sites/...
rafter13's user avatar
  • 570
2 votes

Unable to call graph API from SharePoint page

I was able to get this working. So basically, all the steps mentioned in the blog were applied and they are correct. However, for me I had to set the reply URL to the page from which I was calling the ...
Ashish's user avatar
  • 881
2 votes

How to make a POST call to Microsoft Graph in SPFx (using MSGraphClient)?

This should help you get started. Here I'm registering a webhook const graphClient = this.context.serviceScope.consume(MSGraphClient.serviceKey) const future: Date = new Date(Date.now() + 4320 * 60); ...
baywet's user avatar
  • 565
2 votes

How could I get all root level sites (excluding sub site) using Microsoft Graph API?

Microsoft Graph documentation says the following filter expression could be utilized to list all root-level site collections: siteCollection/root ne null But unfortunately i have not managed to get ...
Vadim Gremyachev's user avatar
2 votes

How to avoid credential popup, to connect with graph API in the powershell script?

Did you try this ? This PowerShell sample demonstrates how to use the Office Dev PnP PowerShell to connect to the Microsoft Graph using Application Permissions. Using application permissions is ...
Arvi's user avatar
  • 953

Only top scored, non community-wiki answers of a minimum length are eligible