How to get sharepoint images

Roman 21 Reputation points
2022-07-14T07:03:37.28+00:00

Hello

I currently am implementing a solution that lets me input a sharepoint-url which then returns the entire content of said page.
I got as far as getting the "/sites/{siteId}/page/{pageId}" content but there is a problem with the return value.
It works fine with text, since the returned webParts contain the whole text. But not so much with images.
The image webPart has a type, id and instanceId, which is not very useful to me since I don't know what to do with those.
The documentation states that the return value of images should be way more extensive and contain more information.

220579-image.png

Is there more information to this that im not seeing or is this not implemented yet?
Is there any other way to get the images that im looking for?

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Answer accepted by question author
  1. ShivaniRai-MSFT-7217 2,751 Reputation points
    2022-07-14T10:29:17.797+00:00

    Hi @Roman ,

    I am able to reproduce this scenario and it seems to be by design. As per this documentation, we can see for image type web part we can only get text data in data property. Moreover in this documentation its mentioned that the sitePageData resource represents the properties of a webPart and as these properties vary by web part, this is an OpenType with no fixed properties.

    Also, Please note that this API is under the /beta version in Microsoft Graph which is subject to change. Use of these APIs in production applications is not supported.

    Hope this helps.

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


0 additional answers

Sort by: Most helpful

Your answer

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