Skip to content

Instantly share code, notes, and snippets.

@PadreZippo
Created May 6, 2020 18:54
Show Gist options
  • Save PadreZippo/fdf44a08625b7fa78d88ebb00978d0c7 to your computer and use it in GitHub Desktop.
Save PadreZippo/fdf44a08625b7fa78d88ebb00978d0c7 to your computer and use it in GitHub Desktop.
Sketchfab - v2 api upload php script
<?php
$params = array(
"name" => 'test',
"description" => 'some description',
"modelFile" => new CurlFile('/some/path/file.obj'),
"token" => 'TOKEN',
"private" => 1
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,true);
curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__)."\cacert.pem"); // your local certificattion
curl_setopt($ch, CURLOPT_URL, "https://api.sketchfab.com/v2/models");
$result = curl_exec($ch);
if($result === false)
echo curl_error($ch);
else
print_r($result) ;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment