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 ...
user avatar
  • 30.3k
6 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 ...
user avatar
6 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 ...
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 ...
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 {...
user avatar
  • 30.3k
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....
user avatar
4 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 ...
user avatar
  • 30.3k
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,...
user avatar
  • 12.2k
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 ...
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 ...
user avatar
  • 156
4 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 ...
user avatar
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 ...
user avatar
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 ...
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....
user avatar
  • 30.3k
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 ...
user avatar
3 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(...
user avatar
  • 28.2k
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 = ...
user avatar
  • 367
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 ...
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 ...
user avatar
  • 11.5k
3 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 ...
user avatar
  • 131
3 votes

Authenticate the SmtpClient using AppID and APPSecret instead of passing the username and password

This isn't a SharePoint-related question as we're just talking about SMTP mail. With Exchange Online, you have a few options you can evaluate; these will use username/password as SMTP relays are not ...
user avatar
  • 28.9k
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 ...
user avatar
  • 2,930
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 = ...
user avatar
  • 30.3k
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) { ...
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 ...
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/...
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 ...
user avatar
  • 881
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 ...
user avatar
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); ...
user avatar
  • 555
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 ...
user avatar
  • 943

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