infamousjoeg
6/9/2017 - 8:57 PM

AIM CCP REST - Perl Example

AIM CCP REST - Perl Example

#!/usr/bin/perl

use REST::Client;

my $client = REST::Client->new();

$client->addHeader('Content-Type', 'application/json');
$client->addHeader('cache-control', 'no-cache');

$baseURL = "https://pvwa.cyberark.local"
$appID = "RESTExamples";
$safe = "T-APP-CYBR-RESTAPI";
$folder = "Root";
$objectName = "Database-MicrosoftSQLServer-sql01.cyberark.local-Svc_BambooHR";

$url = "${baseURL}/AIMWebService/api/Accounts?AppID=${appID}&Safe=${safe}&Folder=${folder}&Object=${objectName}";

$client->GET($url);
$password = $client->responseContent();

print "The password is: ${password}";