Skip to content

Add SharePoint Embedded sample queries#1501

Open
marcwindle wants to merge 4 commits intomicrosoftgraph:masterfrom
marcwindle:mawin/add-sharepoint-embedded-sample-queries
Open

Add SharePoint Embedded sample queries#1501
marcwindle wants to merge 4 commits intomicrosoftgraph:masterfrom
marcwindle:mawin/add-sharepoint-embedded-sample-queries

Conversation

@marcwindle
Copy link
Copy Markdown

This PR adds a new SharePoint Embedded category to the Graph Explorer sample queries, positioned alphabetically between Security and SharePoint Lists.

Queries added

  • create a container
  • list containers
  • get a container
  • add a writer to a container
  • list container permissions
  • add a choice column to a container
  • list container columns
  • create a folder in a container
  • list items in a container
  • get an item in a container
  • delete a container

@marcwindle marcwindle requested a review from a team as a code owner April 15, 2026 20:17
Copilot AI review requested due to automatic review settings April 15, 2026 20:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new “SharePoint Embedded” category to Graph Explorer sample queries and includes common container, permission, column, and drive-item operations.

Changes:

  • Introduces 11 new SharePoint Embedded sample queries (containers, permissions, columns, drive items).
  • Adds request bodies and headers for POST operations.
  • Positions the new category alphabetically near existing SharePoint-related samples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"category": "SharePoint Embedded",
"method": "GET",
"humanName": "list containers",
"requestUrl": "/v1.0/storage/fileStorage/containers?$filter=containerTypeId eq {containerTypeId}",
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requestUrl contains unencoded spaces in the OData $filter expression, which makes the URL invalid in many clients and can break request execution. Encode the spaces (e.g., %20) in the query string so the requestUrl is a valid URL.

Suggested change
"requestUrl": "/v1.0/storage/fileStorage/containers?$filter=containerTypeId eq {containerTypeId}",
"requestUrl": "/v1.0/storage/fileStorage/containers?$filter=containerTypeId%20eq%20{containerTypeId}",

Copilot uses AI. Check for mistakes.
"category": "SharePoint Embedded",
"method": "GET",
"humanName": "list items in a container",
"requestUrl": "/v1.0/drives/{containerId}/items/root/children",
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This drive children listing path is incorrect: items/root/children is not a valid pattern for Microsoft Graph Drive APIs. The supported pattern for root children is /drives/{driveId}/root/children (or /drives/{driveId}/items/{itemId}/children for a specific folder). Update the URL accordingly.

Suggested change
"requestUrl": "/v1.0/drives/{containerId}/items/root/children",
"requestUrl": "/v1.0/drives/{containerId}/root/children",

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a valid comment, just don't have permissions to apply suggestions

Comment on lines +1330 to +1335
"headers": [
{
"name": "Content-type",
"value": "application/json"
}
],
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header name casing is inconsistent (Content-type here vs Content-Type elsewhere in the same PR). While HTTP header names are case-insensitive, tooling/UI code sometimes does exact string comparisons. Use a consistent header name (prefer Content-Type) across all samples.

Copilot uses AI. Check for mistakes.
Comment on lines +1355 to +1360
"headers": [
{
"name": "Content-type",
"value": "application/json"
}
],
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same inconsistency as above: align this header name casing with the other samples (Content-Type) to avoid brittle behavior in clients that treat header names as case-sensitive.

Copilot uses AI. Check for mistakes.
"category": "SharePoint Embedded",
"method": "POST",
"humanName": "create a folder in a container",
"requestUrl": "/v1.0/drives/{containerId}/root/children",
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder {containerId} is used for /storage/fileStorage/containers/{containerId} and also for /drives/{...} endpoints. In Graph, a fileStorage container identifier is not necessarily the same as a drive identifier, so this placeholder is ambiguous and can mislead users. Consider using {driveId} for /drives/... samples (and keep {containerId} for /storage/fileStorage/containers/...) to make the required identifiers unambiguous.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@dluces dluces Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, in Graph the identifier for fileStorageContainer is indeed always a drive identifier.

"category": "SharePoint Embedded",
"method": "GET",
"humanName": "get an item in a container",
"requestUrl": "/v1.0/drives/{containerId}/items/{itemId}",
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder {containerId} is used for /storage/fileStorage/containers/{containerId} and also for /drives/{...} endpoints. In Graph, a fileStorage container identifier is not necessarily the same as a drive identifier, so this placeholder is ambiguous and can mislead users. Consider using {driveId} for /drives/... samples (and keep {containerId} for /storage/fileStorage/containers/...) to make the required identifiers unambiguous.

Copilot uses AI. Check for mistakes.
"value": "application/json"
}
],
"postBody": "{\r\n \"roles\": [\"writer\"],\r\n \"grantedToV2\": {\r\n \"user\": {\r\n \"userPrincipalName\": \"{userEmail}\"\r\n }\r\n }\r\n}",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"postBody": "{\r\n \"roles\": [\"writer\"],\r\n \"grantedToV2\": {\r\n \"user\": {\r\n \"userPrincipalName\": \"{userEmail}\"\r\n }\r\n }\r\n}",
"postBody": "{\r\n \"roles\": [\"writer\"],\r\n \"grantedToV2\": {\r\n \"user\": {\r\n \"id\": \"{userObjectId}\"\r\n }\r\n }\r\n}",

"docLink": "https://learn.microsoft.com/en-us/graph/api/filestoragecontainer-post-columns?view=graph-rest-1.0",
"headers": [
{
"name": "Content-type",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"name": "Content-type",
"name": "Content-Type",

"docLink": "https://learn.microsoft.com/en-us/graph/api/filestoragecontainer-post-permissions?view=graph-rest-1.0",
"headers": [
{
"name": "Content-type",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"name": "Content-type",
"name": "Content-Type",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants