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,981 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,259 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.
623 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 38,646 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.


  2. Apps Dev 0 Reputation points
    2025-01-30T15:07:42.8+00:00

    What we do:  We are provided services to multiple clients so that they can manage their sharepoint news posts

    The flow:

    The problem: We assumed we can find the image deeply nested inside {titleArea.serverProcessedContent.customMetadata.value} from which we use listId,siteId,uniqueId to call 'https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${listId}/items/${uniqueId}/driveitem' BUT, this is not always the case. Most often than not, this image_item is not available, thus we cannot retrieve their image.

    Question: Is there something wrong with the assumption we have? Is there a better api-flow we should follow to retrieve the news posts along with their images?

    Notes: It is ok to instruct the client on how to upload the image so that the api-flow can work.

    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.