There isn't anything OOTB that will allow you to hit a rest service. You have a couple of options:
Sitecore PowerShell Extensions
You could use Sitecore PowerShell Extensions remoting to do that fairly easily.
Syntax to serialize an item is:
serialize-item -path "master:\content"
If you want children included, then:
get-childitem "master:\content\home" -recurse | where-object { $_."__Created By" -eq "sitecore\admin" } | serialize-item
So using SPE remoting you could do something like:
Set-SitecoreConfiguration –SitecoreHost 'http://hostname' `
-User 'admin' –Password 'b'
$path= "master:\content\home"
Invoke-SitecoreScript –Command { Serialize-Item $params.scPath }`
-Params @{ scPath = $path}
Custom REST Service
If you can't use SPE - then your other option would be to write your own rest service that takes in the path to serialize and some credentials. You can use the Serialization
API in Sitecore to do this:
public void SerializeItem(string itemId)
{
if (Sitecore.Data.ID.IsID(itemId))
{
Database masterDB = Sitecore.Configuration.Factory.GetDatabase("master");
Item item = masterDB.GetItem(Sitecore.Data.ID.Parse(itemId));
if (item != null)
{
Sitecore.Data.Serialization.Manager.DumpItem(item);
}
}
}
Credits: