Microsoft Graph get sharepoint sites analytics not working - sharepoint

I tried to query the analytics of a SharePoint site using Microsoft Graph from Microsoft Flow. Before I do this, I tried this in Graph Explorer.
The following url is used.
https://graph.microsoft.com/v1.0/sites/xxxx.sharepoint.com,xxxx,xxxx/analytics
This error message is displayed.
We had an issue sending this request to the Graph API. For assistance, connect with us on StackOverflow with the tag [microsoftgraph].
I have no problem with these two queries:
https://graph.microsoft.com/v1.0/sites/xxxx.sharepoint.com,xxxx,xxxx
https://graph.microsoft.com/v1.0/sites/xxxx.sharepoint.com,xxxx,xxxx/lists
It just doesn't work with analytics.
Based on the documentation, Analytics is not available in all national deployments but I'm in global tenant so I assume it is supported.

Adding a "lastSevenDays" or "allTime" specifier at the end of the url may help you out
https://graph.microsoft.com/v1.0/sites/xxxx.sharepoint.com,xxxx,xxxx/analytics/lastSevenDays
https://graph.microsoft.com/v1.0/sites/xxxx.sharepoint.com,xxxx,xxxx/analytics/allTime

Related

How to get SharePoint modern page content using Graph API?

I can get SharePoint modern Page content through SharePoint REST API using below endpoint but I'm looking for GRAPH API endpoint to achieve the same result.
/_api/web/lists/getbytitle('Site%20Pages')/items?$select=CanvasContent1
Can someone assist on this ?
Found the solution through Microsoft docs Q&A
page content can be found via
https://graph.microsoft.com/beta/sites/{site-id}/pages/{page-id}/webparts
Note: It's available only in /beta version

Fetch all sites from SharePoint by Microsoft Graph API

Does anyone know how I can fetch all sites from my SharePoint by using Microsoft Graph API?
I saw this documents but it seemed that there are no API to list sites.
And I saw this questions but answer was there were no ways.
List Microsoft Sharepoint Sites with Microsoft Graph
Could you help me?
Currently Graph API supported to get all SharePoint sites:
https://graph.microsoft.com/v1.0/sites?search=*
You can test in Graph Explorer firstly:
Reference:
Retrieve Site Collections And SubSites Using Microsoft Graph API

Microsoft Graph API - Share Sharepoint site only

You can share a Sharepoint site without adding them to the member groups via the front-end (screenshot included). However I was wondering if there was a way to do this via the Microsoft Graph API?
I have scoured the docs, both v1 and beta and haven't found anything - so any help would be greatly welcomed.
Graph API Docs
According to the Microsoft Graph user voice, this feature is currently unavailable in the Graph API and is currently a suggested feature - will update this answer if/when it is implemented
Uservoice Sharepoint permission suggestion

How to resolve a "Transient error" from Microsoft Graph API?

I am building an app for a client using the Microsoft Grap API and when I log in with a particular account I get this error:
Request Id: d300b62e-e0a5-4f62-9957-1cc10fd42800
Correlation Id: e1912683-45cb-459e-b631-9706f6cd2479
Timestamp: 2020-04-20T07:51:51Z
Message: AADSTS90033: A transient error has occurred. Please try again.
I have tried 2 other accounts and they work without an error.
Does anyone know how I can resolve this issue or how I can start to work out what the issue might be?
EDIT:
Example of the URL being used to authorise the user
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=<clientid>&response_type=code&redirect_uri=<local_uri>&response_mode=query&scope=openid%20offline_access%20https%3A%2F%2Fgraph.microsoft.com%2Fuser.read&state=12345
Thanks,
Scott.
For those that come here in the future, the best place to check whether or not the issue is isolated to just you, or is part of a wider issue is the official Microsoft 365 Status Twitter account.
You can also check the Microsoft 365 Service health status page (but this only works if the Microsoft login services are working.) Documentation around how to check the service status is available as part of the official docs.
For Azure-related issues you can check the official Azure Support Twitter account or the Azure status page.
If the issue is localised - then you should raise a support ticket in Azure or Office 365, otherwise wait for a resolution from Microsoft.

MS Graph Search Custom Connector is not synchronized

Recently Microsoft published the Microsoft Search API (beta) which provides the possibility to index external systems by creating a MS Graph search custom connector.
To achieve this I created 2 Search Custom Connectors:
one according to Microsoft Graph Search Connector Sample from GitHub
and one on my own, step by step according to the official MS instructions
Create the Connector app in Azure
Add app registration (Single tenant)
Add required API permissions and give admin consent
Add a client secret
Get access token (via Postman)
Get the required parameters from app registration
Submit a login request to get the (bearer) token
Create a new connection (via Postman)
Registering a schema (via Postman)
Add items to the search index (via Postman)
Both variants worked well so far but if I now try a search (for example via Bing (activated for our O365 tenant, or in the Microsoft Search Center, logged in as the appropriate account) no results from the custom connectors are shown.
Via Graph Explorer, logged in as the appropriate account and using the query https://graph.microsoft.com/beta/search/query, I get an http status 500 ("InternalServerError", "The call failed, please try again."): Screenshot from Graph Explorer
Under > Microsoft 365 admin center > Microsoft Search > Connectors both connectors are displayed but there is displayed neither any status nor any successful synchronisation: screenshot from MS 365 Search admin center
I know the Microsoft Search API in still in preview but I wonder if it works at all?
Is there any possibility to trigger the synchronisation manually?
Or at least find out what's going wrong here?
Did you create a new Result Type and Vertical as well in the Search center?
I followed the steps mentioned in the sample and the search works for me in Office 365.
Regarding the synchronization, I don't think that is available in the Search center as of now because there is no option to edit the connection or set any synchronization schedule. However, I'm still exploring other options to synchronize as its quite new to me.

Resources