Get SharePoint site page metadata/properties using Graph API beta

Gardner, Max 41 Reputation points
2020-09-22T23:19:42.797+00:00

Hello!

I'm attempting to retrieve some basic metadata (description, thumbnail) and custom properties for a SharePoint site page using the beta Graph API, but using the basic examples in the documentation isn't giving me all the pieces I need. Specifically, I'm unable to get a description back despite the site having one when editing it through the console. I also cannot get the thumbnail or the custom properties I've set on the page, which seem like they should be coming back as a webPart in the response.

I am hitting endpoint https://graph.microsoft.com/beta/sites/<3-point-id>/pages/<page-id> and getting back:

{  
    &#34;@odata.context&#34;: &#34;https://graph.microsoft.com/beta/$metadata#sites(&lt;site-id&gt;)/pages/$entity&#34;,  
    &#34;eTag&#34;: &#34;&#34;,  
    &#34;id&#34;: &#34;&#34;,  
    &#34;lastModifiedDateTime&#34;: &#34;2020-09-22T20:49:37Z&#34;,  
    &#34;name&#34;: &#34;This-is-a-test-page.aspx&#34;,  
    &#34;webUrl&#34;: &#34;SitePages/This-is-a-test-page.aspx&#34;,  
    &#34;title&#34;: &#34;Testing a title change&#34;,  
    &#34;pageLayout&#34;: &#34;Article&#34;,  
    &#34;createdBy&#34;: {  
        &#34;user&#34;: { }  
    },  
    &#34;lastModifiedBy&#34;: {  
        &#34;user&#34;: { }  
    },  
    &#34;parentReference&#34;: {  
        &#34;siteId&#34;: &#34;&#34;  
    },  
    &#34;contentType&#34;: {  
        &#34;id&#34;: &#34;&#34;,  
        &#34;name&#34;: &#34;Site Page&#34;  
    },  
    &#34;webParts&#34;: [  
        {  
            &#34;type&#34;: &#34;rte&#34;,  
            &#34;data&#34;: {  
                &#34;innerHTML&#34;: &#34;&lt;p&gt;Just something to fill the page and test this out.&lt;/p&gt;&#34;  
            }  
        }  
    ],  
    &#34;publishingState&#34;: {  
        &#34;level&#34;: &#34;published&#34;,  
        &#34;versionId&#34;: &#34;3.0&#34;  
    }  
}  

Here's a screenshot of the site's properties in the console:

26604-screen-shot-2020-09-22-at-60702-pm.png

Any thoughts on how I could return this additional data, such as the description, the page's thumbnail, and the custom properties I've set on the page? I don't see any parameters I can pass in, and I've tried directly selecting at least the description with no success.

Microsoft 365 and Office | SharePoint Server | Development
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Answer accepted by question author
  1. Baker Kong-MSFT 3,801 Reputation points
    2020-09-28T02:39:37.21+00:00

    Hi @Gardner, Max ,

    I have a test this endpoint on my SPO, yes it does not return description or some other properties. I think it's by design as it's beta version, the endpoint has not exposed such functionality. Hence i'd like to suggest you submit feedback on Github or turn to the old SharePoint Rest API.

    Best Regards,
    Baker Kong


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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.

    1 person found this answer helpful.
    0 comments No comments

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.