<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jake</title>
    <description>The latest articles on DEV Community by jake (@otjake).</description>
    <link>https://dev.to/otjake</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F686899%2F0735b9dc-80d7-4319-ad9b-892728ece5d3.jpeg</url>
      <title>DEV Community: jake</title>
      <link>https://dev.to/otjake</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/otjake"/>
    <language>en</language>
    <item>
      <title>Treasure Hunt: Digging Up Files in SharePoint</title>
      <dc:creator>jake</dc:creator>
      <pubDate>Sun, 30 Mar 2025 06:36:57 +0000</pubDate>
      <link>https://dev.to/otjake/treasure-hunt-digging-up-files-in-sharepoint-i4f</link>
      <guid>https://dev.to/otjake/treasure-hunt-digging-up-files-in-sharepoint-i4f</guid>
      <description>&lt;p&gt;It probably took me more time to find a banner for this article than it did to actually write it 😅.&lt;/p&gt;

&lt;p&gt;That said, this guide is exactly what I wish I had when I first set out on the quest of &lt;strong&gt;finding a file in SharePoint via API&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Backstory:&lt;br&gt;
I work at a company that processes stuff synonymous to orders(Insurance Claims) in large volumes, so we use forms to create these orders. Users being users, someone suggested we allow bulk uploading of orders via spreadsheets — because of times they had thousands of backlogged orders. That feature was built and is still in use (amazing mental gymnastics, by the way).&lt;/p&gt;

&lt;p&gt;But of course, evil users were not satisfied, pitch forks were raised.&lt;br&gt;
Then one user requested:&lt;br&gt;
"Why can't i just add only the names/ids of my invoices  to the spreadsheet, then your code fetch the invoice file (PDF) from our storage, extract its content, and automatically create the order?"&lt;/p&gt;

&lt;p&gt;We thought, sure, that’s reasonable.&lt;br&gt;
If your invoices are on S3 or Google Drive — easy!&lt;br&gt;
But nooo… they’re on SharePoint.&lt;br&gt;
And that’s where the ordeal begins.&lt;/p&gt;

&lt;p&gt;We will be navigating this maze using any HTTP request client you are familiar with(I used postman) and &lt;strong&gt;Microsoft Graph&lt;/strong&gt; — the API suite for accessing Microsoft 365 resources like Outlook, Teams, and OneDrive.&lt;br&gt;
SharePoint’s included, of course… just hidden behind ten layers of abstraction and some minor heartbreak.&lt;/p&gt;

&lt;p&gt;As of the time of this writing, we’re able to fetch files directly using either their file ID or file name by making an authenticated HTTP request to one of the following endpoints:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A. Fetch By File ID&lt;/strong&gt; -: &lt;a href="https://graph.microsoft.com/v1.0/sites/%7BSite" rel="noopener noreferrer"&gt;https://graph.microsoft.com/v1.0/sites/{Site&lt;/a&gt; ID}/drives/{DRIVE ID}/items/{File ID}/content&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B. Fetch By File name.ext&lt;/strong&gt; -: &lt;a href="https://graph.microsoft.com/v1.0/sites/%7BSite" rel="noopener noreferrer"&gt;https://graph.microsoft.com/v1.0/sites/{Site&lt;/a&gt; ID}/drives/{DRIVE ID}/root/children/{file_name.ext}/content&lt;/p&gt;

&lt;p&gt;This article will outline the steps required to retrieve the components that make up the endpoints mentioned above:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; User Management on SharePoint(with the help of another article).&lt;/li&gt;
&lt;li&gt; Obtaining an authentication token.&lt;/li&gt;
&lt;li&gt; Retrieving your Site ID and Drive ID.&lt;/li&gt;
&lt;li&gt; Might Add Folder ID.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before Jumping in, here is an helpful visualization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn8pph98imyiius7dprh8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn8pph98imyiius7dprh8.png" alt="Hierachy Image text" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkbsvk9hpms92mco1j4o5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkbsvk9hpms92mco1j4o5.png" alt="Hierachy Image" width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;A. USER MANAGEMENT&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Like every other big corp (Google, AWS, even you), access management and documentation was a nightmare.&lt;/p&gt;

&lt;p&gt;Thankfully, with help from my manager, we found this &lt;a href="https://techcommunity.microsoft.com/blog/spblog/develop-applications-that-use-sites-selected-permissions-for-spo-sites-/3790476" rel="noopener noreferrer"&gt;link&lt;/a&gt; that walks through the steps to set up an application user with app-only permissions.&lt;/p&gt;

&lt;p&gt;In short, this setup allows you to authenticate via the API using expirable tokens — without needing a real user to log in.&lt;/p&gt;

&lt;p&gt;Once you successfully create the app user on SharePoint, you’ll get the following credentials:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANT&lt;/strong&gt;&lt;br&gt;
Display name: user/app name&lt;br&gt;
Client Id: d806f38b-a107*&lt;strong&gt;&lt;em&gt;-1ec8e90c8ccc&lt;br&gt;
Client Secret: XZW8Q&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;855JDEw1cxP&lt;br&gt;
Tenant ID: 31&lt;/strong&gt;******95c59c1b&lt;br&gt;
Scope: &lt;a href="https://graph.microsoft.com/.default" rel="noopener noreferrer"&gt;https://graph.microsoft.com/.default&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🔑 What each of these parameters means:
   1. client_id
      This is the public identifier for the application that's 
      requesting access, It’s issued when the app is registered 
      in Azure Active Directory (Azure AD).

   2. scope
      Defines the level of access your app is requesting.
      https://graph.microsoft.com/.default means:

      "Give this app the default permissions it was granted for 
       Microsoft Graph in Azure AD.".

   3. client_secret
      This is the private key used along with the client_id to 
      authenticate the app, It’s like a password—keep it secret!

   4. grant_type
      Specifies the OAuth 2.0 flow being used, In our case, 
      "client_credentials" means:
      "This is a server-to-server (no user involved) 
       authentication. Just authenticate my app."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;B. AUTHENTICATION&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;To access any of the endpoints needed to retrieve file details, you'll first need an authentication token.&lt;/p&gt;

&lt;p&gt;This token is valid for about 10-15 minutes, after which you'll need to request a new one.&lt;br&gt;
To generate the token, you’ll make an http request to an endpoint that requires your Tenant ID — one of the key credentials obtained from &lt;strong&gt;step A&lt;/strong&gt; above.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Auth Endpoint -: https://login.microsoftonline.com/Tenant 
   ID/oauth2/v2.0/token

2. Request Method -: POST

3. Request Body -: The request body is made up most of the 
   important details from 1: client_id, scope, client_secret, 
   grant_type
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg8esqj9wo3scjymsy5qg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg8esqj9wo3scjymsy5qg.png" alt="Requesting for auth token" width="800" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And on successful request you get the below details&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffhzsv4hvyhgrynhyvvr6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffhzsv4hvyhgrynhyvvr6.png" alt="Response for Requesting auth token" width="800" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt; Not sure why the token claims to expire in 59 minutes when it becomes invalid under 10-15 minutes. So, you’ll need to implement some sort of short-lived cache system (less than expiry minutes) to manage it more efficiently, requesting a new token when the one in your cache expires.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;C. LIST SITES&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Sites are the building blocks of the SharePoint storage system. They exist within a Tenant (a client-specific SharePoint host, e.g., client.sharepoint.com) and act as containers for content and collaboration.&lt;/p&gt;

&lt;p&gt;Think of each site like a mini intranet hub or project root folder — tailored for a specific team, project, or purpose.&lt;/p&gt;

&lt;p&gt;To get a list of your client’s sites, make the following request using the authentication token obtained in step 2 above:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Endpoint -: https://graph.microsoft.com/v1.0/sites/{Tenant Host Url}/sites?search=*

2. Request Method -: GET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqzaoa54v57mwsxmolmk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqzaoa54v57mwsxmolmk.png" alt="Site list request" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the request is successful, you should receive a list of all Sites within that Tenant — or at least those accessible directories under your app user's SharePoint storage.&lt;/p&gt;

&lt;p&gt;Response should look something like what’s shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
  "@odata.nextLink": "https://graph.microsoft.com/v1.0/sites/example.sharepoint.com/sites?search=*&amp;amp;$skiptoken=randomtoken123",
  "value": [
    {
      "createdDateTime": "2023-02-15T08:45:10Z",
      "id": "example.sharepoint.com,a1b2c3d4-e5f6-7890-ab12-34567890cdef,12345678-90ab-cdef-1234-567890abcdef",
      "lastModifiedDateTime": "2025-03-29T18:10:42.0000000Z",
      "name": "Project-Delta",
      "webUrl": "https://example.sharepoint.com/sites/Project-Delta",
      "displayName": "Project Delta",
      "root": {},
      "siteCollection": {
        "hostname": "example.sharepoint.com"
      }
    },
    {
      "createdDateTime": "2022-11-10T14:20:05Z",
      "id": "example.sharepoint.com,abcd1234-5678-90ef-gh12-3456ijklmnop,abcdef12-3456-7890-abcd-ef1234567890",
      "lastModifiedDateTime": "2025-03-28T11:05:29.1234567Z",
      "name": "Archive-Hub",
      "webUrl": "https://example.sharepoint.com/sites/Archive-Hub",
      "displayName": "Archive Hub (Legacy)",
      "root": {},
      "siteCollection": {
        "hostname": "example.sharepoint.com"
      }
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;D. Single Site Details&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Now let’s access the details of a specific Site — the one where the files/folders you need are actually stored.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   1. Endpoint -: https://graph.microsoft.com/v1.0/sites/{Tenant Host 
   Url}:/sites/{Site Name}

   2. Request Method -: GET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmw8bp467ekltvwpgdk40.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmw8bp467ekltvwpgdk40.png" alt="Single Site Detail Request" width="800" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Response&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites/$entity",
  "createdDateTime": "2023-09-15T10:30:00Z",
  "description": "Internal document hub",
  "id": "example.sharepoint.com,abcd1234-5678-90ef-abcd-1234567890ef,12345678-abcd-90ef-1234-abcdef123456",
  "lastModifiedDateTime": "2025-03-28T13:00:00Z",
  "name": "internaldocshub",
  "webUrl": "https://example.sharepoint.com/sites/internaldocshub",
  "displayName": "Internal Docs Hub",
  "root": {},
  "siteCollection": {
    "hostname": "example.sharepoint.com"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What we need from this detail is the site 'id' value,&lt;br&gt;
   &lt;strong&gt;"id"&lt;/strong&gt;: "example.sharepoint.com,abcd1234-5678-90ef-abcd- &lt;br&gt;
   1234567890ef,12345678-abcd-90ef-1234-abcdef123456",&lt;/p&gt;

&lt;p&gt;Site Name – This refers to the value of the "name" field assigned to each site for identification. (It usually has no spaces.)&lt;/p&gt;

&lt;p&gt;It’s one of the key reasons we made the endpoint call in &lt;strong&gt;Step C&lt;/strong&gt; — to retrieve this value programmatically.&lt;/p&gt;

&lt;p&gt;However, in most cases, you can also see the Site Name directly from the web URL when browsing SharePoint through the web interface.&lt;/p&gt;

&lt;p&gt;So, calling the endpoint in &lt;strong&gt;Step C&lt;/strong&gt; is optional if you already have this detail handy.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;E. List Drives&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Inside each Site is a list of Drives — think of them as document libraries or top-level folders. These drives contain the directories and files you're ultimately looking for.&lt;/p&gt;

&lt;p&gt;To get a list of Drives for the siteId obtained in &lt;strong&gt;step D&lt;/strong&gt;, make the following request using the authentication token from &lt;strong&gt;step B&lt;/strong&gt;:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Endpoint -: https://graph.microsoft.com/v1.0/sites/{Site ID FROM STEP D}/drives.

2. Request Method -: GET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0sr6gtgtro3zl5n0p2ht.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0sr6gtgtro3zl5n0p2ht.png" alt="List drive request" width="800" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the request is successful, you’ll get a list of all Drives for that Site — as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
  "value": [
    {
      "createdDateTime": "2023-10-15T18:22:32Z",
      "description": "",
      "id": "b!abc123xyzFakeDriveID5678",
      "lastModifiedDateTime": "2025-01-10T09:47:50Z",
      "name": "Documents",
      "webUrl": "https://example.sharepoint.com/sites/internaldocshub/Shared%20Documents",
      "driveType": "documentLibrary",
      "createdBy": {
        "user": {
          "displayName": "System Account"
        }
      },
      "lastModifiedBy": {
        "user": {
          "displayName": "System Account"
        }
      },
      "owner": {
        "user": {
          "email": "owner@example.com",
          "id": "user-id-1",
          "displayName": "Site Admin"
        }
      },
      "quota": {
        "deleted": 0,
        "remaining": 6048973404507,
        "state": "normal",
        "total": 27487790694400,
        "used": 21438817289893
      }
    },
    {
      "createdDateTime": "2023-11-01T07:30:41Z",
      "description": "Library created for publishing resources used throughout the site.",
      "id": "b!def456uvwAnotherFakeDriveID91011",
      "lastModifiedDateTime": "2023-11-01T07:30:41Z",
      "name": "Site Collection Documents",
      "webUrl": "https://example.sharepoint.com/sites/internaldocshub/SiteCollectionDocuments",
      "driveType": "documentLibrary",
      "createdBy": {
        "user": {
          "email": "creator@example.com",
          "id": "user-id-2",
          "displayName": "Content Manager"
        }
      },
      "owner": {
        "user": {
          "email": "creator@example.com",
          "id": "user-id-2",
          "displayName": "Content Manager"
        }
      },
      "quota": {
        "deleted": 0,
        "remaining": 6048973404507,
        "state": "normal",
        "total": 27487790694400,
        "used": 21438817289893
      }
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What we need from this result is the id of the Drive that contains the file we’re looking for.&lt;/p&gt;

&lt;p&gt;Again, if you’ve navigated the SharePoint web interface before, you should be able to spot the Drive name or even the Drive ID directly within the websites url.&lt;/p&gt;

&lt;p&gt;Alternatively, you add the search url parameter (just like we did &lt;br&gt;
when fetching sites) to narrow it down, with the drive name(if you know it) or use a wild card (*), to see all.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;F. Items In A Drive&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Now that we have our Drive ID, we can go ahead and list the contents of that drive — including folders and individual items.&lt;/p&gt;

&lt;p&gt;This step is technically optional, especially if you already know the exact item you're looking for.&lt;/p&gt;

&lt;p&gt;But if you want to explore or locate specific files manually, here’s how you’d retrieve the contents:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  1. Endpoint -: _https://graph.microsoft.com/v1.0/sites/{Site ID FROM STEP D}/drives/{DRIVE ID FROM STEP E}/root/children_

   2. Request Method -: GET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxp4wko8bihkpqxk6rfzl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxp4wko8bihkpqxk6rfzl.png" alt="Request for items in a drive" width="800" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will give you a list of all items within the drive with the specified ID&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;G. Fetch Specific File&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Finally, we can fetch the file we need.&lt;/p&gt;

&lt;p&gt;There are two ways to do this as stated earlier, using two different endpoints, depending on what details you have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Fetch By File ID -: https://graph.microsoft.com/v1.0/sites/{Site 
     ID FROM STEP D}/drives/{DRIVE ID FROM STEP E}/items/{File ID 
     FROM STEP F}/content
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7vxvsguz1kc4p714sv69.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7vxvsguz1kc4p714sv69.png" alt="Fetch file by ID request" width="800" height="548"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  - Fetch By File name.ext -: https://graph.microsoft.com/v1.0/sites 
     /{Site ID FROM STEP D}/drives/{DRIVE ID FROM STEP E}/root/children/{file_name.ext}/content
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9j6wm5xv2uxlbugih81.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9j6wm5xv2uxlbugih81.png" alt="Fetch file by name" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both endpoints use the GET method and will fetch you the actual file &lt;/p&gt;

&lt;p&gt;Now, you might be thinking: “Surely the AI agents could’ve helped here?”&lt;/p&gt;

&lt;p&gt;Brothers and sisters — we tried.&lt;/p&gt;

&lt;p&gt;Some were leading me astray,&lt;br&gt;
Others gave redacted endpoints,&lt;br&gt;
And a few just dropped the endpoints without proper scopes or clear guidance on how to get the components needed.&lt;/p&gt;

&lt;p&gt;Most required a dozen more prompts to make any sense.&lt;/p&gt;

&lt;p&gt;So, in the event that you do manage to get the correct endpoints, I hope this breakdown helps explain how to actually assemble and use them — without losing your mind in the process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OTHER HELPFUL ENDPOINTS&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;List Folders&lt;/strong&gt; -: &lt;a href="https://graph.microsoft.com/v1.0/sites/%7BSite" rel="noopener noreferrer"&gt;https://graph.microsoft.com/v1.0/sites/{Site&lt;/a&gt; ID &lt;br&gt;
FROM STEP D}/lists/&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;List Folder Contents&lt;/strong&gt; -: &lt;br&gt;
&lt;a href="https://graph.microsoft.com/v1.0/sites/%7BSite" rel="noopener noreferrer"&gt;https://graph.microsoft.com/v1.0/sites/{Site&lt;/a&gt; ID FROM STEP &lt;br&gt;
D}/lists/{Folder ID}/items&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Meta Data Of A File In A Drive&lt;/strong&gt; -: &lt;br&gt;
&lt;a href="https://graph.microsoft.com/v1.0/drives/%7BDRIVE" rel="noopener noreferrer"&gt;https://graph.microsoft.com/v1.0/drives/{DRIVE&lt;/a&gt; ID FROM STEP &lt;br&gt;
E}/root/search(q='file_name.pdf')&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;REFERENCED RESOURCES&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/answers/questions/601256/downloading-file-from-sharepoint-site-folder-using" rel="noopener noreferrer"&gt;Helpful Link&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/76176010/download-file-from-secure-sharepoint-using-rest-api-audienceurivalidationfaile" rel="noopener noreferrer"&gt;Another Helpful Link&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>sharepoint</category>
      <category>beginners</category>
    </item>
    <item>
      <title>HNGI8 GOALS</title>
      <dc:creator>jake</dc:creator>
      <pubDate>Sun, 15 Aug 2021 22:04:11 +0000</pubDate>
      <link>https://dev.to/otjake/hngi8-goals-4ebp</link>
      <guid>https://dev.to/otjake/hngi8-goals-4ebp</guid>
      <description>&lt;p&gt;&lt;b&gt;WHAT IS HNG&lt;/b&gt;&lt;br&gt;
HNG is an acronym for &lt;em&gt;Hotels.ng&lt;/em&gt;,Hotels.ng is a Nigerian online hotels booking agency which was launched in 2013. The platform was founded by Mark Essien ,they offer an Internship with the ambitious attempt to change the way education is done in Africa, utilizing technology with a well proven education system of learning to mentor interns and help them grow which in turn advances the ecosystem&lt;/p&gt;

&lt;p&gt;&lt;b&gt;The HNG INTERNSHIP&lt;/b&gt;&lt;br&gt;
The HNG internship is a 3-month remote internship designed to find and develop the most talented software developers. Everyone is welcome to participate (there is no entrance exam). Anyone can register either via a link from the &lt;a href="https://zuri.team/"&gt;zuri team&lt;/a&gt; or other media platforms&lt;/p&gt;

&lt;p&gt;&lt;b&gt;MY GOALS&lt;/b&gt;&lt;br&gt;
After participating in the &lt;a href="https://internship.zuri.team/"&gt;zuri internship&lt;/a&gt;,as a &lt;em&gt;PHP backend developer&lt;/em&gt;, enrolling in the HNG internship feels like I joined the big leagues of internships(lol),which is the reason I aim to do big league things to make myself a better developer so as to build apps that help my community at large, these include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Be better as a lone software developer, from researches down to writing well structured code.&lt;/li&gt;
&lt;li&gt;Be able to efficiently work with a group towards a common goal&lt;/li&gt;
&lt;li&gt;Improve my versatility with various frameworks and languages&lt;/li&gt;
&lt;li&gt;Have fun and connect&lt;/li&gt;
&lt;li&gt;Ultimately get the &lt;b&gt;shirt&lt;/b&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;b&gt;Some useful Tutorial links&lt;/b&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Figma: &lt;a href="https://trydesignlab.com/figma-101-course/introduction-to-figma/"&gt;https://trydesignlab.com/figma-101-course/introduction-to-figma/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Github: &lt;a href="https://www.youtube.com/watch?v=3RjQznt-8kE&amp;amp;list=PL4cUxeGkcC9goXbgTDQ0n_4TBzOO0ocPR"&gt;https://www.youtube.com/watch?v=3RjQznt-8kE&amp;amp;list=PL4cUxeGkcC9goXbgTDQ0n_4TBzOO0ocPR&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;HTML:
- &lt;a href="https://www.youtube.com/watch?v=UB1O30fR-EE"&gt;https://www.youtube.com/watch?v=UB1O30fR-EE&lt;/a&gt;
&lt;p&gt;- for reading &lt;a href="https://www.w3schools.com/html/default.asp"&gt;https://www.w3schools.com/html/default.asp&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;PHP:
- &lt;a href="https://www.youtube.com/watch?v=UB1O30fR-EE"&gt;https://www.youtube.com/watch?v=UB1O30fR-EE&lt;/a&gt;
&lt;p&gt;- and if you prefer reading &lt;a href="https://www.w3schools.com/php/default.asp"&gt;https://www.w3schools.com/php/default.asp&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;PYTHON:
- &lt;a href="https://www.youtube.com/watch?v=Ozrduu2W9B8&amp;amp;list=PL4cUxeGkcC9idu6GZ8EU_5B6WpKTdYZbK"&gt;Video tutorial&lt;/a&gt;
&lt;p&gt;- for the readers &lt;a href="https://www.w3schools.com/python/default.asp"&gt;A written help&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>hng</category>
      <category>internship</category>
      <category>software</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
