Microsoft Graph API Document
Document No: MSGraphAPI Issue Date: 17/11/2025
Version No.: 1.0 Created By: Preksha Bhavsar
Amendment No.: 0 Approved By: Amrish Pawar (Manager)
Security Level: Internal / Confidential / Sensitive
CREDENCA CONFIDENTIAL AND PROPRIETARY. FOR INTERNAL DISTRIBUTION ONLY.
Disclose and distribute solely to those employees of Credenca Data Solutions that have a need to know.
Disclaimer: This document contains proprietary and confidential information which is provided "AS IS," with all faults, and without any warranties,
including, but not limited to, warranties of merchantability, performance or fitness for a particular purpose. While reasonable efforts have been
made
in the preparation of this document to assure its accuracy, Credenca Data Solutions assumes no liability resulting from technical or editorial errors
or omissions or for any damages resulting from the furnishing, performance, or use of the information contained herein.
Document History
1. Document Revisions:
Date Version No. Document Changes
October 07, 2025 1.0 Initial Draft
2. Document Approval:
Role Name Status Date of Approval
Project Manager Mr. Amrish Pawar Approved 09/10/2025
Power Apps Developer Ms. Preksha Bhavsar Maker 07/10/2025
3. Amendment History:
Amendment suggested
Amendment No. Amendment subsection Amendment details
by
NA NA NA NA
Page 2 of 8
Contents
1. Introduction .................................................................................................................... 4
2. Pre-requisites ................................................................................................................. 4
3. Microsoft Graph API Overview ....................................................................................... 4
4. Authentication and Permissions ..................................................................................... 5
5. Implementation in Power Apps ....................................................................................... 5
5.1 Building the Request Body .......................................................................................... 5
5.2 Encoding Request Body to Base64 ............................................................................. 6
5.3 Making the Graph API Call .......................................................................................... 7
5.4 Parsing Results into a Collection ................................................................................. 7
6. Error Handling ................................................................................................................ 7
7. Best Practices ................................................................................................................ 8
Page 3 of 8
1. Introduction
This document outlines the process of integrating Microsoft Graph API with Power Apps to retrieve
data from SharePoint Online lists. Although Power Apps provides a native SharePoint connector, it
has constraints such as:
Delegation limitations
Performance issues when handling large datasets
Restricted filtering capabilities
Reduced reliability with complex schemas
By using Microsoft Graph API, solutions can achieve:
Improved scalability
Advanced query and filtering options
Better performance for large lists
Enhanced security and access control
2. Pre-requisites
Ensure the following before implementing Graph API in Power Apps:
A valid Power Apps license (premium connectors may be required).
Access to the target SharePoint site and list.
An Azure Active Directory App Registration.
Required Graph API permissions such as:
o [Link] (recommended)
o [Link]
Admin consent granted for the app.
Basic understanding of REST APIs and JSON structures.
[Link] Graph API Overview
Microsoft Graph provides a unified endpoint for interacting with Microsoft 365 services such
as SharePoint, OneDrive, Outlook, and Teams.
For SharePoint list operations, the primary endpoints include:
Get Site ID:
GET - [Link]
Get List ID:
GET – [Link]
Page 4 of 8
Get List Items (Recommended Approach) :
GET - [Link]
(Note: This endpoint is the recommended approach for retrieving list items reliably and
efficiently.)
[Link] and Permissions
To authenticate Power Apps with Microsoft Graph:
1. Register an app in Azure Active Directory.
2. Assign Graph API permissions:
o [Link] (least privilege, recommended), or
o [Link]
3. Grant admin consent for the permissions.
4. Use [Link] in Power Apps to call the API using the app’s
credentials.
Note: When using [Link], the app must be explicitly granted access to each SharePoint site.
[Link] in Power Apps
5.1 Building the Request Body
Create the JSON request body for Graph Search API (if search is required):
Set(
varRequestBody,
"{
""requests"": [
{
""entityTypes"": [ ""listItem"" ],
""query"": {
""queryString"": ""Path:\""[Link]
},
""size"": ""500"",
""fields"": [
""title"",
""RefinableString00"",
""RefinableString01"",
""RefinableString02"",
""RefinableString03"",
""RefinableString04"",
""RefinableString05"",
""RefinableString06""
]
Page 5 of 8
}
]
}"
);
5.2 Encoding the Request Body to Base64
Power Apps requires Base64-encoded content for raw HTTP requests:
Set(
VarFile,
"data:text/plain;base64," &
With(
{
InputText: varRequestBody,
AsciiTable: AddColumns(Sequence(2^8, 1), char, Char(Value)),
B64ToBin: Table(
{ b64: "A", bin: "000000" },
{ b64: "B", bin: "000001" },
...
{ b64: "/", bin: "111111" }
)
},
With(
{
BinRep:
Concat(
AddColumns(
ForAll(Split(InputText, ""), { Result: [Link] }),
dec,
LookUp(AsciiTable, char = Result).Value
),
Concat(
Sequence(8, 8, -1),
Text(
If(
And(
Mod(dec, Power(2, Value)) >= Power(2, Value - 1),
Mod(dec, Power(2, Value)) < Power(2, Value)
),
1,
0
)
)
) & ""
)
},
With(
{
b64string:
Concat(
Page 6 of 8
Sequence(RoundUp(Len(BinRep) / 6, 0), 0),
LookUp(
B64ToBin,
bin = Mid(BinRep & Left("000000", 6 - Mod(Len(BinRep), 6)), 6 * Value + 1, 6)
).b64 & "",
""
)
},
b64string & Left("====", Mod(4 - Mod(Len(b64string), 4), 4))
)
)
)
);
5.3 Making the Graph API Call
Set(
SearchResults,
[Link](
"[Link]
"POST",
VarFile
)
);
5.4 Parsing Results into a Collection
You can parse results and store them into a Power Apps collection for display:
ClearCollect(
colListItems,
[Link][0].hitsContainers[0].hits
);
[Link] Handling
Common issues when calling Graph API:
Error Code Description
401 Unauthorized Token invalid or missing credentials
403 Forbidden App lacks required Graph permissions
404 Not Found Incorrect site, list, or endpoint
429 Too Many Requests API throttling
Page 7 of 8
Resolution:
Verify Graph endpoints and IDs.
Ensure correct app permissions with admin consent.
Confirm site-level permissions when using [Link].
Implement retry logic for throttling scenarios.
7. Best Practices
Favor [Link] for minimum required access.
Use Graph List Items API when full list retrieval is required.
Apply pagination handling for lists exceeding 5,000 items.
Cache data in Power Apps collections to reduce API calls.
Monitor Graph API usage and throttling limits.
Page 8 of 8