Using PHP to access the REST API
In this recipe, we will quickly look at how you can build an easy webpage using PHP to access the Orchestrator REST API.
Getting ready
We will make our life a bit easier and use a bit of help with PHP and REST. We will use Nate Good's HTTPFUL, which you can find at http://phphttpclient.com/ .
You need to download the following file, httpful.phar
, from his website and place it in the same directory as your script.
You also need a Webserver that uses PHP and has cURL activated. I used LAMP stack from Turnkey https://www.turnkeylinux.org/lampstack . See the There's more section for a fast how-to.
How to do it...
This is a quick intro only:
Edit a file such as
callWorkflow.php
Enter the following code:
<?php include('./httpful.phar'); $usr = '[email protected]'; $pwd = 'What4Ever'; $vroServer = '192.168.220.12:8281'; // Example Workflow "07.01 Access via PowerShell" $wfid = ...