SCORCH Web Service API

Web Service URLs

Web Service URL (no change for 2016):

http://sco01:81/orchestrator2012/orchestrator.svc/

Web Console URL:

http://sco01:82/

Get runbooks:

http://server01.contoso.com:81/Orchestrator2012/Orchestrator.svc/Runbooks

Access Orchestrator Runbooks via Web Service

Get a Runbook

PowerShell
1
2
3
4
5
$secpasswd = ConvertTo-SecureString "Password01!" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential("contoso\Administrator", $secpasswd)
$OrchURI = "http://SCO01:81/Orchestrator2012/Orchestrator.svc/Runbooks?`$filter=Name eq 'Test'"
$ResponseObject = invoke-webrequest -Uri $OrchURI -method Get -Credential $mycreds
$ResponseObject.Content

Postman
1
http://SCO01:81/Orchestrator2012/Orchestrator.svc/Runbooks?$filter=Name eq 'Test'"

Start a Runbook

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$OrchURI = "http://SCO01:81/Orchestrator2012/Orchestrator.svc/Jobs/"
 
$POSTBody = @"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<content type="application/xml">
<m:properties>
<d:RunbookId type="Edm.Guid">87be7221-2a15-4e41-91f6-35f4d3006d53</d:RunbookId>
<d:Parameters></d:Parameters>
</m:properties>
</content>
</entry>
"@
 
$ResponseObject = invoke-webrequest -Uri $OrchURI -method POST -Credential $mycreds -Body $POSTBody -ContentType "application/atom+xml"
$ResponseObject.Content

Postman
1
http://SCO01:81/Orchestrator2012/Orchestrator.svc/Jobs

Confirm the runbook enters running status:

Reference

Accessing System Center 2012 Orchestrator Using the Web Service

Starting Runbooks and Stopping Jobs Using the System Center 2012 Orchestrator Web Service

Calling Orchestrator Runbooks (& retrieving output) via REST