title: Microsoft Graph API - User response JSON not complete
body: <p>The company I work for needs to develop an API that will export Office 365 contacts and import them into our user profile's contacts. This runs as some sort of daemon.</p>
  
  <p>I found Microsoft's Graph API and been working on it for days to get it running, but the GET contacts function doesn't seem to work for me.</p>
  
  <p>I'm using the resource <code>graph.microsoft.com</code> and trying to get contacts with 
  <code>/users/{id}/contacts</code> using PHP cURL.</p>
  
  <pre><code>stdClass Object
  (
      [error] =&gt; stdClass Object
          (
              [code] =&gt; ResourceNotFound
              [message] =&gt; Resource could not be discovered.
              [innerError] =&gt; stdClass Object
                  (
                      [request-id] =&gt; 134b1964-9421-4fce-84ba-aca1525c705e
                      [date] =&gt; 2017-03-20T15:35:39
                  )
  
          )
  
  )
  </code></pre>
  
  <p>I'm getting an access token just fine (my app currently requests all read/write permissions to avoid being stuck because of missing privileges and they have been consented to by an admin account).</p>
  
  <p>I've found out that the reason to this is probably because the User response JSON isn't completely formatted as it's supposed to be. <a href="https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/user#json-representation" rel="nofollow noreferrer">Microsoft's Documentation</a> shows a full representation of the User resource. Mine seems to be missing all the relationships with other resources, like "contacts" that I need. Here's the JSON I get from the Graph API using <code>/users/{id}</code>:</p>
  
  <pre><code>stdClass Object
  (
      [@odata.context] =&gt; https://graph.microsoft.com/beta/$metadata#users(contacts)/$entity
      [id] =&gt; e4007399-90fb-489d-a0f8-2c577f219638
      [accountEnabled] =&gt; 1
      [assignedLicenses] =&gt; Array
          (
          )
  
      [assignedPlans] =&gt; Array
          (
          )
  
      [businessPhones] =&gt; Array
          (
          )
  
      [city] =&gt; 
      [companyName] =&gt; 
      [country] =&gt; 
      [department] =&gt; 
      [displayName] =&gt; Loic Didelot
      [givenName] =&gt; Loic
      [jobTitle] =&gt; 
      [mail] =&gt; 
      [mailNickname] =&gt; vendors_mixvoip.com#EXT#
      [mobilePhone] =&gt; 
      [onPremisesDomainName] =&gt; 
      [onPremisesImmutableId] =&gt; 
      [onPremisesLastSyncDateTime] =&gt; 
      [onPremisesSecurityIdentifier] =&gt; 
      [onPremisesSamAccountName] =&gt; 
      [onPremisesSyncEnabled] =&gt; 
      [onPremisesUserPrincipalName] =&gt; 
      [passwordPolicies] =&gt; 
      [passwordProfile] =&gt; 
      [officeLocation] =&gt; 
      [postalCode] =&gt; 
      [preferredLanguage] =&gt; 
      [provisionedPlans] =&gt; Array
          (
          )
  
      [proxyAddresses] =&gt; Array
          (
          )
  
      [refreshTokensValidFromDateTime] =&gt; 2017-03-14T09:13:10Z
      [showInAddressList] =&gt; 
      [imAddresses] =&gt; Array
          (
          )
  
      [state] =&gt; 
      [streetAddress] =&gt; 
      [surname] =&gt; Didelot
      [usageLocation] =&gt; 
      [userPrincipalName] =&gt; vendors_mixvoip.com#EXT#@vendorsmixvoip.onmicrosoft.com
      [userType] =&gt; Member
  )
  </code></pre>
  
  <p>I haven't been able to find how to solve this, when I try searching for this problem, I get results for "custom properties" that can be selected by using <code>/users/{id}?$select=customPropertyName</code>. This doesn't work for <code>/users/{id}?$select=contacts</code>.</p>
  
  <p>Thanks in advance for your help.</p>