2

I am adding a file with the REST-API:

http://hostname/sites/site/news/_api/Web/GetFolderByServerRelativeUrl('/sites/site/news/Pages')/Files/add(url='new.aspx',overwrite=true)

How can I additionally add the PublishingPageLayout-property (and other properties) to the created page/file via REST-API?

1

Never tried with the REST API, however via CSOM you would need to set the "PublishingPageLayout" to the Site Collection relative url of the actual ASPX representing the layout using something like "/sites/mySiteCollection/_catalogs/masterpage/ArticleLeft.aspx, ArticleLeft" and at the same time the ContentTypeID property using the actual Content type Identifier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.