Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
My project requires me to find some way to execute an important on an Umbraco site from a simple console app. I know that I can use the Usync API to trigger an import from the site itself:
var uSyncBackOffice = new uSyncBackOfficeContext();
var actions = uSyncBackOffice.ImportAll();
Essentially what my program will do is:
Assuming that the program has the necessary permissions on the host server and of course the usync nuget package onboard, how would I write this?
I'm assuming the I need to initialize a uSyncBackOfficeContext but I couldn't find any methods for defining an IIS site or any other connection settings. I am also aware that Arron Powell's Chauffeur might be able to do this for me but it seems outdated or incomplete as I haven't been able to find a version I can compile.
As if by magic : )
you can trigger imports from the command line with this.
sort of docs here :
Yes, I'm looking at the uSync.Chauffeur class library now, but I was wondering if you had some sample code or some boilerplate command line app to get started? Because, as far as I can see, uSync.Chauffuer doesn't include any executable, just class libraries.
I wasn't aware that Chauffeur was to reside in the Umbraco site's bin-folder. Blaming it on poor documentation. ^^ You can disregard my answer. I will try this on my end and mark your answer as the solution if it works.
if you need to trigger something across sites then you might be better putting an API end point in that you can hit remotely.
so if you look at something like
you can actually hit an import via the url
but you have to be authenticated by umbraco to do that.
if you wrote your own. you could make it unauthenticated so it could be called from somewhere else. but you would want to secure it somehow (iis restrictions or keys or something)
That was my original solution but it might not be an option due the way our production IIS is set up.
Write your reply to:
Image will be uploaded when post is submitted