Skip to content

Instantly share code, notes, and snippets.

@expiscornovus
Last active July 15, 2021 10:29
Show Gist options
  • Save expiscornovus/b728b72263b2192caeef7c742e7f2a7f to your computer and use it in GitHub Desktop.
Save expiscornovus/b728b72263b2192caeef7c742e7f2a7f to your computer and use it in GitHub Desktop.
SavePageAsDraft SharePoint Page with Embed WebPart
Method
POST
URI
_api/sitepages/pages(@{body('Parse_JSON')?['d']?['Id']})/SavePageAsDraft
Headers
{
"content-type": "application/json;odata=nometadata",
"Accept": "application/json;odata=verbose"
}
Body
{"LayoutWebpartsContent":"[{\"id\":\"@{variables('PageTitleWebPartId')}\",\"instanceId\":\"@{variables('PageTitleWebPartId')}\",\"title\":\"\",\"description\":\"\",\"serverProcessedContent\":{\"htmlStrings\":{},\"searchablePlainTexts\":{},\"imageSources\":{},\"links\":{}},\"dataVersion\":\"1.4\",\"properties\":{\"title\":\"@{variables('Use Case Title')}\",\"imageSourceType\":4,\"layoutType\":\"FullWidthImage\",\"textAlignment\":\"Left\",\"showTopicHeader\":false,\"showPublishDate\":false,\"topicHeader\":\"\",\"authors\":[],\"authorByline\":[\"@{outputs('Get_file_properties')?['body/Author/Email']}\"]},\"reservedHeight\":228}]",
"CanvasContent1":"[{\"controlType\":3,\"id\":\"@{variables('CanvasContent1ControlId')}\",\"position\":{\"zoneIndex\":1,\"sectionIndex\":1,\"controlIndex\":1,\"layoutIndex\":1},\"webPartId\":\"@{variables('DocumentEmbedWebPartId')}\",\"webPartData\":{\"id\":\"@{variables('DocumentEmbedWebPartId')}\",\"instanceId\":\"@{variables('CanvasContent1ControlId')}\",\"title\":\"File viewer\",\"description\":\"\",\"serverProcessedContent\":{\"htmlStrings\":{},\"searchablePlainTexts\":{\"title\":\"@{outputs('Get_file_properties')?['body/{Name}']}\"},\"imageSources\":{},\"links\":{\"serverRelativeUrl\":\"@{replace(outputs('Get_file_properties')?['body/{Link}'], variables('RootUrl'), '')}\",\"wopiurl\":\"@{outputs('Get_file_properties')?['body/{Link}']}\"}},\"dataVersion\":\"1.4\",\"properties\":{\"annotation\":\"\",\"authorName\":\"@{outputs('Get_file_properties')?['body/Author/DisplayName']}\",\"chartitem\":\"\",\"endrange\":\"\",\"excelSettingsType\":\"\",\"file\":\"@{outputs('Get_file_properties')?['body/{Link}']}\",\"listId\":\"@{variables('FileViewerSourceListId')}\",\"modifiedAt\":\"@{utcNow()}\",\"photoUrl\":\"@{replace(outputs('Get_file_properties')?['body/Author/Picture'], concat(variables('SiteUrl'), '/_layouts/15/UserPhoto.aspx?Size=L'), '/_layouts/15/UserPhoto.aspx?Size=S')}\",\"rangeitem\":\"\",\"siteId\":\"@{variables('SiteId')}\",\"startPage\":1,\"startrange\":\"\",\"tableitem\":\"\",\"uniqueId\":\"@{replace(replace(split(outputs('Get_file_metadata')?['body/ETag'], ',')?[0], '"{', ''), '}', '')}\",\"wdallowinteractivity\":true,\"wdhidegridlines\":true,\"wdhideheaders\":true,\"webId\":\"@{variables('WebId')}\",\"webAbsoluteUrl\":\"@{variables('SiteUrl')}\"}},\"emphasis\":{},\"reservedHeight\":686,\"reservedWidth\":1180,\"addedFromPersistedData\":true},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true}}]",
"AuthorByline":["@{outputs('Get_file_properties')?['body/Author/Email']}"],"TopicHeader":"","BannerImageUrl":"/_layouts/15/images/sitepagethumbnail.png","Title":"@{variables('Use Case Title')}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment