# Integrate Microsoft Graph API into the Pega Knowledge Loader

**URL:** <https://forums.pega.com/t/integrate-microsoft-graph-api-into-the-pega-knowledge-loader/13009>\
**Category:** AI\
**Tags:** case-management, pega-platform\
**Created:** [August 5, 2026, 5:50am UTC](https://forums.pega.com/t/integrate-microsoft-graph-api-into-the-pega-knowledge-loader/13009 "2026-08-05T05:50:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bicii](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/bicii/32/22885_2.png) [@bicii](https://forums.pega.com/u/bicii)\
**Post date:** [August 5, 2026, 5:50am UTC](https://forums.pega.com/t/integrate-microsoft-graph-api-into-the-pega-knowledge-loader/13009/1 "2026-08-05T05:50:31Z")

</div>

This article provides a knowledge-sharing overview of how Pega Knowledge Buddy leverages the Knowledge Loader component to ingest SharePoint documents through the Microsoft Graph API.

The content and guidance presented in this article are based on the following documentation.  
[Extend the Pega Knowledge Loader application](https://docs.pega.com/bundle/knowledge-buddy/page/knowledge-buddy/implementation/customize-knowledge-loader.html)

Knowledge Loader has own application stack, so your application stack will be similar like below.

 ![Application Structure.drawio](https://pega1.discourse-cdn.com/pega/original/3X/c/b/cb7fdef6e135b91a5ee9295be19d122478f4354d.jpeg)

This picture represents only content loader development cycle. You can also add Content loader your Knowledge Buddy stack easily. ([Creating a Pega Knowledge Loader implementation layer](https://docs.pega.com/bundle/knowledge-buddy/page/knowledge-buddy/implementation/create-loader-impl-app.html))

**Security :**

Your SharePoint credentials must have at least the **Site.Selected** API permission with **read access** to access and retrieve content. If the target SharePoint site, library, or folder requires additional permissions, you must grant the necessary API permissions and ensure they are assigned to the corresponding application or user credentials in Azure.

**Important Tool:** Microsoft Graph Explorer is available to everyone and allows you to sign in using your own credentials. It provides an easy way to test Microsoft Graph API endpoints, explore requests and responses, and validate integrations directly from your browser. ([Graph Explorer | Try Microsoft Graph APIs - Microsoft Graph](https://developer.microsoft.com/en-us/graph/graph-explorer))

**Rule Changes :**

1. **Creating confoguration case type :** As a best practice, we decided to create another case type on the top of the Sharepoint case type. No customization required for the case type unless you have additional requirements.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/5/a/5a2004689cbfbd4bc6d55fe208549fd5b5151d87.png)

1. **GetRepositoryFiles\_Extn :** This is the first extension point to get the list of documents from sharepoint. You should check your repository to run right rules like below.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/0/1/016a3217c1411d9057ecdfd7dd3532a9d0af9fe3.png)

You can easily review other product configurations, such as SharePoint or Confluence, to understand the required fields and setup.

The connection data pages will be explained in a later section.

1. **GetfileStream\_Extn :** This extension point to get the file content from Sharepoint.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/c/1/c124f7504d839b7d486c588e86822673ff17e3b0.jpeg)

1. **GetRepositoryMetaData\_Extn:** Easily set to the document metadata. Setting the minimum fields to run the logic.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/c/8/c81e86a3ca576937e6fbd3e610d3e1f71b1e08ca.jpeg)

**MSGraph API details :**

Knowledge Loader repository configuration stores the base URL and folder path of the sharepoint folder/sites. MSGraph API is based on IDs. So you need to convert text to IDs.

**Sample Site :** [https://myDummyCo.sharepoint.com/sites/DummySite](https://myDummyCo.sharepoint.com/sites/DummySite)

Each MSGraph API is requesting site ID, so you should calculate or store the value somewhere.

1. **Retrieve Site ID :**

**API URL** : [https://graph.microsoft.com/v1.0/sites/{SiteDomain}:/{SitePath}](https://graph.microsoft.com/v1.0/sites/%7bSiteDomain%7d:/%7bSitePath%7d)  
**Sample Site URL :** [https://graph.microsoft.com/v1.0/sites](https://graph.microsoft.com/v1.0/sites/%7bSiteDomain%7d:/%7bSitePath%7dDummySite)/[myDummyCo.sharepoint.com/sites/DummySite](http://mydummyco.sharepoint.com/sites/DummySite)

**Sample Response :**

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/f/b/fb824e804a1bff11503b418375e260b13597b546.jpeg)

You can find the site id with the help of this API. Sample ID look like below.

**[myDummyCo.sharepoint.com](http://myDummyCo.sharepoint.com),60c9361b-2303-49ba-95d5-e1494506eef9,xxxxxx-0a35-4e53-xxxx-ca9470f1a27f**

Just create your connection to place related point on the extension points. It will need all API calls.

1. **Get Site drive list :** Each SharePoint site contains one or more drives. This API is used to resolve a drive name into its corresponding **Drive ID** , similar to how a site name is mapped to a **Site ID**. In the Knowledge Loader repository configuration, the **Base URL** and **folder path** are provided as inputs. Since Microsoft Graph APIs support filtering, this API relies on the filter functionality to identify and retrieve the correct Drive ID for the specified drive.

2. **Get Documents List with Folder Path:** The Knowledge Loader repository configuration can contain one or more folder paths. This API retrieves a list of documents available within a specified folder.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/e/1/e1c325d5984368417eb787602a871649e072d52f.png)

**This API retrieves all document metadata. Therefore, the GetRepositoryMetaData\_Extn extension point should leverage this integration to populate and manage the metadata attributes for the corresponding document.**

1. **Get Document Content:** This API returns the content of the document.

Microsoft Graph API provides capabilities to access SharePoint sites, making it possible to extend the ingestion process to SharePoint web pages as well. While some validation and additional development efforts may be required, our research indicates that this can be achieved in two ways:

1. **Ingest ASPX Pages Directly:**

2. **Use SharePoint Pages APIs**

This approach enables the extraction of page content directly from SharePoint sites and can be integrated into the Knowledge Loader ingestion framework with the necessary extensions and validations.
