Using Microsoft Graph Search API in SPFx Web-Part? - sharepoint

I am trying to prototype the use of Microsoft's new MS Graph Search APIs in a SharePoint Framework (SPFx) Web-Part in SharePoint.
While configuring the web-part, I've updated the package-solution.json file to include the needed webApiPermissionRequests (see below screenshot):
However, after deploying the app to the SharePoint app catalog and attempting to authorize the web-part's permissions via SPO Admin Center > Advanced > API access, I am getting the following error:
Is this not yet supported?
Here's the error I see when performing the same approval via PowerShell:
FYI — I tried to use the microsoft-search tag as recommended by MS here at stack overflow, but it does not yet exist and I don't have the reputation here to add it.

Related

Access Sharepoint List from Teams Tab created using Teams toolkit

I am currently using Graph APIs to connect to share point list from the Teams tab(NOT SPFX TAB) that I created using Teams Toolkit. I would like to know if it's possible to use REST API or PNP library to connect to Share point list items other than Graph API.
Thanks.
You can directly use Sharepoint REST API in Teams Tab. Note that you need to update permission for Azure AD app and request for access token with proper permission with TeamsFx SDK to call Sharepoint REST API.

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.

SharePoint Framework AadHttpClient - operation is part of experimental feature

I'm trying to use the AadHttpClient library that comes with SPFx to connect to a custom API secured by an app registration in Azure AD.
However when I run the web part in the workbench, SharePoint Online (in the tenant _layouts) I get an error in the console saying that the feature is experimental.
Error: The requested operation is part of an experimental feature that is not supported in the current environment.
As far as I can make out from this article, it should be in general release.
When connecting to Azure AD-secured APIs, we recommend that you use the MSGraphClient and AadHttpClient classes, which are now generally available. For more information about the recommended models, see Connect to Azure AD-secured APIs in SharePoint Framework solutions and Use the MSGraphClient to connect to Microsoft Graph.
When I go to the API management page in SP Admin site I get a popup stating
***Access to Azure Active Directory resources using the SharePoint Framework will be available soon.
So I'm a bit confused.
I also get an error on the API management page saying..
A null value was found with the expected type 'Edm.String[Nullable=False]'. The expected type 'Edm.String[Nullable=False]' does not allow null values.
I also get the same error when I try in PowerShell running
Get-SPOTenantServicePrincipalPermissionRequests
I'm not 100% sure I understand the relevance of the API management page - does an admin need to approve just once for the web part then all users are good to go?
I was having the same issue. The github thread can be found here. What fixed it for me was adding the account I was using as a site collection admin.
Connect-SPOService
Set-SPOUser -Site https://TENANT-admin.sharepoint.com -IsSiteCollectionAdmin $True -LoginName yourLoginName

How to connect to sharepoint CRM document library with onedrive api?

We have sharepoint online with site CRM.
I use OneDrive SDK for iOS.
I can connect to main document library with onedrive api. I used usefull "github example" to configure it.
resourceId: https://{tenant}.sharepoint.com/
apiEndpoint: https://{tenant}.sharepoint.com/CRM/_api/v2.0
Web URL of this library is:
https://{tenant}.sharepoint.com/CRM/Shared Documents
This configuration is fine and works OK.
I have trouble with another document libraries on this site.
Dynamics CRM creates his own document libraries. For example Acccount.
I can open this library on Web. Browser URL is:
https://{tenant}.sharepoint.com/CRM/account/Forms/AllItems.aspx
But I'm not able to connect to this CRM library.
I tried simple ask for children account:
https://{tenant}.sharepoint.com/CRM/_api/v2.0/drive/items/root/children/account
This API request returns error 404.
I also modified apiEndpoint to:
https://{tenant}.sharepoint.com/CRM/account/_api/v2.0
Result is the same. Error 404 - Not found.
Help me with correct configuration please.
To be precise, your question is regarding SharePoint, not OneDrive or CRM.
Here's a reference to the REST endpoint for SharePoint: https://msdn.microsoft.com/en-us/library/office/jj860569.aspx
If you want the items in an account library, you can use the rest api like this:
https://tenant.sharepoint.com/crm/_api/web/lists/GetByTitle('Account')/items

Which set of APIs should be used for Office365 Sharepoint

Which set of APIs should be use to access Office365 sharepoint which includes both sharepoint2013 and sharepoint2016.
Have gone through the following APIs
1) Sharepoint2013 REST APIs(https://msdn.microsoft.com/en-us/library/office/jj860569.aspx).
2) OneDrive new APIs(https://github.com/OneDrive/onedrive-api-docs) through which we can access the Directory folder which contains directory and files. But the present focus of APIs are for OneDrive Personal and Business.
Apart from this is there any other APIs which can access the office365 sharepoint?
You could use SharePoint REST API to retrieve, update, and manage data in Sharepoint Online ,you could find code samples and videos from here.
With Graph API you could get files/users/groups ,but SharePoint sites and lists are not yet available via Microsoft Graph .
In addition ,you could also use SharePoint client object model (CSOM) to manage data in Sharepoint Online,please read below article:
Connect to SharePoint Online using Client Object Model

Resources