title: Office 365 api in PHP
body: <p>I'm trying to make an calendar view for my company to show which employees are available. I made an app in Azure, I can logon in to the system, I get an access token, but I can't get information.</p>
  
  <p>I build the request url using curl and send this header with my request</p>
  
  <pre><code>array(6) {
   [0]=&gt;
    string(28) "User-Agent: php-tutorial/1.0"
    [1]=&gt;
    string(588) "Authorization: Bearer ~ACCESS_TOKEN~"
    [2]=&gt;
    string(24) "Accept: application/json"
    [3]=&gt;
    string(55) "client-request-id: ~GUID~"
    [4]=&gt;
    string(30) "return-client-request-id: true"
    [5]=&gt;
    string(45) "X-AnchorMailbox: ~MAIL~"
  }
  </code></pre>
  
  <p>And all I get as a response is: " "</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After logging in, Microsoft does not ask if i want to grant access to the app, but it does grant me an access token. Could this be the problem? And how can I make it ask for permission?</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>After logging in and trying to get information, I get a 401 Error saying: Access denied. Which is strange I think cause it already granted me an access token.</p>
  
  <p><strong>UPDATE 3</strong></p>
  
  <p>Couple days further and I have tried some example and tutorial code to check if it works. But even in these apps the api seem not to work.
  These are the projects I have tried.</p>
  
  <p><a href="https://github.com/microsoftgraph/php-connect-rest-sample" rel="nofollow">https://github.com/microsoftgraph/php-connect-rest-sample</a></p>
  
  <p><a href="https://dev.outlook.com/restapi/tutorial/php" rel="nofollow">https://dev.outlook.com/restapi/tutorial/php</a></p>