This is our last article of 3 parts about Microsoft Graph API. In the first article, Microsoft Graph API – An Introduction, we had a quick overview of the Graph API and how it evolved from the Office Graph API. We also talked about what you need to know about setting up your endpoint API and tokens to build your custom solutions.
In part 2, Microsoft Graph API – Bringing it together, we showed you the structure of the Graph API that are composed of four layers: Data, Authentication and Authorization, Development Environment, and Solutions Layers. We also reviewed the importance of Active Directory and how organizations have started to build applications on the Graph API.
In this article, we will go a bit deeper in developing queries and syntax with the platform.
Common Microsoft Graph Queries
Microsoft Graph API is currently available for preview only with two endpoint versions. The first addresses users, groups, contacts, calendars, mail, and files. The endpoint is https://graph.microsoft.com/v1.0 and is available for your production environment. The second addresses tasks, people, OneNote, Excel, contacts (organization). The endpoint is https://graph.microsoft.com/beta and is available for preview.
Microsoft Graph API v1.0
Common queries that can be used to access the Microsoft Graph API is as follows:
|
Operation |
Service endpoint |
|
GET my profile |
https://graph.microsoft.com/v1.0/me |
|
GET my files |
https://graph.microsoft.com/v1.0/me/drive/root/children |
|
GET my photo |
https://graph.microsoft.com/v1.0/me/photo/$value |
|
GET my mail |
https://graph.microsoft.com/v1.0/me/messages |
|
GET my high importance email |
https://graph.microsoft.com/v1.0/me/messages?$filter=importance%20eq%20'high' |
|
GET my calendar |
https://graph.microsoft.com/v1.0/me/calendar |
|
GET my manager |
https://graph.microsoft.com/v1.0/me/manager |
|
GET last user to modify file foo.txt |
https://graph.microsoft.com/v1.0/me/drive/root/children/foo.txt/lastModifiedByUser |
|
GET unified groups I’m member of |
https://graph.microsoft.com/v1.0/me/memberOf/$/microsoft.graph.group?$filter=groupTypes/any(a:a%20eq%20'unified') |
|
GET users in my organization |
https://graph.microsoft.com/v1.0/users |
|
GET group conversations |
https://graph.microsoft.com/v1.0/groups/<id>/conversations |
Source: https://graph.microsoft.io/en-us/docs
Microsoft Graph API Beta
Queries that are available in the beta version are as follows, but is important to note that they are in beta and it is not suggested that these be applied in the production environment:
|
Operation |
Service endpoint |
|
GET people related to me |
https://graph.microsoft.com/beta/me/people |
|
GET files trending around me |
https://graph.microsoft.com/beta/me/trendingAround |
|
GET people I am working with |
https://graph.microsoft.com/beta/me/workingWith |
|
GET my tasks |
https://graph.microsoft.com/beta/me/tasks |
|
GET my notes |
https://graph.microsoft.com/beta/me/notes/notebooks |
Source: https://graph.microsoft.io/en-us/docs
Syntax Patterns
For developers, the syntax patterns, at this time of publication, are as follows:
1. Microsoft Graph API Endpoint:
{Graph Endpoint} https://graph.microsoft.com
2. Target Service Version:
{Version} such as v1.0 or beta
3. Tenant Name or Specific Entities:
{Tenants} such as users, groups, files
4. Particular Item from Entity Set:
{Id} such as single user and file
5. Specific Property of Particular Object Selected from Entity Set:
{Property}
Query Parameters
Microsoft Graph API supports the following query options which allow you to specify and control the amount of data that is returned in a response:
By applying custom queries and setting specific parameters, Microsoft Graph API can be customized to provide tailored solutions to your corporation on a platform of your choice, including Android, Windows, and iOS.
Microsoft Graph API is an excellent solution from Microsoft to meet the demands of businesses in today’s world of cloud computer based business. Flexible, seamless and efficient, Microsoft Graph API is the solution for obtaining aggregate data from various Microsoft cloud-based services including SharePoint, SharePoint Mobile, Office 365, Outlook, Calendar and social media apps such as Twitter and Yammer.
In our first Part, Microsoft Graph API – An Introduction, we reviewed the evolvement of Office Graph into Microsoft Graph API. We also looked at the reasons as to why a change in process for accessing data was required. Next, we delved into how the transition of obtaining aggregate data from various cloud services with a complex system of individually specific APIs and multiple tokens became one singular endpoint API and one token. Customizing app solutions has become easier with a single endpoint API, and the possibility to provide these solutions in Windows, Android, and iOS platforms is becoming a reality with the move to open source developer tools.
The Structure of Microsoft Graph API Developer Stack
In order to develop applications based on Microsoft Graph API, a basic understanding of the developer stack in needed. There are four layers:
1. Data Layer:
Office Graph and Microsoft Graph API reside in this layer. Information regarding people, emails, notes, documents and relationships with each other is delivered from this layer.
2. Authorization and Authentication Layer:
Authorization and authentication use OpenID Connect and OAuth2.0 to perform these functions.
3. Development Environment Layer:
Software Development Kits (SDK) for Windows, iOS, and Android reside in this layer. Development tools such as Visual Studio, XCode, Eclipse, Android Studio and REST (Representational State Transfer) are available in this layer.
4. Solution Layer:
Your app or solution is deployed from this layer on either Microsoft Azure or on other hosting platforms such as LAMP and IIS while enabling the developer to use their choice of language such as .NET, JS, HTML, and Ruby depending upon the apps solution that is being targeted (Windows, Android or iOS).
This is best illustrated in the infographic below (source: https://graph.microsoft.io/en-us/docs).
Microsoft Graph API Developer Stack – Illustration
The Importance of the Microsoft Active Directory (AD)
Microsoft Active Directory (AD) is a structure used on computers and servers running a Windows operating system. The primary function of the AD is to store network, domain and user information, such as user accounts, passwords, and profiles, in a single, protected location.
The AD is only as useful as the information that has been submitted and entered. The importance of having a complete and accurate user profile is the key to successfully accessing user and business information. For many corporations, the AD is lacking substance and with the lack of key information, collaboration, communication, and efficiency is greatly decreased with collaboration tools such as SharePoint, Delve, and business processes built on flow. Achieving AD compliance has always been a challenge for organizations with the lack of Governance and AD maintenance. This particular issue is being addressed by Hyperfish.
Recognizing this as a point of need for businesses, Hyperfish was developed to achieve corporate compliance with each user by interactively engaging the user to complete the necessary information fields. Hyperfish monitors the AD, or the Azure Active Directory (AAD) for missing, incomplete or out of date information. After analysis, the system will then contact the user at the most appropriate time and method to elicit responses from the user to complete their profile. The user will be prompted with suggestions which are based on information gathered from email, social media, and other data sources. An AD that is complete will improve the quality and speed of communication between team members, and can be combined with Workflow, Office 365, SharePoint and SharePoint Mobile to maximize the effectiveness of collaboration.
The Microsoft Active Directory serves as the hub of corporate user information, allowing administrators to set rules and trusts according to teams and privileges and when populated correctly, provides pertinent information which ensures utmost proficiencies in collaboration and communication.
Our last part will be an in-depth look at the most common Microsoft Graph API queries, syntax standards and parameter settings in Microsoft Graph API – Customizing Queries for Results.
What is SharePoint Framework?
SharePoint Framework is a new page and web part model that provides full support for client-side SharePoint development with easy integration of SharePoint data and Microsoft Graph through open source tooling which enables the building of SharePoint customizations for mobile, on-prem, online and OneDrive for Business. With SharePoint Framework, modern web technologies and tools provide a development environment to build experiences and apps that are ready and mobile-ready from the start.
In the next 3 blog articles, I will be shedding some lights on the new Framework and how you can start preparing to adopt the new development platform.
SharePoint Framework is written in JavaScript which allows developers, both inside and outside of Microsoft, to use their preferred web developer tools to develop SharePoint and customized solutions. This is an incredible leap as this allows developers on any platform to extend SharePoint’s standard capabilities. In addition, SharePoint Framework accompanies the new SharePoint UX, which is designed for the world’s mobile-first, cloud-first communication era. By moving towards open source resources, not only has a new door for developers has been opened, but it is also creating a new relationship between developers and SharePoint, resulting in a complete win for the client.
By moving to open source, will SharePoint Framework solutions work on classic sites? The answer is simply this: eventually, on existing team sites, it will and on new modern team sites, yes it will. However, classic solutions will not work on the new modern team sites. Moving forward, it is highly advisable to become familiar with SharePoint Framework and the tools to prepare yourself when SharePoint Framework is released.
Let's talk Framework, Development and Scaffolding tools in my next article!
PowerApps is a powerful tool aimed at power users. Since teams use SharePoint lists to access, share and collaborate around structured data, PowerApps utilizes SharePoint lists as the data source. By bringing PowerApps, Flow and SharePoint together, capturing data and producing useable business apps is a natural progression for cross platform data integration.
PowerApps can be created on mobile (PowerApps Mobile), on the web (PowerApps Studio) or on-prem (On-Premises Data Gateway) and can be published on the web or on mobile. Not only can data be derived from SharePoint lists, but the data can also be derived from Excel files, Dynamics CRM record, custom APIs, Dropbox, Azure Blob, Azure Service Bus and a host of other sources. As with Flow, PowerApps does not require any coding on your part. PowerApps supplies a variety of templates which are customizable to your business needs. The business apps that you build can use the device’s capabilities such as the camera, pen control and GPS.
There is a major difference between Forms and PowerApps. The functionality and purpose of each is very different. Forms, which is currently under preview in the Education module, behaves very much like a questionnaire whereby the creator poses questions and the user will answer the questions in multiple choice style. For more details of how Forms works, please refer to my article Microsoft Forms in Office 365 and SharePoint 2016.
PowerApps, on the other hand, is not a questionnaire, but a business application which provides the user information that is derived from actual data via an app that is created with PowerApps and SharePoint lists. For example, from the SharePoint list view menu, you will have an option to create a PowerApp for this list. By initializing the Create PowerApp option, the PowerApps web designer will open in your web browser and the web designer will automatically create a default app for you based on the schema and data of that list. You can then customize the app to suit your business needs. These apps will show up as views and can be shared and launched from the SharePoint list.
By leveraging the functionality of PowerApps to build custom and mobile capable views of your existing lists and sharing them with your team, it further enhances the collaboration aspect of SharePoint. PowerApps is a cross-platform service and can run on all your devices, including Windows, Android, iOS and web browsers.
Microsoft continues to build upon the collaboration aspect of SharePoint and is integrating many of its services to strengthen collaboration amongst team members. SharePoint and Office 365 are continuing to become stronger applications with greater versatility and functionality with the integration of PowerApps.
Technology has advanced in leaps and bounds in recent years, but one of the issues has been how do we get all these different apps to talk to each other across different platforms? Is there a product that can be the seamless handshake between these apps? Absolutely! This is where Microsoft Flow steps in.
The integration of Flow with SharePoint addresses the issues of cross application action-reaction events, or IF this, then that scenarios. There is no need to write a single line of code to achieve this as Flow has templates integrated within it so creating and managing your flows are simple while saving you precious time to focus on more important tasks.
By integrating Flow as a workflow tool into SharePoint Online lists and libraries, Microsoft has achieved a powerhouse which is able to quickly deliver automated information with ease to your audiences on-prem or in the Cloud. The ability to automate and receive notifications, synchronize files and obtain data between your favorite apps and services provides you the ability to reach out beyond your intranet.
The templates that are currently included in Flow allow you to create workflows with 43 services, including Office 365, SharePoint, Facebook, Twitter, YouTube, Mail Chimp, One Drive, Dynamics CRM, Google Drive, Slack, Dropbox, Salesforce, SQL, GitHub, Wunderlist and Instagram. Microsoft has indicated that they will continue to add more services and templates as they continue to work with the integration of the two programs. One key feature, as with most Microsoft products, there is the option for community members to contribute their flow for other members to use.
Unlike SharePoint Designer, Flow does not require lists and items to be in one site. With Flow, it will search for your items no matter where they are stored in SharePoint, even if the site resides in different site collections or a different tenant. This provides the power to initiate and generate notifications based on events across your corporation to your targeted audience.
Not only does Flow and SharePoint reach out to your audience, your audiences’ actions reaches back to Flow. Every event that you have indicated as a trigger, whether it be the project name, a hashtag, or a person’s name, each generated notification is logged into a SharePoint list or an Excel file and each time your audience uses these triggers, it logs this information. The data can then be analyzed at a later time. Not only is this beneficial for analytics, but the ability to add a recurrent step for delivery of this data is built into Flow. The recurrence can be set to occur weekly, daily, hourly or as frequently as minutes and seconds.
Microsoft continues to integrate their products so there is more cohesion between their various applications and third party ware. In this case, the integration of Flow with SharePoint has provided greater accessibility for users and better analytics for the corporation all the while increasing productivity and lessening the workload.