Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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