I started with REST and succeeded in getting the web part manager for a page and got the web part definitions (
SP.WebParts.WebPartDefinition) as well. Unfortunately there is no type information, only
Id etc. There is also no
Properties property which I saw in some samples.
My request looks like this:
I'm interested in SharePoint 2013 and 2016. I read about an
ExportWebpart API which was introduced in 2016 for SP Online which seems to be missing at least on my on-prem test farm. If there are any means for on-prem I'd also like to know any patch level needed for the API to be available. But I could probably google this myself once I know the API.
When exporting the web part manually in the browser UI I get the information I need - in two places of the exported web part XML:
Metadata of the exported web part (This is what I'd like to have!):
<metaData> <type name="Microsoft.SharePoint.WebPartPages.ClientWebPart, Microsoft.SharePoint, Version=188.8.131.52, Culture=neutral, PublicKeyToken=71e9bce111e9429c" /> <importErrorMessage>Cannot import this Web Part.</importErrorMessage> </metaData>
As an alternative (workaround) the properties would be (maybe) sufficient for my case as well. I could identify the web parts I'm interested in via their unique combination of properties like the FeatureId and others:
<property name="FeatureId" type="System.Guid, mscorlib, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b77a5c561934e089">GUID I can use</property>
But I just cannot get these properties as well, using REST.
I checked that the export mode allows exporting the data:
That the web part properties are retrievable via Remote API:
I tried expanding
WebPart.Properties instead of
WebPart (like in some JSOM samples).
Nope. Maybe it's just not possible via REST? The documentation is no reason to party either.