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
)
如果我与方式问题,那么请推荐一些合适的方法吧。很多谢谢