graph
9 TopicsUsing Microsoft Graph to filter on siteCollection property
I want to get a list of all SharePoint sites on the tenant using Graph. But when I make a request, it brings everything including user OneDrives. From the data it seems that you can use siteCollection property to filter the data. siteCollection : @{hostname=xxxxxxx-my.sharepoint.com} - OneDrive siteCollection : @{hostname=xxxxxxx.sharepoint.com} - SharePoint Site I am making requests via PowerShell. So far tried variations of these: $v1/sites?`$select=webUrl,siteCollection&`$search=`"siteCollection:hostname=xxxxxxx.sharepoint.com`" $v1/sites?`$select=webUrl,siteCollection&`$count=true&`$filter=startsWith(siteCollection,'hostname=xxxxxxx.sharepoint.com') $v1/sites?`$select=webUrl,siteCollection&`$search=%22siteCollection:hostname=xxxxxx.sharepoint.com%22 But no luck. Just brings back empty value @odata.context value -------------- ----- https://graph.microsoft.com/v1.0/$metadata#sites(webUrl,siteCollection) {}1.9KViews0likes3CommentsSharePoint Last Activity from Graph vs Sharepoint Admin Panel
When I query report with restAPI against graph: "https://graph.microsoft.com/v1.0/reports/getSharePointActivityUserCounts(period='D180')" for some sites I'm getting different date from what I see in Sharepoint Online Admin Panel - Activity tab - "Last Site Activity". Sometimes the date in Admin Panel is older sometimes newer. Which one is more legitimate?613Views1like0CommentsGraph Get SPO Webpart Information
I started a Graph request against a SPO site, trying to get detailed information about the integrated webparts. Graph Call was GET https://graph.microsoft.com/beta/sites/{site id}/pages/{page id} I assumed a response like the Microsoft Docs shows: https://learn.microsoft.com/en-us/graph/api/sitepage-get?view=graph-rest-beta&tabs=http But all webparts where shown only like this: "webParts": [ { "type": "544c1372-7e5a-49ec-8db6-812f76c375f2", "data": { "id": "544c1372-7e5a-49ec-8db6-812f76c375f2", "instanceId": "5feff54a-69c4-4795-93d2-ab74501c3c6f" } } How do I get an response like microsoft docs are showing? I want to provision SPO pages with pre-configured webparts through SiteScripts. Any ideas?581Views0likes0CommentsUpdate Group SharePoint Custom Field Collums after Fileupload with REST Graph API in Javascript
Hi, I've made an upload with Graph with the following JS code: async function uploadSingleFileMetaToSharepoint(file, name, metaData, groupId, graphAccessToken) { //console.log(file, name, metaData, groupId); //TODO get Filepath from config of App let pathToFiles = 'General' let apiurl = msgraph + `/groups/${groupId}/drive/root:/${pathToFiles}/${name}:/content`; if (debug) { console.log("uploading File: ", file); console.log(`API-URL: ${apiurl}`); } let header = { 'Authorization': graphAccessToken, } let body = file; //TODO catch errors let result = await fetch(apiurl, { "method": 'PUT', "headers": header, "body": body }); if (!result.ok) { console.error("upload file to sharepoint failed"); return } let res = await result.json(); //console.log(res); if (res === undefined || res.id === undefined) {console.error("Die DAtei wurde nicht hochgeladen"); return;} /... } which is working fine. But now i'm struggling to fill the values of the collumns from sharepoint : Does anybody know how to approach this?Solved1.6KViews0likes1CommentUpdate Group SharePoint Custom Field Collums after Fileupload with REST Graph API
Hi, I've made an upload with Graph with the following JS code: async function uploadSingleFileMetaToSharepoint(file, name, metaData, groupId, graphAccessToken) { //console.log(file, name, metaData, groupId); //TODO get Filepath from config of App let pathToFiles = 'General' let apiurl = msgraph + `/groups/${groupId}/drive/root:/${pathToFiles}/${name}:/content`; if (debug) { console.log("uploading File: ", file); console.log(`API-URL: ${apiurl}`); } let header = { 'Authorization': graphAccessToken, } let body = file; //TODO catch errors let result = await fetch(apiurl, { "method": 'PUT', "headers": header, "body": body }); if (!result.ok) { console.error("upload file to sharepoint failed"); return } let res = await result.json(); //console.log(res); if (res === undefined || res.id === undefined) {console.error("Die DAtei wurde nicht hochgeladen"); return;} /... } which is working fine. But now i'm struggling to fill the values of the collumns from sharepoint : Does anybody know how to approach this?620Views0likes0CommentsSharePoint Home: Stale results in followed sites - Graph not able to remove
Hi, I was wondering if the following behaviour is the same for you guys regarding followed sites in SharePoint Home: For me, sharepoint.aspx still shows site collections under "Following" that do not exist any more. Well okay, they exist in the SharePoint admin center recycle bin but this shouldn`t be the reason why they`re still being followed, or is it?. I thought I could remove them programmatically through the Graph beta endpoint described https://docs.microsoft.com/en-us/graph/api/site-unfollow?view=graph-rest-beta&tabs=http. Unfortunately, this does not do anything because I`m constanstly getting 207 with no error message. Has anyone ever attempted this before? Thanks for your help.642Views0likes0CommentsSend an email from SPFx client-side webpart without exchange online
Hello All, We're trying to build an spfx client-side webpart which should send a confirmation email to the user logged in (CC'in a mailbox) on a button click. I have tried Graph Api and pnp.js, and they both work great on my personal tenant where exchange online is enabled. But on our company prod tenant we do not have exchange online enabled. Any idea if GraphApi/PnP.js has a dependency on enabling exchange online to send email. Thank you all !Solved10KViews0likes8CommentsShare point site properties to identify site type/template from GRAPH APi
I am having difficulty in identifying a site template type when fetching all sites returned from the GraphAPI, Is there a way to expose more properties for Sharepoint Sites? Like in Sharepoint RESTApi, We get a web_template property that allows us to identify what site it is, Is there anything equivalent in Sharepoint GraphAPI?1.2KViews0likes0Comments