PHP Quick Start

VisualVault REST API requests using PHP

Authentication

Request an Access Token using PHP

// REQUEST
$url = 'https://demo.visualvault.com/oauth/token';
$fields = [
        "client_id" => "{clientId}",
    	"client_secret" => "{clientSecret}",
    	"username" => "{userName}",
    	"password" => "{password}",
    	"grant_type" => "password"
    	];
$ch = curl_init();
curl_setopt_array($ch, array(
	CURLOPT_POST => true,
	CURLOPT_HTTPHEADER, array(
		'Content-Type: application/json'),
	CURLOPT_POSTFIELDS => http_build_query($fields),
	CURLOPT_URL => $url
	));
curl_exec($ch);
curl_close($ch);

// RESPONSE
{
"access_token":"5KKTA889-tw04Ys1CQnXuxwH2wr-HFfMhtZCpEW3Sn5e4Stdugs4qVMB4B-lfF4iKd6dl2Ha9dY665bEdkayMsN7HtPRxxFh9PU2Jyuh7eMSxY5USbj0jtPVkO02
w-73WoZ4YBtYDVkD31uogydNzeX_jsYBTWmDsNKZeQRSnuU4zKZnJK5mvxoQJhmjZZLaH3FOfQyyS5kWPyDVVXH3zoRCfbA7ke3o0KCEtRC_DKKEbLQb7XBPs_o5LRPEZSmV
jsMcyPR0236Jybvmv89OB7T5fZPV0JvSP2puoyj70vULmtkm",

"token_type":"bearer",

"expires_in":1199,

"refresh_token":"q5pRy-r4gxnXP-dw5O-EaM0_IYtPMWYy-EEZALIbxUHuwTMKqixUw-MkmwAz_RPsUP2ydzlntIPeVFVTzwhpZ5Zny9K4i_1Qz-QJXI0Os1fhMvAn5lWjPVn__Cfr6vxB1gwbpFi5ffvL5BIubQ9XqtIdrGXiRjuphssgHuHvDC4HWfZiGm
ttZfqfsOjk3RUwsAoAtq7O4E7HEeatJO_UX55LHCgXPronnscrefFOtbeObBCCJQkI3avjTtIcyMSxQianTfDEyqNfJlZBa9VMINe7kcSqli-odzhbfbgqg04B9_tZ"
}

The access_token will be your access token to make requests with.