0
我必須開發一個應用程序來交互inmobi API。我嘗試了一些代碼,但沒有得到任何迴應。請幫助我如何使用API。inmobi會話請求的API使用
它的API文檔的URL是https://www.inmobi.com/support/art/23847616/22916893/advertiser-reporting-api-guide/
我想創建會話,我需要在頭髮送的值。我已經嘗試使用後數據和標題以下代碼,但失敗。沒有得到任何輸出。
$request_header = array(
'Content-Type: application/json',
'userName: xxxxx',
'password: yyyyy',
'secretKey: zzzzz',
'accountId: iiiii',
);
$ch = curl_init('https://api.inmobi.com/v1.0/reporting/advertiser.json');
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $request_header);
$response = curl_exec($ch);
$info = curl_getinfo($ch);
print_r($response);print_r($info);
我得到的迴應是:
Array
(
[url] => https://api.inmobi.com/v1.0/reporting/advertiser.json
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0
[namelookup_time] => 0
[connect_time] => 2.348
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => 0
[upload_content_length] => 0
[starttransfer_time] => 0
[redirect_time] => 0
)
如果我與方式問題,那麼請推薦一些合適的方法吧。很多謝謝