如何使用confluence API获取图像?

时间:2016-07-08 07:04:50

标签: confluence confluence-rest-api

我创建了一个脚本,从以下https://insuredhq.atlassian.net/获取所有文章是我使用过的代码。

$username = '##########';
$password = '##########';
$url = "https://insuredhq.atlassian.net/wiki/rest/api/content?spaceKey=IUM&id=Completing%20a%20Task&expand=space,body.view,version,container";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "{$username}:{$password}");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$result = curl_exec($ch);
curl_close($ch);//print_r($result);
$result = json_decode($result);
echo "<pre>";
print_r($result);

我已经检查了那些图像src属性,它们是动态网址,例如/wiki/download/attachments/13303822/Dashboard.png?version=1&amp;modificationDate=1462935137147&amp;api=v2,甚至我将它们更改为静态网址,例如https://insuredhq.atlassian.net/wiki/download/attachments/13303822/Dashboard.png?version=1&amp;modificationDate=1462935137147&amp;api=v2,但它们仍未显示。

有关详细示例,请查看此链接http://hunaniinfotech.com/insecuredhq/article.php?id=13303841

0 个答案:

没有答案