Slideshare API-PHP中的curl-问题get_slideshow

时间:2019-04-23 12:36:55

标签: php api curl

我在通过API下载我在网站www.slideshare.net上可用的幻灯片时遇到问题,无论它们是公开的还是私有的,我都无法下载自己拥有的所有幻灯片。你能帮我吗?

$apikey = 'apikey'; 

$secret = 'secret'; 

$ts = time(); 

$hash = sha1($secret.$ts);

$postdata = '&api_key='.$apikey.'&ts='.$ts.'&hash='.$hash;


$ch = curl_init(); 

curl_setopt($ch, CURLOPT_URL,"https://www.slideshare.net/api/2/get_slideshow";); 

curl_setopt($ch, CURLOPT_POST, true); 

curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); 

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 

curl_setopt($ch, CURLOPT_HEADER, false); 


$output = curl_exec($ch); 


if ($output === FALSE) {

    echo "cURL Error: " . curl_error($ch); 

} else { 

    var_dump($output); 

} 

curl_close($ch); 

0 个答案:

没有答案