Microsoft 365 : New Feature – Microsoft Graph API for SharePoint pages is now generally available

Microsoft Graph APIs - SharePoint Pages API
Microsoft Graph APIs - SharePoint Pages API

Hi All,

Greetings for the day

Today new feature update related to Microsoft Graph.

New Feature : Microsoft Graph API for SharePoint pages is now generally available

Details

  • The Microsoft Graph API for SharePoint pages is now generally available
  • Graph API for SharePoint pages provides us tools to interact with SharePoint Pages and News posts
  • These APIs includes following capabilities
    • Creating pages
    • Editing pages
    • Deleting pages
    • Listing pages
    • Getting page

New features incorporated

  • Web part support for create & edit – 14 following webparts are supported for creating / editing pages
Text Web partImageImage GalleryButton
Call to ActionDividerDocument embedLink preview
Quick linksPeopleBing mapsSpacer
YouTube embedOrg chart
Webparts which are allowed while creating / editing pages using Graph APIs

Demo with Graph Explorer

  • List all site pages from given site
GET /sites/{site-id}/pages

Output (showing for one page) : Note the properties it returns

{
            "@odata.type": "#microsoft.graph.sitePage",
            "@odata.etag": "\"{5ED26C19-9E78-494E-9A06-9F5CD1161ABF},10\"",
            "createdDateTime": "2023-08-10T03:41:38Z",
            "eTag": "\"{5ED26C19-9E78-494E-9A06-9F5CD1161ABF},10\"",
            "id": "5ed26c19-9e78-494e-9a06-9f5cd1161abf",
            "lastModifiedDateTime": "2023-08-10T03:41:45Z",
            "name": "Testing-sharing-site.aspx",
            "webUrl": "https://knowledgejunction1.sharepoint.com/SitePages/Testing-sharing-site.aspx",
            "title": "Testing sharing site",
            "pageLayout": "article",
            "thumbnailWebUrl": "https://media.akamai.odsp.cdn.office.net/knowledgejunction1.sharepoint.com/_layouts/15/images/sitepagethumbnail.png",
            "promotionKind": "newsPost",
            "showComments": true,
            "showRecommendedPages": false,
            "contentType": {
                "id": "0x0101009D1CB255DA76424F860D91F20E6C41180026B0C27E6CA4254D840A75710721FCCF",
                "name": "Site Page"
            },
            "createdBy": {
                "user": {
                    "displayName": "Prasham Sabadra",
                    "email": "prasham@knowledgejunction1.onmicrosoft.com"
                }
            },
            "lastModifiedBy": {
                "user": {
                    "displayName": "Prasham Sabadra",
                    "email": "prasham@knowledgejunction1.onmicrosoft.com"
                }
            },
            "parentReference": {
                "siteId": "237c32a1-0683-4fbf-ae85-d0231608241e"
            },
            "publishingState": {
                "level": "published",
                "versionId": "1.0"
            },
            "reactions": {},
            "titleArea": {
                "enableGradientEffect": true,
                "imageWebUrl": "/_layouts/15/images/sleektemplateimagetile.jpg",
                "layout": "overlap",
                "showAuthor": true,
                "showPublishedDate": false,
                "showTextBlockAboveTitle": false,
                "textAboveTitle": "",
                "textAlignment": "left",
                "imageSourceType": 2,
                "title": "Testing sharing site",
                "authorByline@odata.type": "#Collection(String)",
                "authorByline": [
                    "i:0#.f|membership|prasham@knowledgejunction1.onmicrosoft.com"
                ],
                "titlePlaceholder": "Name your news post",
                "isDecorative": true,
                "hasTitleBeenCommitted": true,
                "authors@odata.type": "#Collection(microsoft.graph.Json)",
                "authors": [
                    {
                        "id": "i:0#.f|membership|prasham@knowledgejunction1.onmicrosoft.com",
                        "upn": "prasham@knowledgejunction1.onmicrosoft.com",
                        "email": "prasham@knowledgejunction1.onmicrosoft.com",
                        "name": "Prasham Sabadra",
                        "role": "Architect"
                    }
                ],
                "serverProcessedContent": {
                    "htmlStrings": [],
                    "searchablePlainTexts": [],
                    "links": [],
                    "imageSources": [
                        {
                            "key": "imageSource",
                            "value": "/_layouts/15/images/sleektemplateimagetile.jpg"
                        }
                    ]
                }
            }
        }

Permissions required to work with pages

  • Sites.Read.All – least privileged permission
Graph Explorer - Query to list all the pages in given site
fig : Graph Explorer – Query to list all the pages in given site

Microsoft 365 Roadmap ID101166

Microsoft Graph APIs - SharePoint Pages API
fig : Microsoft Graph APIs – SharePoint Pages API

REFERENCES

In next article we will try CRUD operations using Graph Explorer.

Thanks for reading ! HAPPY LEARNING ! LIFE IS BEAUTIFUL 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL. ENJOY THE WHOLE JOURNEY :) Founder of Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading