1

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.
  • How you got every web part page using REST? – Ganesh Sanap Jun 18 at 13:38
  • @GaneshSanap yes. I am now pulling up individual properties for each page. That's where I am stuck. – CigarDoug Jun 18 at 13:57
  • 1
    Try below given endpoint in my answer. let me know if it works for you or not. – Ganesh Sanap Jun 18 at 14:00
3

Try using endpoint something like below:

_spPageContextInfo.webAbsoluteUrl +"/_api/web/GetFolderByServerRelativeUrl('SitePages')/Files?$select=Name,Title,ServerRelativeUrl,ListItemAllFields&$expand=ListItemAllFields
  • This does not show the properties I am looking for. I will update my original question. – CigarDoug Jun 18 at 16:53
  • 1
    You can get the multiple properties by expanding ListItemAllFields like ID, Title, etc. If you are not getting it directly in one call then you can call again using ID you are getting from 1st call. – Ganesh Sanap Jun 18 at 17:13
  • Can you please provide an example? Can you duplicate the example I put in my question and see if you can see those values? – CigarDoug Jun 18 at 17:39
  • Ganesh thanks for pointing me in the right direction. – CigarDoug Jun 24 at 17:06
  • Welcome. Glad you got the solution. – Ganesh Sanap Jun 24 at 17:12
1

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.

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.