dsnrixf6765 2014-07-08 08:36
浏览 80
已采纳

用于会话请求的inmobi API用法

I have to develop an application to interact the inmobi API. I have try some code but got no response. Please help me how to use the API.

Its API docs URL is https://www.inmobi.com/support/art/23847616/22916893/advertiser-reporting-api-guide/

I am trying to create session for which I need to send the values in header. I have try the following code with post data and header as well but failed. did not get any output.

$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);

The response I get is:

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
)

If I have the problem with the way then please suggest some suitable method for it. Many Thanks

  • 写回答

1条回答 默认 最新

  • dqnqpqv3841 2014-07-10 02:50
    关注

    Just found out that their system can't be tested with localhost. I'd move the testing script to server and it works just fine.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型
  • ¥15 深度学习中的画图问题
  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。