Inconsistent Retrieval of siteId, listId, and uniqueId for SharePoint Pages via Graph API

Apps Dev 0 Reputation points
2025-01-27T10:11:57.18+00:00

Hi Microsoft Support,

I’m encountering an inconsistency with the Microsoft Graph API when retrieving images from SharePoint posts. Here's the issue in detail:

API Workflow:

  1. Initial Request: I use the endpoint: https://graph.microsoft.com/beta/sites/${pageId}/pages to retrieve attributes related to SharePoint Pages.

Expected Response: In most cases, the response includes the siteId, listId, and uniqueId attributes. I use these attributes in the subsequent request: https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${listId}/items/${uniqueId}/driveitem This normally allows me to access the uploaded images from the SharePoint posts.

Issue:

In some cases, when images are uploaded to SharePoint posts from a device, the siteId, listId, and uniqueId attributes are not included in the API response. This happens even though the upload process is identical for both cases.

  • Expected Behavior: The attributes siteId, listId, and uniqueId should always be present for images uploaded via the same method.
  • Observed Behavior:
    • Case 1: Uploading an image to a SharePoint post includes the expected attributes (siteId, listId, uniqueId).
      • Case 2: Uploading an image in the same manner to another SharePoint post does not include the attributes.

Question:

Why is there inconsistency in retrieving these attributes for images uploaded to SharePoint posts? Is this a known issue or a limitation of the Graph API?

Any guidance or insights into resolving this issue would be greatly appreciated.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,894 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,135 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,229 questions
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
619 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 38,191 Reputation points Microsoft Vendor
    2025-01-28T06:49:29.48+00:00

    Hi @Apps Dev,

    Per my test, I could get siteId and uniqueId in parentReference. But there is no listId in my test result. This should be the expected result refer to the offical document:

    driveItem resource type

    And here is my test result

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.