Slide 1

Slide 1 text

Microsoft Graph の SharePoint pages API について 気ままに勉強会 #51

Slide 2

Slide 2 text

Miyake Mito @MiTo60448639 https://qiita.com/MiyakeMito 株式会社アイシーソフト Technical Manager www.icsoft.jp https://speakerdeck.com/miya kemito 2

Slide 3

Slide 3 text

免責事項 当スライドは、 2023年4月現在のバージョンでの情報です 今後のアップデート等により、 仕様変更する可能性があります。 また、私の見解による内容が含まれます 間違いなどありましたらご指摘ください。 3

Slide 4

Slide 4 text

本日の参考サイト 4 ◼ sitePage リソースの種類(Microsoft Learn) https://learn.microsoft.com/ja- jp/graph/api/resources/sitepage?view=graph-rest- beta#pagelayouttype-values ◼ Microsoft Graph Pages API: Power Apps (+Power Automate) から SharePoint ページを作成しよう(平野愛 さん) https://shanqiai.lekumo.biz/sharepoint_technical_note/2022/12/ power-apps-shar-2830.html

Slide 5

Slide 5 text

Microsoft Graph の 新しい SharePoint pages API

Slide 6

Slide 6 text

Microsoft Graph の 新しい SharePoint pages API の発表 https://devblogs.microsoft.com/microsoft365dev/announcing- the-new-sharepoint-pages-api-in-microsoft-graph/ 1. SharePoint モダン ページ テクノロジの最新の開発に沿った新し いデータ モデル ➢ 水平/垂直セクション ➢ Webパーツ 2. 以前のbeta API と比較して改善されたページ管理機能 6

Slide 7

Slide 7 text

4月までにGAされる SharePoint Pages API ◼ 任意のサイトのすべてのページとニュース投 稿のリストを取得します。 ◼ 任意のページまたはニュース投稿のコンテン ツを取得します。 ◼ ページまたはニュース投稿を作成する ◼ ページまたはニュース投稿を公開する ◼ ページまたはニュース投稿を削除する 7

Slide 8

Slide 8 text

Power Automate から実行

Slide 9

Slide 9 text

Graph API 実行・・・ 9 「HTTP 要求 V2 を送信する」も同様です

Slide 10

Slide 10 text

Graph API 実行 10 1. アプリの許可で実行 Create a page in the site pages list of a site https://learn.microsoft.com/en-us/graph/api/sitepage-create?view=graph-rest-beta#permissions 2. 委任されたアクセス許可で実行

Slide 11

Slide 11 text

Graph API を Power Automate で利用する 11 ◼ Microsoft Graph API について https://speakerdeck.com/miyakemito/graph-api-nituite ◼ Power Automate で Graph API 実行が無料 https://speakerdeck.com/miyakemito/powerautomatedegr aphapigawu-chang-kamo https://speakerdeck.com/miyakemito

Slide 12

Slide 12 text

webPart resource type ◼ 実際に作成したサイトページから、Web Partリソースを取得するのが オススメです 12 GET /sites/{sitesId}/pages/{sitePageI d}/webparts GET /sites/{sitesId}/pages/{sitePageI d}/canvasLayout/horizontalSecti ons/{horizontalSectionId}/colum ns/{horizontalSectionColumnId}/ webparts GET /sites/{sitesId}/pages/{sitePageI d}/canvasLayout/verticalSection/ webparts "properties": { "isMigrated": true, "layoutId": "Button", "shouldShowThumbnail": true, "imageWidth": 100, "hideWebPartWhenEmpty": true, "dataProviderId": "QuickLinks", "webId": "f07ee155-cdb5-45a3-8d51-1a0e278440ae", "siteId": "1f9a9f96-b55c-4ce1-bc84-a3c14b7b27be", "imagePicker": "/sites/TeamSite/SiteAssets/SitePages/Sample/画像1.png", "[email protected]": "#Collection(graph.Json)", "items": [ { "thumbnailType": 1, "id": 3, "description": "", "altText": "", "rawPreviewImageMinCanvasWidth": 32767, "sourceItem": { "@odata.type": "#graph.Json", "itemType": 2, "fileExtension": "", "progId": "" }, "image": { "@odata.type": "#graph.Json", "imageFit": 2, "minCanvasWidth": 1, "guids": { "@odata.type": "#graph.Json", "listId": "1d778c11-6259-44c3-98c1-fcdcd4db66f3", "uniqueId": "024c1110-d336-44de-972e-8494bdb87b87", "webId": "f07ee155-cdb5-45a3-8d51-1a0e278440ae", "siteId": "1f9a9f96-b55c-4ce1-bc84-a3c14b7b27be" } } } サイトページ Graph Pages/webparts API webpart の JSON Schema

Slide 13

Slide 13 text

ありがとうございました