Download the PHP package microsoft/microsoft-graph without Composer
On this page you can find all versions of the php package microsoft/microsoft-graph. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
More information about microsoft/microsoft-graph
Files in microsoft/microsoft-graph
Rated 2.86 based on 70 reviews
Informations about the package microsoft-graph
Get started with the Microsoft Graph SDK for PHP
Install the SDK
You can install the PHP SDK with Composer by editing your
Get started with Microsoft Graph
Register your application
Register your application to use the Microsoft Graph API using Microsoft Azure Active Directory in your tenant's Active Directory to support work or school users for your tenant, or multiple tenants.
Create a Token Request Context
A Token Request Context contains the credentials used to authenticate requests. The SDK supports various contexts that align with OAuth 2.0 flows:
on_behalf_of with support for secret-based and certificate-based client authentication.
Under the hood, the Token Request Context is passed to an authentication provider which fetches, caches and refreshes access tokens ensuring all requests are authenticated against the Microsoft Identity platform.
The following sample creates a TokenRequestContext that gets access without a user:
Note that your application will need to handle redirecting the user to the Microsoft Identity login page to get the
authorization_code that's passed into the
See for more on the
authorization_code grant flow.
Initialize a GraphServiceClient
Using the Token Request Context and optional scopes, a
GraphServiceClient can be initialised:
For more on Graph client configuration, see more examples
Call Microsoft Graph using the v1.0 endpoint and models
The following is an example that shows how to fetch a user from Microsoft Graph
Note: The SDK is designed to make async requests by default. Operations (
post()...) return a Promise. To get the result, call
wait()after the operation. Example:
Note that to calling
me() requires a signed-in user and therefore delegated permissions (obtained using the
Documentation and resources
- Microsoft Graph website
For detailed information on breaking changes, bug fixes and new functionality introduced during major upgrades, check out our Upgrade Guide
from the base directory.
View or log issues on the Issues tab in the repo.
Please read our Contributing guidelines carefully for advice on how to contribute to this repo.
Copyright and license
Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT license.