Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8865813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:36:51+00:00 2026-06-14T16:36:51+00:00

I have to develop an application to interact the inmobi API. I have try

  • 0

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.

Its API docs URL is http://developer.inmobi.com/wiki/index.php?title=API_Guide_for_Onboarding_Publishers#API_Key

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.

$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' => 'xxxxxxx',
    'password' => 'xxxxx',
    'secretKey' => 'xxxx',
    'Content-type'=> '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 "<pre>";
print_r( $info);

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:36:52+00:00Added an answer on June 14, 2026 at 4:36 pm

    There are two problems in your code:

    1) The method of “https://api-sandbox.inmobi.com/v1.0/generatesession/generate” is not POST, it’s a GET method

    2) CURLOPT_HTTPHEADER is expecting an array, not a key-value pair.

    Sample 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);
    curl_setopt($ch, CURLOPT_HEADER,  truea);
    $data = array(
        'username: XXXXXXXX',
        'password: XXXXXXXX',
        'secretKey: XXXXXXXXXXXXXXX'
    );
    //curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_HTTPHEADER,  $data);
    $output = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
    echo "<pre>";
    print_r( $info);
    print_r($output);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to develop an application that display some information about the possessor of
I have develop a application that use a global keybord/mouse hook. It works perfect
I have develop android application using Android SDK, Eclipse IDE.In that some times showing
I have an application; to interact with it I have to develop an interactive
i have develop a eblast application The program is use to send a email
I have develop a web application using MVC3+EF4.1 but for urgent reason, I have
I have to develop an commercial application with mapping. I can't use Google Maps
I have to develop a application that will communicate with some external device.I would
I have to develop a application (Winforms-application) which is connected to a database within
I have to develop an application with which my client will do visual design.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.