- SharePoint Development with the SharePoint Framework
- Jussi Roine Olli J??skel?inen
- 426字
- 2021-07-08 10:13:56
A quick primer on Microsoft Graph
Microsoft Graph is an ever-growing collection of APIs that can be uniformly accessed through a common contract. The idea with Microsoft Graph is that developers would only need to learn one set of authentication, authorization, and access models to access any kind of cloud-based service within Office 365. For now, Microsoft Graph does not provide parity for all SharePoint Online REST APIs, but it has a fairly good collection of modernized APIs developers may wish to use for their applications.
Using Microsoft Graph is essentially more helpful with Graph Explorer, which is a web-based tool for figuring out what data there is and where it lies. It can be accessed through the Microsoft Graph marketing page at https://graph.microsoft.io/, by clicking Graph Explorer on the top navigation:

You can try out the APIs in a demo tenant, or by clicking Sign in, you can access your real data. Keep in mind that the Graph Explorer is built and operated by Microsoft, but it's still a good idea to avoid logging in with your global admin account unless you absolutely and unconditionally trust the service.
After logging in and running the default query against Microsoft Graph, the /me/ object resolves to your current account's metadata:

To target the queries against my SharePoint Online site, I need to change queries from /v1.0/me/ to /beta/, as SharePoint Online APIs are still in beta for Microsoft Graph.
Under /beta, I can point my queries to /beta/sharePoint/ (note the lowercase 's', and capital 'P') and then to /beta/sharePoint/site/lists:

This returns a clean list formatted in JSON for us to use within our code. The purpose of the Graph Explorer is to allow the developer to rapidly test against live data and figure out the correct API queries.
Graph Explorer has an intellisense-style helper built-in, so when you're constructing your queries, you should see a small window popup and provide suggestions for the current query:

You are free to combine your calls to different APIs between SharePoint Online REST APIs, Microsoft Graph calls, and perhaps also the SOAP Web Services. In addition, you could also build your own custom APIs using Microsoft Azure API Apps, Azure Functions, and similar services. A good practice is to first check Microsoft Graph for your needs. If you find it lacking for your specific requirements, check the SharePoint Online REST APIs, and only if these do not provide you with the necessary functionality, consider building your own custom APIs.
- Java 開發從入門到精通(第2版)
- 工程軟件開發技術基礎
- HTML5 and CSS3 Transition,Transformation,and Animation
- Oracle JDeveloper 11gR2 Cookbook
- Linux操作系統基礎案例教程
- Python數據結構與算法(視頻教學版)
- 速學Python:程序設計從入門到進階
- CRYENGINE Game Development Blueprints
- .NET 4.0面向對象編程漫談:應用篇
- C# 7.1 and .NET Core 2.0:Modern Cross-Platform Development(Third Edition)
- Python高性能編程(第2版)
- IBM DB2 9.7 Advanced Application Developer Cookbook
- HTML5 and CSS3:Building Responsive Websites
- Visual Basic程序設計
- Drools 8規則引擎:核心技術與實踐