Question

I am writing an application in AngularJS for a SharePoint 2013 site collection, using the REST API to talk to SharePoint. My task is to update the Image Link in the Title Bar Properties of every Web Part Page in the Site Pages library of every site. I have managed to iterate through every site and list every Web Part Page (excluding the Wiki Pages), but I am stuck finding the specific property.

My broader question, is there a way within the REST API to retrieve every single property of a Web Part Page?

UPDATE: To duplicate my scenario:

  • From a Site Pages library, click Files|New Document|Web Part Page from the Ribbon.
  • From your new Web Part Page, click Page|Title Bar Properties from the Ribbon.
  • Enter all the properties in the Web Part Page Title Bar panel to the right and click 'OK'.
  • Click Stop Editing from the Ribbon.
  • Make a REST API call to the Site Pages library and show those fields from your page in the results.
Was it helpful?

Solution 2

I found a solution! The properties I am looking for are inside a web part labelled "Web Part Page Title Properties". Here is the REST API call:

_spPageContextInfo.siteAbsoluteUrl
+ "/_api/web/GetFileByServerRelativeUrl('"
+ {{Url of Web Page}} + "')/GetLimitedWebPartManager(1)/WebParts" 
+ "?$expand=WebPart/Properties" 
+ "&$filter=WebPart/Title eq 'Web Part Page Title Bar'"

The property in question is Image, which in JSON is result.WebPart.Properties.Image. Now I just have to figure out how to edit those properties.

OTHER TIPS

Try using endpoint something like below:

_spPageContextInfo.webAbsoluteUrl +"/_api/web/GetFolderByServerRelativeUrl('SitePages')/Files?$select=Name,Title,ServerRelativeUrl,ListItemAllFields&$expand=ListItemAllFields
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top