PHPackages                             adnanhussainturki/microsoft-api-php - 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. adnanhussainturki/microsoft-api-php

ActiveLibrary[API Development](/categories/api)

adnanhussainturki/microsoft-api-php
===================================

PHP Wrapper the Microsoft Graph API

0.04(2y ago)2760.1k—5.3%6[5 issues](https://github.com/AdnanHussainTurki/microsoft-api-php/issues)[1 PRs](https://github.com/AdnanHussainTurki/microsoft-api-php/pulls)MITPHPPHP &gt;=5.6

Since Feb 9Pushed 1y ago3 watchersCompare

[ Source](https://github.com/AdnanHussainTurki/microsoft-api-php)[ Packagist](https://packagist.org/packages/adnanhussainturki/microsoft-api-php)[ Docs](https://github.com/AdnanHussainTurki/microsoft-api-php)[ RSS](/packages/adnanhussainturki-microsoft-api-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

[![Artboard 1](https://private-user-images.githubusercontent.com/24974673/284172296-45affb56-79c6-43e2-b751-0b3f336eb2d9.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ2NTUxNDAsIm5iZiI6MTc3NDY1NDg0MCwicGF0aCI6Ii8yNDk3NDY3My8yODQxNzIyOTYtNDVhZmZiNTYtNzljNi00M2UyLWI3NTEtMGIzZjMzNmViMmQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzI3VDIzNDA0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE0YTcyMjQxYjg4NGI2MzcyYWJkNzUwZDgzZmJkOTJkZmM0OGZkNzQwMjRmOTRiYTdiOTUwYWQ2OWYzYjNjZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JGk1UVnHf40r--tsxWdSwh9FjN_yNKij3JenqAo3dsU)](https://private-user-images.githubusercontent.com/24974673/284172296-45affb56-79c6-43e2-b751-0b3f336eb2d9.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ2NTUxNDAsIm5iZiI6MTc3NDY1NDg0MCwicGF0aCI6Ii8yNDk3NDY3My8yODQxNzIyOTYtNDVhZmZiNTYtNzljNi00M2UyLWI3NTEtMGIzZjMzNmViMmQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzI3VDIzNDA0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE0YTcyMjQxYjg4NGI2MzcyYWJkNzUwZDgzZmJkOTJkZmM0OGZkNzQwMjRmOTRiYTdiOTUwYWQ2OWYzYjNjZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JGk1UVnHf40r--tsxWdSwh9FjN_yNKij3JenqAo3dsU)

Microsoft API PHP Wrapper
=========================

[](#microsoft-api-php-wrapper)

Microsoft provides its application registration via its server side of giant service service called Azure. In order to use its API and this wrapper you must need to register your own Microsoft App in Azure Portal.

### Installation

[](#installation)

You can install this library to your project via composer using the following command:

`composer require adnanhussainturki/microsoft-api-php`

### Authentication

[](#authentication)

Microsoft uses OAuth 2.0 meaning Access Token is the key to pull data from the Microsoft servers on behalf of the user for which access token is generated. Access token is generated only for the nodes for which the authenticated user allowed your app to.

These nodes are called as scopes which dictates what types of data and functions can the app perform on the behalf of the authenticated user (against her access token). You can get the applicable scopes, in this [document](https://docs.microsoft.com/en-us/graph/permissions-reference "document").

This wrapper also supports tenants. If you want users of only your organization (Azure) to use this app, you can use respective tenant otherwise common will work fine for general microsoft user authentication.

```
