title: inmobi API usage example
body: <p>I have to develop an application to interact the inmobi API. I have try some code but failed. Please help me how to use the API. </p>
  
  <p>Its API docs URL is <a href="http://developer.inmobi.com/wiki/index.php?title=API_Guide_for_Onboarding_Publishers#API_Key" rel="nofollow">http://developer.inmobi.com/wiki/index.php?title=API_Guide_for_Onboarding_Publishers#API_Key</a></p>
  
  <p>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 required output.</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "https://api-sandbox.inmobi.com/v1.0/generatesession/generate");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_POST, true);
  
  $data = array(
      'username' =&gt; 'xxxxxxx',
      'password' =&gt; 'xxxxx',
      'secretKey' =&gt; 'xxxx',
      'Content-type'=&gt; 'application/json'
  );
  //curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  curl_setopt($ch, CURLOPT_HTTPHEADER,  $data);
  $output = curl_exec($ch);
  $info = curl_getinfo($ch);
  curl_close($ch);
  echo "&lt;pre&gt;";
  print_r( $info);
  </code></pre>
  
  <p>If I have the problem with the way then please suggest some suitable method for it.
  Many Thanks</p>