我的 Deepcrawl 爬行仅给出 null 值。
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://api.deepcrawl.com/accounts/00000/projects/195334/crawls/1306396/reports/thin_pages_basic");
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch,CURLOPT_HTTPHEADER,array('X-Auth-Token:Private'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output2 = curl_exec ($ch);
curl_close ($ch);
$results = json_decode($server_output2);
要创建会话,您首先需要手动生成 API 密钥。这是可以在 API 访问页面中生成的键/值对。当您单击“生成新 API 密钥”时,将显示一个弹出窗口,其中包含 API 密钥值,并且在“活动密钥”表中您可以找到 API 密钥 ID。然后,通过 POST 调用中的基本身份验证将其发送到会话路由。
curl -X POST -u '123:abcdef' https://api.deepcrawl.com/sessions
{
"token":"abcdef123",
"_user_href":"/users/example-user",
...
}
然后,从会话调用返回的令牌将作为 X-Auth-Token 标头传递给所有 API 调用:
curl -X GET -H 'X-Auth-Token:' https://api.deepcrawl.com/accounts/1/projects
有人可以进一步解释一下 deepcrawl 的身份验证吗?我怎样才能使用卷曲它X-Auth-Token
仅有的。对不起,我的英语不好。谢谢