Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 35 lines (29 sloc) 1012 Bytes
#!/usr/bin/php
<?php
require "consumer_key.php";
require "access_token.php";
require "api_url_base.php";
require "error.php";
try {
$oauth = new Oauth($consumer_key, $consumer_secret, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_AUTHORIZATION);
$oauth->enableDebug();
$oauth->setToken($access_token, $access_secret);
} catch(OAuthException $E) {
Error("setup exception", $E->getMessage(), null, null, $E->debugInfo);
}
try {
$modelId = 1234567; # CHANGEME
$modelVersion = 0; # CHANGEME
$oauth->fetch($api_url_base ."/models/$modelId/files/$modelVersion/v1?file=true", null, OAUTH_HTTP_METHOD_GET, array("Accept" => "application/json"));
$response = $oauth->getLastResponse();
$json = json_decode($response);
if (null == $json) {
PrintJsonLastError();
var_dump($response);
} else {
print_r($json);
}
} catch(OAuthException $E) {
Error("fetch exception", $E->getMessage(), null, $oauth->getLastResponseInfo(), $E->debugInfo);
}
?>
Something went wrong with that request. Please try again.