Skip to content

Instantly share code, notes, and snippets.

@expiscornovus
Created March 23, 2025 11:04
Show Gist options
  • Save expiscornovus/e381bf39121aa52a563616c00ec1783d to your computer and use it in GitHub Desktop.
Save expiscornovus/e381bf39121aa52a563616c00ec1783d to your computer and use it in GitHub Desktop.
Add YouTube Embed Web Part on Page
{"id":"83a9a6d6-6330-483e-a484-e758ec352f08","brandColor":"#036C70","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/exp_sharedsharepointonline_e5efa"}}},"connectorDisplayName":"SharePoint","icon":"https://conn-afd-prod-endpoint-bmc9bqahasf3grgk.b01.azurefd.net/releases/v1.0.1738/1.0.1738.4131/sharepointonline/icon.png","isTrigger":false,"operationName":"Send_an_HTTP_request_to_SharePoint","operationDefinition":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"@parameters('SPOSiteCollection_PowerUsers (exp_SPOSiteCollection_PowerUsers)')","parameters/method":"PATCH","parameters/uri":"_api/v2.0/sites('@{variables('SiteId')}')/pages/@{variables('SitePageId')}/oneDrive.page","parameters/headers":{"Accept":"application/json;odata=verbose","Content-Type":"application/json;odata=verbose"},"parameters/body":"{\n \"@odata.type\": \"#microsoft.graph.sitePage\",\n \"title\": \"Call to Action Example\",\n \"canvasLayout\": {\n \"horizontalSections\": [\n {\n \"layout\": \"oneColumn\",\n \"id\": \"1\",\n \"emphasis\": \"none\",\n \"columns\": [\n {\n \"id\": \"1\",\n \"webparts\": [\n {\n \"id\": \"f1ffe693-d741-4fb4-8713-71f48f7b80a9\",\n \"webPartType\": \"544dd15b-cf3c-441b-96da-004d5a8cea1d\",\n \"data\": {\n \"dataVersion\": \"1.2\",\n \"title\": \"YouTube\",\n \"description\": \"Show a YouTube video on the page.\",\n \"properties\": {\n \"embedCode\": \"https://youtu.be/nn4dX09z3Yw?si=adqkLamuU6shTYPo\",\n \"shouldScaleWidth\": true,\n \"cachedEmbedCode\": \"<iframe width=200 height=113 src=https://www.youtube.com/embed/nn4dX09z3Yw?feature=oembed frameborder=0 allowfullscreen> </iframe>\",\n \"runtimeState\": {\n \"@odata.type\": \"#graph.Json\",\n \"isPrivate\": false,\n \"showControls\": true,\n \"startTime\": \"00:10\"\n }\n },\n \"serverProcessedContent\": {\n \"htmlStrings\": [],\n \"searchablePlainTexts\": [\n {\n \"key\": \"title\",\n \"value\": \"YouTube Example\"\n },\n {\n \"key\": \"captionText\",\n \"value\": \"YouTube embedded via from my Channel\"\n }\n ],\n \"links\": [],\n \"imageSources\": []\n }\n }\n }\n ]\n }\n ]\n }\n]\n}\n}"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"Initialize_variable_-_SitePageId":["Succeeded"]},"metadata":{"operationMetadataId":"a9d3189e-1ed6-436a-bca6-d109d8a2888b"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment