PHPackages                             microsoft/microsoft-graph-beta - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. microsoft/microsoft-graph-beta

ActiveLibrary[API Development](/categories/api)

microsoft/microsoft-graph-beta
==============================

The Microsoft Graph Beta SDK for PHP

v3.2.0(1mo ago)1486.6k↓15.1%6[4 issues](https://github.com/microsoftgraph/msgraph-beta-sdk-php/issues)[4 PRs](https://github.com/microsoftgraph/msgraph-beta-sdk-php/pulls)1MITPHPPHP ^8.2CI passing

Since Oct 29Pushed 3d ago14 watchersCompare

[ Source](https://github.com/microsoftgraph/msgraph-beta-sdk-php)[ Packagist](https://packagist.org/packages/microsoft/microsoft-graph-beta)[ Docs](https://developer.microsoft.com/en-us/graph)[ RSS](/packages/microsoft-microsoft-graph-beta/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (6)Versions (106)Used By (1)Security (1)

Get started with the Microsoft Graph Beta SDK for PHP
=====================================================

[](#get-started-with-the-microsoft-graph-beta-sdk-for-php)

[![Build Status](https://github.com/microsoftgraph/msgraph-beta-sdk-php/actions/workflows/pr-validation.yml/badge.svg)](https://github.com/microsoftgraph/msgraph-beta-sdk-php/actions/workflows/pr-validation.yml/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/f83b8acbba1b385061c1210e52b2d91342e60269f9956a464726c2628cb48411/68747470733a2f2f706f7365722e707567782e6f72672f6d6963726f736f66742f6d6963726f736f66742d67726170682d626574612f76657273696f6e)](https://packagist.org/packages/microsoft/microsoft-graph-beta)[![Total Downloads](https://camo.githubusercontent.com/49e3941beb6ed0052427a7fa15307afe991b8908c65491537d0647b9590a7976/687474703a2f2f706f7365722e707567782e6f72672f6d6963726f736f66742f6d6963726f736f66742d67726170682d626574612f646f776e6c6f616473)](https://packagist.org/packages/microsoft/microsoft-graph-beta)[![PHP Version Require](https://camo.githubusercontent.com/31aede9c44037584ef3133b25a88393f0e344595b21d9eecd05127c10103ef7f/687474703a2f2f706f7365722e707567782e6f72672f6d6963726f736f66742f6d6963726f736f66742d67726170682d626574612f726571756972652f706870)](https://packagist.org/packages/microsoft/microsoft-graph-beta)

Install the SDK
---------------

[](#install-the-sdk)

You can install the Beta PHP SDK with Composer by editing your `composer.json` file:

```
{
    "require": {
         // x-release-please-start-version
        "microsoft/microsoft-graph-beta": "^3.2.0"
         // x-release-please-end
    }
}

```

Get started with Microsoft Graph
--------------------------------

[](#get-started-with-microsoft-graph)

### Register your application

[](#register-your-application)

Register your application to use the Microsoft Graph API using [Microsoft Azure Active Directory](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade) in your tenant's Active Directory to support work or school users for your tenant, or multiple tenants.

### Create a Token Request Context

[](#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: `client_credentials`, `authorization_code` and `on_behalf_of` with support for secret-based and certificate-based client authentication.

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](https://docs.microsoft.com/en-us/graph/auth-v2-service?context=graph%2Fapi%2F1.0&view=graph-rest-1.0):

```
