title: Get SharePoint folders and docs using Microsoft Graph API
body: <p>I'm trying to get the folders and documents from a SharePoint document library using Microsoft Graph API.</p>
  
  <p>If I do a <code>GET</code> request for <code>https://graph.microsoft.com/v1.0/sites/mysite.sharepoint.com:/sites/MyDocumentSite:/drives/</code>, I get this back:</p>
  
  <pre><code>{
      "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
      "value":[
          {
              "createdDateTime": "2019-09-05T07:09:49Z",
              "description": "",
              "id": "b!wxh2ZWwoT0KKTdLRYjD5jvzjo8jkat5LgY3VyfgEqkv3YVg_XXXXXXXXXXXXXXXX",
              "lastModifiedDateTime": "2019-09-05T07:09:49Z",
              "name": "Documents",
              "webUrl": "https://mysite.sharepoint.com/sites/MyDocumentSite/Shared%20Documents",
              "driveType": "documentLibrary",
              "createdBy":{"user":{"displayName": "System Account" }},
              "lastModifiedBy":{"user":{"email": "me@myorganization.org", "id": "73f9990c-5c92-4839-8b13-XXXXXXXXXXXX", "displayName": "John Smith"…},
              "quota":{"deleted": 0, "remaining": 0, "total": 0, "used": 0}
          }
      ]
  }
  </code></pre>
  
  <p>But if I try to access that drive by doing a <code>GET</code> request on that id: <code>https://graph.microsoft.com/v1.0/sites/mysite.sharepoint.com:/sites/MyDocumentSite:/drives/b!wxh2ZWwoT0KKTdLRYjD5jvzjo8jkat5LgY3VyfgEqkv3YVg_XXXXXXXXXXXXXXXX</code>, I get a BadRequest error:</p>
  
  <pre><code>{
      "error":{
          "code": "BadRequest",
          "message": "Url specified is invalid.",
          "innerError":{
              "request-id": "7c9eaf61-764f-4d72-abdb-ffa2fe868e90",
              "date": "2019-09-16T19:09:41"
          }
      }
  }
  </code></pre>
  
  <p>Ultimately, I want a way to display all folders and documents from the document library but I can't seem to get past this initial step.</p>