ko-help-articles | Getting Started

This guide is for all app developers and publishers who wish to monetize the ad inventory on their iOS or Android apps using the light weight InMobi SDK. Before you begin integrating the SDK into your app, please follow the steps below to set up an account with InMobi, register your app and create ad placements:

Follow the simple steps and get started:

Along the way, we have highlighted important guidelines and best practices to ensure you have everything in place to monetize your app quick and easy without our assistance. Ensure that you pause for a moment to read through these messages.

Step 1: Signup with InMobi

Now that you’re here and InMobi is the chosen one, what are you waiting for? Let’s get started with your account right away. To set up an InMobi account:

  1. Sign up as a publisher.
  2. A verification email with a link will be sent to your registered email address. Click on the link to complete the verification process. (This address will be used for any future communication about your account).
  3. On log in, choose the applicability pertaining to GDPR.

Step 2: Register your App

Once you have created an account, you can proceed to register your app with InMobi. The following steps are only meant for apps published in an app store. If you have an app that is yet to be published, visit Step 2A. Let's proceed.

  1. Click Add an app

  2. Select your relevant Operating System
  3. Enter a valid app store URL
  4. Click Add to list additional apps you wish to monetize.
  5. View your completed profile from the drop down next to your user name.

Important: Please take a moment to read the compliance guidelines for properties directed to children below 13 years, and then select the check box if it applies to you.

Step 2A: Register an Unpublished App

If you have an unpublished app that is not live in the app store, just follow the simple steps below:

  1. Sign up as a Publisher.
  2. Complete the verification e-mail sent to the registered ID (The registered email ID here will receive all the communication).
  3. Choose the applicability pertaining to GDPR.
  4. Click Add app as shown in the dialog box.
  5. Choose operating system.
  6. When it's published, you can return to InMobi and link your app to its app store entry.

Remember: For apps without a URL, the test mode is enabled by default. Once live, you can click the link to enter the URL on the dashboard as shown below.

Step 3: Create Placements

  1. Select the relevant ad format to define the placement of your app.

  2. Scroll to your right/left to see more placements
  3. Enter details in Placement Name and click Create Placement
  4. Click Add Placement to create additional placements
  5. Once the setup is complete, you will get an overview of the placement details.

Important:
For Rewarded Video, please set the placement type to Interstitial.
For Native ad units, please ensure the right format and aspect ratio is selected.

Step 4: Update Payment Profile

Create, verify and activate your payment profile to make your earnings tangible! InMobi follows a payout cycle of 60 days. This means that your earnings for a given month will be credited to you at the end of the 60-day payout cycle. You have the option of receiving your payouts via PayPal or wire transfer/RTGS.

Note: This is a mandatory step and all publishers are requested to complete the details to monetize successfully.

  1. Select Earnings from the drop down next to your user name
  2. Select Add Account
  3. Add the following details:
    • Mode of Transfer
    • Bank Details
    • PAN Card Details
    • GST Details
  4. Once the setup is done, you will get an overview of your Payment Page.

Note: Your Payment Id is available under your account summary as shown below. You will be able to view it, after the payment details you provided are verified and approved.

Step 5: Control Ad Experience with Filters

By using the blocking controls built into InMobi, you can curate the experience shown to the user by reviewing and controlling the ads that appear in your app. InMobi supports ad filters at three levels to control the ad experience:

Level 1: Domain Filters

You can block ads from specific URLs. For example, you might not want to show your competitors' ads on your apps.


Level 2: URL or Keyword Filters

You can block ads by filtering URLs /Keyword Filters based on their ad text or landing page URL. For example, you can prevent ads containing the text 'weapons' or 'virus' from serving on your site or app.


Level 3: Category Filters

You can block ads from specific categories which will not be served on your app. The categories range from Business, Art, Finance, Fashion etc. For example, an app meant for kids has the option to block ads from specific categories.

Note: InMobi provides provision for blocking sensitive categories. You can block ads being served on content that includes topics such as politics, religion, mature content, gambling, etc.

Note: Blocking any ad will lower your potential earnings as it reduces competition for your inventory by removing advertiser bids from the auction. We recommend blocking only those ads that you feel are absolutely irrelevant and inappropriate to your content or your users.

exchange |

ko-help-articles | Mediated Networks

ko-help-articles | InMobi Mediation

ko-help-articles | Open RTB Integration Documents

Please refer to the following Open RTB documentation for any demand side integration. The documentation below contains information specific to InMobi’s implementation only.

ko-help-articles | Audience bidding for Custom Mediation (iOS)

In order to start setting up, you’ve to ensure that the steps mentioned in the (available InMobi Integration) have already been incorporated.

Initialise the SDK

Step1: Initialise the SDK, after the completion of Initialisation process, completion handler will be called.

void (^completionBlock)(NSError*) = ^( NSError* _Nullable  error) { 
	if (error) { 
        NSLog(@"SDK Initialization Error - %@", error.description); 
	} 
    else { 
        NSLog(@"IM Media SDK successfully initialized"); 
    } 
}; 
[IMSdk initWithAccountID:kIMAccountID consentDictionary:<gdpr consent dictionary>} andCompletionHandler:completionBlock];
	

Note: Kindly refer to the integration document for details about creating the gdpr consent dictionary.

Once you have added the SDK for iOS successfully, please follow the steps below to load the following ad units using Audience Bidding.

  1. Banner Ads
  2. Interstitial Ads

Banner Ads

Step 1: Setting up a Banner Ad and add it to your app.

Create an Instance of IMBanner.

IMBanner* bannerAd = [[IMBanner alloc] initWithFrame:frame placementId:<placementId>];
	

Notes:

  • A banner instance must be created on the main thread.
  • Similarly, all methods on this instance must be called on the main thread. Not doing so will lead to unpredictable behaviour and may affect your ability to monetize with InMobi.
  • Creating an IMBanner object before SDK initialization results in a nil being returned.
Set delegate of IMBanner

To set the delegate of the IMBanner, call:

bannerAd.delegate = self;
	

Step 2: Requesting for Bid

Requesting a bid requires IMBanner Instance,. After setting delegate of IMBanner, call preload on IMBannerPreloadManager. IMBanner has an instance of IMBannerPreloadManager as its property.

For requesting bid, call following line.

[bannerAd.preloadManager preload];
	

Implement the following IMBannerDelegates:

/** 
* Notifies the delegate that the banner has recieved the ad with the meta/transaction info. 
*/  
-(void)banner:(IMBanner*)banner didReceiveWithMetaInfo:(IMAdMetaInfo*)info { 
  	NSLog(@”bid fetched:%@”, info.getBd()); 
} 
/** 
* Notifies the delegate that the banner has failed to preload with some error. 
* It will only be recieved when preload is called. 
*/ 
-(void)banner:(IMBanner*)banner didFailToReceiveWithError:(IMRequestStatus*)error { 
	NSLog(@”bid failed to be fetched”); 
}
	

Note: Please do not destroy this instance of IMBanner, as this will be needed if InMobi wins the auction.

Step 3: Loading the Banner Ad

In case InMobi has won the auction, then you can call the load method on the preloadManager property on the IMBanner instance to load the ad.

For loading the banner ad, call following line.

[bannerAd.preloadManager load];
	

Implement the following IMBannerDelegates:

/** 
* Notifies the delegate that the banner has finished loading 
*/ 
-(void)bannerDidFinishLoading:(IMBanner*)banner { 
   	NSLog(@”Banner ad did finish loading”); 
} 
** 
* Notifies the delegate that the banner has failed to load with some error. 
*/ 
-(void)banner:(IMBanner*)banner didFailToLoadWithError:(IMRequestStatus*)error { 
   	NSLog(@”banner ad failed to load”); 
}
	

Interstitial Ads

Step 1: Setting up an Interstitial Ad and add it to your app.

Create an Instance of IMInterstitial.

IMInterstitial* interstitialAd = [[IMInterstitial alloc] initWithPlacementId:<placementId> delegate:<delegate>];
	

Notes:

  • An Interstitial instance must be created on the main thread.
  • Similarly, all methods on this instance must be called on the main thread. Not doing so will lead to unpredictable behaviour and may affect your ability to monetize with InMobi.
  • Creating an IMInterstitial object before SDK initialization results in a nil being returned.

Step 2: Requesting for Bid

Requesting a bid requires IMInterstitial Instance,. Invoke the preload method on IMInterstitialPreloadManager. IMInterstitial has an instance of IMInterstitialPreloadManager as its property.

For requesting bid, call following line.

[interstitialAd.preloadManager preload];
	

Implement the following IMInterstitialDelegate:

/** 
* Notifies the delegate that the ad server has returned an ad. Assets are not yet available. 
* Please use interstitialDidFinishLoading: to receive a callback when assets are also available. 
*/ 
-(void)interstitial:(IMInterstitial*)interstitial didReceiveWithMetaInfo:(IMAdMetaInfo*)metaInfo { 
   	NSLog(@”bid fetched:%@”, info.getBd()); 
} 
/** 
* Notifies the delegate that the interstitial has failed to recieve an Ad(failed to preload an ad) with some error. 
* This callback will only be recieved when Preload is called. 
*/ 
-(void)interstitial:(IMInterstitial*)interstitial didFailToReceiveWithError:(NSError*)error { 
   	NSLog(@”bid failed to be fetched”); 
}
	

Note: Please do not destroy this instance of IMInterstitial, as this will be needed if InMobi wins the auction

Step 3: Loading the Interstitial Ad

In case InMobi has won the auction, then you can call the load method on the preloadManager property of the IMInterstitial instance to load the ad.

For loading the interstitial ad, call following line.

[interstitialAd.preloadManager load];
	

Implement the following IMInterstitialDelegate:

/** 
* Notifies the delegate that the interstitial has finished loading and can be shown instantly. 
*/ 
-(void)interstitialDidFinishLoading:(IMInterstitial*)interstitial { 
   	NSLog(@”Interstitial ad did finish loading”); 
} 
/** 
* Notifies the delegate that the interstitial has failed to load with some error. 
*/ 
-(void)interstitial:(IMInterstitial*)interstitial didFailToLoadWithError:(IMRequestStatus *)error { 
   	NSLog(@”Interstitial ad failed to load”); 
}
	

Step 4: Show the Interstitial Ad

As Interstitial ad is already loaded, to show the interstitial ad call the following:

[interstitialAd showFromViewController:<viewController>];
	

Implement the following IMInterstitialDelegate:

/** 
* Notifies the delegate that the interstitial would be presented. 
*/ 
-(void)interstitialWillPresent:(IMInterstitial*)interstitial { 
   	NSLog(@”interstitialWillPresent”); 
}  
/** 
* Notifies the delegate that the interstitial has been presented. 
*/ 
-(void)interstitialDidPresent:(IMInterstitial*)interstitial { 
   	NSLog(@” interstitialDidPresent”); 
} 
/** 
* Notifies the delegate that the interstitial has failed to present with some error. 
*/ 
-(void)interstitial:(IMInterstitial*)interstitial didFailToPresentWithError:(IMRequestStatus*)error { 
    NSLog(@” interstitial didFailToPresentWithError”); 
}
	

ko-help-articles | Audience bidding for Custom Mediation (Android)

The Audience Bidding Android SDK integration guide (available here) will help you with the following:

  • Adding the InMobi SDK to your Project
  • Adding and Verifying the Dependencies
  • Changing the Manifest file
  • Preparing your App for Android N+
  • Initializing the InMobi SDK

Once you have added the SDK successfully, please follow the steps below to load the following ad units using Audience Bidding.

  1. Banner Ads
  2. Interstitial Ads

Banner Ads

Step 1: Setting up a Banner Ad

To display a banner ad on your app, you would first need to create a banner placement ID. After adding your app, select BANNER AD to create a placement for the ad type - Banner. Once you create the banner placement, the placement ID is available.

Step 2: Adding a Banner Ad to your App

Creating a Banner Ad

To add a banner ad in Android code, create an instance of InMobiBanner:

    InMobiBanner bannerAd = new InMobiBanner(BannerAdsActivity.this, );
    

Notes:

  • The InMobiBanner class is not thread-safe. A banner instance must be created on the UI thread.
  • Similarly, all methods on this instance must be called on the UI thread. Not doing so will lead to unpredictable behavior and may affect your ability to monetize with InMobi.
  • Creating an InMobiBanner object before SDK initialization will throw an exception
Set Banner Ad size

To set the banner size in Android code, write the following code:

    bannerAd.setBannerSize(, );
    

Step 3: Requesting for Bid

Requesting for a bid requires you to set the size of the Banner ad before requesting for a bid on the InMobiBanner instance. Once you have set the size of InMobiBanner ad, you can call the InMobiBanner#getPreloadManager()#preload() method on the instance you just created to request for a bid.

    /**
    * A sample code to request bid
    */
    public class YourActivity {
    private InMobiBanner banner;
        public void requestBid() {
        banner.setListener(new BannerAdEventListener() {
                /**
                * Called to notify that an ad was successfully loaded.
                * @param ad Represents the {@link InMobiBanner} ad which was loaded
                * @param info Represents the ad meta information
            */
                @Override
                public void onAdFetchSuccessful(@NonNull InMobiBanner ad, @NonNull AdMetaInfo info) {
                    double bid = info.getBid();
                    Log.d(TAG, "Bid received : " + bid);
                }
            /**
                * Called to notify that an ad preload has failed. 

Note This * notification is given only when you use {@code preload()} in * {@link InMobiBanner#getPreloadManager()}

* * @param ad Represents the ad which was preloaded * @param status Represents the {@link InMobiAdRequestStatus} status containing error reason */ @Override public void onAdFetchFailed(@NonNull InMobiBanner ad, @NonNull InMobiAdRequestStatus status) { Log.d(TAG, "Bid fetch failure : " + status.getMessage()); } }); // Step to preload banner banner.getPreloadManager().preload(); } }

Note:

You’ve to maintain this banner instance for loading the ad later, in case InMobi won the auction.

Step 4: Loading the Banner Ad

In case InMobi has won the auction, then you can call the InMobiBanner#getPreloadManager()#load() method on the instance to load the ad.

    /**
    * A sample code to load ad
    */
    public class InMobiCustomEvent {
        private InMobiBanner banner;
        /**
        * A sample load method for your PPM
        */
        @Override
        protected void loadBanner() {
            // Custom event load, publisher to hold InMobiBanner object
            this.banner.setListener(new BannerAdEventListener() {
            /**
                * Called to notify that an ad was successfully loaded and is ready to be displayed.
                *
                * @param ad   Represents the ad which was loaded
                * @param info Represents the ad meta information
            */
                @Override
                public void onAdLoadSucceeded(@NonNull InMobiBanner ad, @NonNull AdMetaInfo info) {
                    Log.d(TAG, "Banner displayed");
                }

                /**
                    * Called to notify that a request to load an ad failed.
                    *
                    * @param ad     Represents the ad which failed to load
                    * @param status Represents the {@link InMobiAdRequestStatus} status containing error reason
                */
                @Override
                public void onAdLoadFailed(@NonNull InMobiBanner ad, InMobiAdRequestStatus status) {
                    Log.d(TAG, "Banner display failed");
                }
            });
            this.banner.getPreloadManager().load();
        }

        // Other code
    }
    

Interstitial Ads

Step 1: Setting up an Interstitial Ad

  1. To display an Interstitial ad, you need an interstitial placement ID.
  2. After adding your app, select INTERSTITIAL AD to create a placement for ad type Interstitial.
  3. Once you successfully create the placement, the placement ID is available.

Step 2: Adding an Interstitial Ad to your App

Creating an Interstitial Ad

To create an interstitial ad, create an instance of an InMobiInterstitial like so:

InMobiInterstitial interstitialAd = new InMobiInterstitial(InterstitialAdsActivity.this, , 
mInterstitialAdEventListener);

Notes:

  • The InMobiInterstitial class is not thread-safe. An interstitial instance must be created on the UI thread.
  • Similarly, all methods on this instance must be called on the UI thread. Not doing so will lead to unpredictable behavior and may affect your ability to monetize with InMobi.
  • Creating an InMobiInterstitial object without SDK Initialization will throw an exception

Step 3: Requesting for Bid

Requesting for a bid requires you to call the API InMobiInterstitial#getPreloadManager()#preload() method on the instance you just created to request for a bid.

/**
* A sample code to request bid
*/
public class YourActivity {
    private InMobiInterstitial interstitial;

   public void requestBid() {
       interstitial = new InMobiInterstitial(context, , new InterstitialAdEventListener() {
                    /**
                    * Called to notify that an ad was successfully loaded.
                    * @param ad Represents the {@link InMobiInterstitial} ad which was loaded
                    * @param info Represents the ad meta information
                    */
                    @Override
                    public void onAdFetchSuccessful(@NonNull InMobiInterstitial ad, @NonNull AdMetaInfo info) {
                        double bid = info.getBid();
                        Log.d(TAG, "Bid received : " + bid);
                    }
                    /**
                    * Called to notify that an ad preload has failed. 

Note This * notification is given only when you use {@code preload()} in * {@link InMobiInterstitial#getPreloadManager()}

* * @param ad Represents the ad which was preloaded * @param status Represents the {@link InMobiAdRequestStatus} status containing error reason */ @Override public void onAdFetchFailed(@NonNull InMobiInterstitial ad, @NonNull InMobiAdRequestStatus status) { Log.d(TAG, "Bid fetch failure : " + status.getMessage()); } }); // Step to preload interstitial interstitial.getPreloadManager().preload(); } }

Note:

You’ve to maintain this interstitial instance for loading the ad later, in case InMobi won the auction.

Step 4: Loading & Showing the Interstitial Ad

In case InMobi has won the auction, then you can call the InMobiInterstitial#getPreloadManager()#load() method on the instance to load the ad followed by InMobiInterstitial#show() to show the ad.

/**
* A sample code to load ad
*/
public class InMobiCustomEvent {
    private InMobiInterstitial interstitial;
    /**
    * A sample load method for your PPM
    */
    @Override
    protected void loadInterstitial() {
            // Custom event load, publisher to hold InMobiInterstitial object
            interstitial.setListener(new InterstitialAdEventListener() {
                /**
                * Called to notify that an ad was successfully loaded and is ready to be displayed.
                *
                * @param ad   Represents the ad which was loaded
                * @param info Represents the ad meta information
               */
                @Override
                public void onAdLoadSucceeded(@NonNull InMobiInterstitial ad, @NonNull AdMetaInfo info) {
                     Log.d(TAG, "Interstitial loaded");
                }

               /**
                * Called to notify that a request to load an ad failed.
                *
                * @param ad     Represents the ad which failed to load
                * @param status Represents the {@link InMobiAdRequestStatus} status containing error reason
               */
                @Override
                public void onAdLoadFailed(@NonNull InMobiInterstitial ad, @NonNull InMobiAdRequestStatus status) {
                    Log.d(TAG, "Interstitial load failed");
                }
        });
        this.interstitial.getPreloadManager().load();
   }
    /**
    * A sample show method for your PPM
    */
    @Override
    protected void showInterstitial() {
        if (this.interstitial.isReady()) {
            this.interstitial.show();
        }
    }
    // Other code
}

ko-help-articles | Setting up Adcolony as an ad source

Ad Source Details:

How to Set Up AdColony as an Ad Source

Step 1: Log on to http://platform.aerserv.com/ and click on the Ad Sources link at the top of the page.

Step 2: Click the + or the Add New Ad Source button on the page

Step 3: Enter a Name for the ad source(example:AdColonyInterstitial)

Step 4: Select AdColony as the ad source

Step 5: Enter the following fields that are specific to the AdColony ad source:

FIELD DESCRIPTION REQUIRED/OPTIONAL EXAMPLE
Application ID The Application ID assigned by AdColony Required app185a7e71e1714831a49ec7
Zone ID A comma separated list of zone IDs Required vz06e8c32a037749699e7050, vz06e8c32a037749699e7050

Step 6:Enter aCPM (example:3.50)

Step 7: Select a placement(s) to assign this ad source to

Step 8: Select any desired geo or device targeting

Step 9: Click the Save button

Step 10: Download the AerServ SDK

Android

Step 1. Locate the AdColony filesinside network-support/Adcolony/

Step 2. Add adcolony.jar to your app's lib folder, i.e. [Project Name]/app/libs

Step 3. Add the following folders to your app's lib folder as necessary:

armeabi, armeabi-v7a, arm64-v8a, x86_64, and x86

Step 4. Add the following settings inside your application's build.gradle:

  android {
...
    sourceSets {
        main{
            jniLibs.srcDirs = ['libs']
        }
    }
}
...
dependencies {
    compile 'com.google.android.gms:play-services-ads:10.0.1'
    compile 'com.android.support:support-annotations:25.0.1'
}

Step 5. Add the following permissions to your AndroidManifest.xml:

<!-- Required by AdColony --><br>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <br>
<br>

<!-- Optional, but Recommended by AdColony --><br>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />

Step 6. Add the following activityto your AndroidManifest.xml:

  <activity 
  android:name="com.adcolony.sdk.AdColonyInterstitialActivity"
  android:configChanges="keyboardHidden|orientation|screenSize"
  android:hardwareAccelerated="true"/>
<activity 
  android:name="com.adcolony.sdk.AdColonyAdViewActivity"
  android:configChanges="keyboardHidden|orientation|screenSize"
  android:hardwareAccelerated="true"/>

iOS

Step 1. Add the Adcolony SDK in the folder network-support/AdColony/AdColony.framework into your project frameworks.

  • Open Target > General > Under Deployment Info and for Device Orientation, check Portrait, Upside Down, Landscape Left, and Landscape Right
  • Open Target > Build Settings > Under Architectures, confirm that your Xcode project uses Base SDK version 9.0 or greater and that it does not use the armv6 architecture
  • Open Target > Build Settings > Under Linking, add -fobjc-arc to Other Linker Flags

Add the following libraries and frameworks to Target > Build Phases > Link Binary With Libraries:

libz.1.2.5.tbd
AdColony.framework
AdSupport.framework
AudioToolbox.framework
AVFoundation.framework
CoreMedia.framework
CoreTelephony.framework
JavaScriptCore.framework
MessageUI.framework
MobileCoreServices.framework
SafariServices.framework (Set to Optional)
Social.framework (Set to Optional)
StoreKit.framework (Set to Optional)
SystemConfiguration.framework
WatchConnectivity.framework (Set to Optional)
WebKit.framework (Set to Optional)
	

Step 2. Add the following entry into your info.plist:

<key>NSCalendarsUsageDescription</key>
<string>Some ad content may create a calendar event.</string>
<key>NSMotionUsageDescription</key>
<string>Some ad content may require access to accelerometer for interactive ad experience.</string>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fb</string>
    <string>instagram</string>
    <string>tumblr</string>
    <string>twitter</string>
</array>
	

ko-help-articles | Setting up Facebook Audience Network as an ad source

Ad Source Details:

How to Set Up the Facebook Audience Network Ad Source

Step 1: Log on to http://platform.aerserv.com/ and click on the Ad Sources link at the top of the page

Step 2: Click the + or the Add New Ad Source button on thepage

Step 3: Enter a Name for the ad source (example: Facebook Interstitial)

Step 4: Select Facebook as the ad source

Step 5: Enter the following fields that are specific to the Facebook ad source:

FIELD DESCRIPTION REQUIRED/OPTIONAL EXAMPLE
Placement ID Audience Network Placement ID

To see test ads, you may prepend a test ad type to your placement.

Required

839999212758459_841267789298268

Banner Ad Size Select the banner size - leave blank for Interstitial Ads. Required

BANNER_HEIGHT_50

Test Device ID Retrieve the ID from the debug log: When testing your app with Facebook's ad units you must specify the device hashed ID to ensure the delivery of test ads. This ID is available from the debug log. Optional

Step 6: Enter aCPM (example: 3.50)

Step 7: Select a placement(s) for assigning this ad source

Step 8: Select any desired geo or device targeting

Step 9: Click Save

Step 10: Download the AerServ SDK

Locating the Facebook Audience Network Placement ID

  1. Log onto the Facebook Developer account platform and click on Account
  2. Click the My Apps Tab
  3. Click Audience network
  4. Copy the Placement ID
Adding the optional FacebookTestDeviceId

When you run your app on the simulator, test ads will show by default and indicate a successful ad serving call in your app. When testing on a device, however, you must enable test ads by copying the hashed device ID that is printed to the console and set it in code via a dedicated function.

To enable test ads, use the following:

Android:

AerServConfig config = new AerServConfig(this, YOUR_AERSERV_PLACEMENT); 
config.setDebug(true);
  

iOS:

  • Objective C:
    [AerServSDK enableTestMode:YES];
        
  • Swift:
    AerServSDK.enableTestMode(true)
        

You may also see test ads by prepending a test ad type to your Facebook placement. Please consult the Audience Network Guide from Facebook, for more details.

IMPORTANT: Remove this prefix before releasing your application to your end users! For any questions, please reach out to your account manager.

Optional Banner Ad Size

BANNER_HEIGHT_50: (Default) Phone ad size (320x50)

BANNER_HEIGHT_90: Tablet ad size (320x90)

RECTABLE_HEIGHT_250: Medium Rectangle ad size (300x250)

Android

Add the following settings inside your application's build.gradle:

implementation 'com.facebook.android:audience-network-sdk:5.9.1'
  

iOS

Step 1. Add the following frameworks from the folder network-support/Facebook/FBAudienceNetwork.framework to your project frameworks.

  1. FBAudienceNetwork.framework
  2. FBSDKCoreKit.framework

Add the following library to Target > Build Phases > Link Binary With Libraries:

libc++.tbd
  

ko-help-articles | Monetization (Server to Server)

Introduction

The InMobi Server to Server Ad Request API spec allows publishers to integrate with InMobi directly from their server. This document lays out the Ad request, response structures and the parameters included in each of them to enable publishers to integrate with InMobi.

API Versioning & End Point

The new version of the API spec is designated version 3.1. Consequently, the Ad Request URL must reflect the version. It then becomes:

HTTP End Point: http://api.w.inmobi.com/showad/v3.1
HTTPS End Point: https://api.w.inmobi.com/showad/v3.1

Request Method

Ad requests must be sent using the HTTP Post method. All request parameters must be sent within a JSON object within the POST body.

Integrating with the API

HTTP Headers

InMobi expects all HTTP headers including x-headers to be sent as a part of the request. For all forwarded headers (x-headers), InMobi expects the original values received from the user’s device.

Header Name

Type

Description

Values

Content-Type

Mandatory/Optional

The MIME type of the body of the request.

application/json

Request Object

The top-level ad request object contains the entire JSON payload with the request. This object is expected to contain, at a minimum, the following:

  • The imp object defining the request ad impressions properties
  • The site or app object containing the unique placement ID
  • The device object containing the client IP address and user agent information

The child objects and parameters under the Request object are described in the following table:

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

imp

object

request

Mandatory

Impression object. Contains details about the ad request.

site

object

request

Mandatory

Details about the publisher’s mobile website. Only applicable for mobile websites.

app

object

request

Mandatory

Details about the publisher’s mobile app. Only applicable for mobile apps.

device

object

request

Mandatory

Details about the user’s device to which the impression will be delivered.

user

object

request

Recommended

Details about the user of the device; the advertising audience.

ext

object

request

Mandatory

Extensions to the request object for sending publisher specific data.

responseformat

string

request.ext

Mandatory

json - For all ads

pchain

string

request.ext

Recommended

Payment id details for TAG compliance.

Impression (imp) Object

The imp object defines the type and number of ad impressions desired by the publisher. This is a mandatory object in the ad request and must contain one or more of the parameters dsiescribed in the table below.

iOS 9 and App Transport Security (ATS)

To receive secure ads on devices running iOS 9 and later, add the secure parameter to the impression request. This is especially important if you need secure responses. If this parameter is not present, InMobi will interpret it as a request for an unsecured ad.

For details on the other changes in iOS 9, please read our blog.

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

banner

object

imp

Recommended

A Banner object; required if this impression is offered as a banner or interstitial ad opportunity.

native

object

imp

Recommended

A Native object; required if a native ad response is desired.

displaymanager

string

imp

Recommended

Name of ad mediation partner, SDK technology or player responsible for rendering the Ad (typically mobile).

displaymanagerver

string

imp

Recommended

Version of ad mediation partner, SDK technology or player responsible for rendering the Ad (typically mobile).

secure

integer

imp

Recommended

Flag to indicate if the impression requires secure HTTPS URL creative assets and markup, where 0 = non-secure, 1 = secure.

If omitted, non-secure HTTP response is assumed.

ext

object

imp

Recommended

Extensions to the impression object.

ads

integer

imp.ext

Recommended

Number of ads in the response. The maximum allowed value is 10 but the recommended value is 1.

trackertype

string

imp

Recommended

“url_ping”, indicates NoJS ad,
Native Ads
“webview”, indicates JS ad. Rest of the adformats

pmp

object

request

Mandatory for PDB deal

Details about PMP deal

For Banner Integration - Banner (imp.banner) Object

The Banner object is used to request for a banner ad. This object is used to specify the banner impression type required. This is a Recommended field and must not be sent if the native object is part of the request.

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

w

integer

banner

Mandatory

Width of the impression in pixels.

h

integer

banner

Mandatory

Height of the impression in pixels.

api

integer array

banner

Recommended

1 if MRAID 1.0 is supported

2 if MRAID 2.0 is supported

ext

object

banner

Recommended

Extension object within the banner object to transmit parameters which are outside the spec

For Interstitial Integration - Banner (imp.banner) Object

The Banner object is used to request for an interstitial ad. This object is used to specify the banner impression type required. This is a Recommended field and must not be sent if the native object is part of the request. Please ensure that you use a separate placement id for interstitial integration in case you are integrating both banner and interstitial in your app.

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

w

integer

banner

Mandatory

Width of the impression in pixels.

h

integer

banner

Mandatory

Height of the impression in pixels.

api

integer array

banner

Recommended

1 if MRAID 1.0 is supported

2 if MRAID 2.0 is supported

ext

object

banner

Recommended

Extension object within the banner object to transmit parameters which are outside the spec

For Native Integration - Native (imp.native) Object

The Native object is used to request for a Native ad. This object is used to indicate native ad specification of the response structure required. This is a Recommended field and must not be sent if the banner object is part of the request.

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

layout

integer

native

Recommended

The Layout ID of the native ad unit. This field must be one of the following:

1 Paid Search Units

2 Recommendation Widgets

3 Promoted Listings

4 In-Ad (IAB Standard) with Native Element Units

5 Custom

ext

object

native

Recommended

Extension object within the native object to transmit parameters which are outside the spec.

screenWidth

integer

ext

Conditional Mandatory

Native object is also used for requesting inline banner ads. When request is made for inline banner ads (with placement id for inline banner), screenWidth field should be mandatory, set to slot width.

Site Object

This object should be included if the publisher’s property is a mobile website and not a mobile app. A request must not contain both a Site and an App object.

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

id

string

site

Mandatory

InMobi Placement ID for the ad placement under the given property

name

string

site

Recommended

Site name

domain

string

site

Recommended

Domain of the site

page

string

site

Recommended

URL of the page where the ad will be shown

ref

string

site

Recommended

Referrer URL that caused navigation to the current page.

cat

string array

site

Recommended

Array of IAB content categories of the app.

Please refer to the Appendix for a full list of allowed categories.

keywords

string

site

Recommended

Comma separated list of keywords about the site.

ext

object

site

Recommended

Extension object within the site object to transmit parameters which are outside the spec

reftag

string

site.ext

Recommended

Reference Tag for the ad request. The value of this parameter should be a string by which Reporting/Performance Metrics groupings are needed by the publisher.

For example, reftag=login can be used to group Reporting / Performance metrics based on advertisements served on a login page, only.

Notes:

  • Reftag parent object is site. Please pass the reftag in the following way:
    Example
    "site":
    {"id":
    "caeb5f745b85499da8c09bcb4c571206","reftag":" watchopnow.com"
    }
  • If you are sending app traffic through reftag, then pass the bundle ID (playstore or itunes) of the app via reftag. (We will update you actionable points on non-playstore and non-iOS apps shortly).reftag=”<package name> "
  • Example:

    • iOS, reftag=”com.test.inmobi”
    • Android, reftag= “com.test.inmobi”

App Object

This object should be included if the publisher’s property is a mobile app and not a mobile website. A request must not contain both a Site and an App object.

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

id

string

app

Mandatory

InMobi Placement ID for the ad placement under the given property.

name

string

app

Recommended

App name

bundle

string

app

Recommended

Application bundle or package name as provided in the Apple App Store or Google Play Store.

domain

string

app

Recommended

Domain of the app.

storeurl

string

app

Recommended

App store URL for an installed app.

cat

string array

app

Recommended

Array of IAB content categories of the app.

Please refer to the Appendix for a full list of allowed categories.

ver

string

app

Recommended

Application version.

paid

integer

app

Recommended

Indicates if it is a free or a paid app. The value must be one of:

0 if the app is free

1 if the app is a paid app

keywords

string

app

Recommended

Comma separated list of keywords about the app.

ext

object

app

Optional

Extension object within the app object to transmit parameters which are outside the spec

reftag

string

app.ext

Optional

Reference Tag for the ad request. The value of this parameter should be a string by which Reporting/Performance Metrics groupings are needed by the publisher.

For example, reftag=login can be used to group Reporting / Performance metrics based on advertisements served on a login page, only

Device Object

This object provides information pertaining to the device through which the user is interacting. Device information includes its hardware, platform, location, and carrier data. This is a mandatory object in the request and must contain all mandatory parameters listed in the following table.

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

ua

string

device

Mandatory

User Agent of the device. This must be the original user agent without any modifications.

geo

object

device

Recommended

Location of the device assumed to be the user’s current location defined by a Geo object.

lmt

integer

device

Mandatory with IDFA or GPID

Limit Ad Tracking setting of the device. The value should be:

Android:

1 If the user has turned ON “Opt out of interests-based ads”

0 If the user has turned OFF “Opt out of interests-based ads”

iOS:

1 If the user has turned ON “Limit Ad Tracking” switch on the device

0 If the user has turned OFF “Limit Ad Tracking” switch on the device

If absent, a value of 0 is assumed.

ip

string

device

Mandatory

IP Address of the device in IPv4 format. Required if the ipv6 field is absent.

make

string

device

Recommended

Device Make.

model

string

device

Recommended

Model name of the device.

os

string

device

Recommended

Name of the Operating System currently installed on the device.

osv

string

device

Recommended

Version of the Operating System currently installed on the device.

hwv

string

device

Recommended

Hardware version of the device.

h

integer

device

Recommended

Height of the device screen in pixels.

w

integer

device

Recommended

Width of the device screen in pixels.

ppi

integer

device

Recommended

Pixels per inch of the device screen.

pxratio

float

device

Recommended

The ratio of physical pixels to device independent pixels.

language

string

device

Recommended

Browser language using ISO-639-1-alpha-2.

carrier

string

device

Recommended

Name of the carrier to which the device is currently connected.

connectiontype

integer

device

Recommended

1 if Ethernet

2 if WIFI

3 if CELLULAR UNKNOWN

4 if 2G

5 if 3G

6 if 4G

ifa

string

device

Conditionally mandatory

Identifiers for Advertisers on the iOS platform. Mandatory if the app object is present in the request. If app object is present but request does not contain ifa (for iOS only) the request will be invalidated.

idv

string

device

Recommended

Identifier for vendors (on iOS).

gpid

String

device

Conditionally mandatory

Google Advertising ID on Android (Where available). Mandatory if the app object is present in the request. If app object is present but request does not contain GPID OR O1 (for Android only) the request must be invalidated.

o1

String

device

Conditionally mandatory

ODIN1 value for the device. This is an alternative to GPID. O1 is the SHA1 hashed value of the Android_ID of the device.

iuds1

String

device

Recommended

UDID of the device hashed using SHA1 (SHA1 checksum of UDID). Only applicable for devices below iOS 6.

um5

String

device

Recommended

Android: MD5 of Android_ID

iOS: UDID of the device hashed using MD5 (MD5 checksum of UDID). Only applicable for devices below iOS 6.

ext

object

device

Optional

Extension object within the device object to transmit parameters which are outside the spec.

orientation

integer

device.ext

Recommended

Device orientation used for serving ads with the most optimal orientation and user experience. The value to be sent based on the orientation of the device are as follows:

1 for portrait

2 for reverse portrait

3 for landscape

4 for reverse landscape

wc

String

device.ext

Recommended

Web cookie. For Mobile Web only.

sid

String

device.ext

Recommended

For Mobile Web only.

lid

String

device.ext

Recommended

For Mobile Web only.

locale

String

device.ext

Recommended

Indicates the Locale preference set on the device.

Note: Ensure that the orientation parameter in the ad request is dynamically passed based on the actual orientation of the user’s device. This is to ensure that orientation of the ad displayed on your site matches the orientation of the user’s device.

Geo (device.geo) Object

This object encapsulates various methods for specifying a geographic location of the device. This information is highly recommended as geo-enriched requests typically result in higher value ads. InMobi recommends sending fresh values for the user’s location to ensure the most locally relevant ads are served.

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

lat

float

geo

Recommended

Latitude of the device based on the GPS location.

lon

float

geo

Recommended

Longitude of the device based on the GPS location.

accu

float

geo

Recommended

Accuracy of the latitude and longitude of the device as indicated by the device GPS.

type

Integer

geo

Recommended

The type field will indicate if the lat, lon fields populated in the request is the actual lat lon or lat-lon derived from the IP address by the publisher.

1 if GPS/Location Services

2 if IP Address

city

String

geo

Recommended

City of the user.

country

String

geo

Recommended

Country code using ISO-3166-1-alpha-3.

zip

String

geo

Recommended

Zip code of the user.

ext

object

geo

Optional

Extension object within the geo object to transmit parameters which are outside the spec.

ts

long

geo.ext

Recommended

Timestamp of the location query from the device in milliseconds.

cbssid

string

geo.ext

Recommended

Mac Address of the Connected WiFi access point.

cct

object

geo.ext

Recommended

Connected cell tower information

vct

object array

geo.ext

Recommended

Visible cell towers information.

User Object

This object contains information (User Demographics) known or derived about the human user of the device (that is the audience for advertising). This information allows finer targeting resulting in better monetization for publishers.

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

yob

integer

user

Recommended

Year of birth of the user.

gender

string

user

Recommended

The user’s gender:

Must be one of

m for Male

f for Female

keywords

string

user

Recommended

Comma separated list of keywords, interests, or intent.

ext

object

user

Recommended

Extension object within the user object to transmit parameters which are outside the spec.

education

String

user.ext

Recommended

Education level of the user.

Possible values: highschoolorless, collegeorgraduate, postgraduateorabove

language

String

user.ext

Recommended

Content language using ISO-639-1-alpha-2.

interests

String

user.ext

Recommended

Comma separated list of user’s interests.

age

Integer

user.ext

Recommended

Age of the user in years. This must be a non-negative, non-zero value.

consent

String

user.ext

Recommended

User consent when GDPR regulations are in effect.

Deviation from the following set of values indicates an unknown entity:

0/false = No and 1/true = Yes, iab consent string

Regs Object

This object contains any legal, governmental, or industry regulations that apply to the request. The coppa flag signals whether or not the request falls under the United States Federal Trade Commission’s regulations for the United States Children’s Online Privacy Protection Act (“COPPA”).

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

coppa

integer

regs

Recommended

Flag indicating if this request is subject to the COPPA regulations established by the USA FTC, where 0 = no, 1 = yes.

ext

object

regs

Optional

Extension object within the regs object to transmit parameters which are outside the spec.

gdpr

string

regs.ext

Optional

Confirmation if the request is subject to GDPR regulations.

Deviation from the following set of values, 0 = No and 1 = Yes, indicates an unknown entity.

Private Marketplace (imp.pmp) Object

The pmp object has been specifically defined for Programmatic Direct Buying (PDB) deals. The object is expected to contain at a minimum, the following details:

  • Private auction object defining the auction type
  • Deal object containing the deal id in it

Sample:

"pmp" : {
			"private_auction" : 1,
			"deals" : [{"id":"dummyid"}
			]
	     },
		

Object / Parameter

Type

Parent Object

Mandatory/Recommended

Description

private_auction

integer

pmp

Mandatory for PDB deal

The value should be 1 to indicate it is a private auction

deal

list

pmp

Mandatory for PDB deal

Contain the deal details (id/auctiontype/bidlfoor)

Deal (deal) Object [Parent: pmp]

The deal object under pmp is used to define the deal id, auction deal type and the bid floor.

Object / Parameter

Type

Parent Object

Mandatory / Recommended

Description

id

string

deal

Mandatory for PDB deal

Contain the deal ID

at

integer

deal

Recommended for PDB deal

Auction Type as per opec rtb spec

bidfloor

float

deal

Recommended for PDB deal

Ad Request Response Samples

Sample Ad Requests

This section provides sample Ad requests for the different Ad Experiences supported by InMobi. The POST body structure provided below can be viewed when the ad request is captured using a network packet capture tool like Charles, or Wireshark, for example.

Interstitial Ads

{
"app":{
"id":"<Placement ID>", //Please replace the value with the placement id value
"bundle":"com.midasplayer.apps.candycrushsaga",
"name":"candy crush",
"domain":"king.com",
"storeurl":"https://itunes.apple.com/in/app/candy-crush-saga/id553834731?mt=8",
"cat":[
"Humor",
"Gaming"
],
"ver":"2.0",
"paid":0,
"keywords":"game, casual",
"ext": {
"reftag":"login"
}
},
"imp":{
"banner":{
"w":320,
"h":480,
"api":[
1,
2
]
},
"secure":0,
"ext": {
"ads":1
},
"displaymanager":"mopub",
"displaymanagerver":"2.0"
},
"device":{
"ifa":"FC0F3445-0FCE-40EE-8646-3CA8BB2663EA",
"ua":"Mozilla/5.0 (iPhone; CPU iPhone OS 8_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12D436 Safari/600.1.4",
"ip":"3.0.119.0",
"lmt":0,
"make":"Apple inc",
"model":"iphone 6",
"os":"iOS",
"osv":"8.0",
"hwv":"2.0",
"language":"en",
"carrier":"AT&T",
"connectiontype":2,
"geo":{
"lat":40.7127,
"lon":74.0059,
"accu":1.0,
"type":2
}
},
"ext":{
"responseformat":"json"
},
"user":{
    "yob":1990,
    "gender":"m",
    "keywords":"gamer",
    "ext":{
        "education":"collegeorgraduate",
        "language":"en",
        "interests":"gaming",
        "age":25,
        "consent": 0
    }
},
"regs":{
     "coppa":0,
      "ext": {
            "gdpr": 0
      }
}
		

Banner Ads

{
    "app":{
        "id":"<Placement ID>", //Please replace the value with the placement id value
        "bundle":"com.midasplayer.apps.candycrushsaga",
        "name":"candy crush",
        "domain":"gaming",
        "storeurl":"https://itunes.apple.com/in/app/candy-crush-saga/id553834731?mt=8",
        "cat":[
            "Humor",
            "Gaming"
        ],
        "ver":"2.0",
        "paid":0,
        "keywords":"casual, game",
	  "ext": {
       "reftag":"login"
  }
    },
    "imp":{
        "banner":{
            "w":320,
            "h":48,
            "api":[
                1,
                2
            ]
        },
        "secure":0,
	  "ext": {
       "ads":1
  },
        "displaymanager":"mopub",
        "displaymanagerver":"2.0"
    },
    "device":{
        "ifa":"FC0F3445-0FCE-40EE-8646-3CA8BB2663EA",
        "ua":"Mozilla/5.0 (iPhone; CPU iPhone OS 8_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12D436 Safari/600.1.4",
        "ip":"3.0.119.0",
        "lmt":0,
        "make":"Apple inc",
        "model":"iphone 6",
        "os":"iOS",
        "osv":"8.0",
        "hwv":"2.0",
        "language":"en",
        "carrier":"AT&T",
        "connectiontype":2,
        "geo":{
            "lat":40.7127,
            "lon":74.0059,
            "accu":1.0,
            "type":2
        }
    },
    "ext":{
        "responseformat":"json"
    },
"user":{
    "yob":1990,
    "gender":"m",
    "keywords":"gamer",
    "ext":{
        "education":"collegeorgraduate",
        "language":"en",
        "interests":"gaming",
        "age":25,
        "consent": 0
    }
},
"regs":{
     "coppa":0,
      "ext": {
            "gdpr": 0
      }
}
		

Native Ads

{
"app":{
"id":"<Placement ID>", //Please replace the value with the placement id value
"bundle":"com.midasplayer.apps.candycrushsaga",
"name":"candy crush",
"domain":"king.com",
"storeurl":"https://itunes.apple.com/in/app/candy-crush-saga/id553834731?mt=8",
"cat":[
"Humor",
"Gaming"
],
"ver":"2.0",
"paid":0,
"keywords":"casual,game",
"ext": {
"reftag":"login"
}
},
"imp":{
"native":{
"layout":2
},
"secure":0,
"trackertype":"url_ping",
"ext": {
"ads":1
},
"displaymanager":"mopub",
"displaymanagerver":"2.0"
},
"device":{
"ifa":"FC0F3445-0FCE-40EE-8646-3CA8BB2663EA",
"ua":"Mozilla/5.0 (iPhone; CPU iPhone OS 8_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12D436 Safari/600.1.4",
"ip":"3.0.119.0",
"lmt":0,
"make":"Apple inc",
"model":"iphone 6",
"os":"iOS",
"osv":"8.0",
"hwv":"2.0",
"language":"en",
"carrier":"AT&T",
"connectiontype":2,
"geo":{
"lat":40.7127,
"lon":74.0059,
"accu":1.0,
"type":2
}
},
"ext":{
"responseformat":"json"
},
"user":{
    "yob":1990,
    "gender":"m",
    "keywords":"gamer",
    "ext":{
        "education":"collegeorgraduate",
        "language":"en",
        "interests":"gaming",
        "age":25,
        "consent": 0
    }
},
"regs":{
     "coppa":0,
      "ext": {
            "gdpr": 0
      }
}
		

Native Example:

curl api.w.inmobi.com/showad/v3 -d 
'{"app":{"id":"1452884093377","bundle":"com.midasplayer.apps.candycrushsaga"},"imp":{"native":{"layout":2}, 
"secure":0,
"trackertype":"url_ping"},"device":{"ifa":"FC0F3445-0FCE-40EE-8646-3CA8BB2663EA","ua":"Mozilla/5.0
(iPhone; CPU iPhone OS 8_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0
Mobile/12D436 Safari/600.1.4","ip":"3.0.119.0"},"ext":{"responseformat":"json"}}' -H 'Content-Type: 
application/json'
		

Note: Site, device, and user information should be dynamically passed based on the user’s device and never hardcoded.

Ad Response Templates

The InMobi Ad Server responses are delivered as a UTF-8 encoded payload with JSON format. The JSON object is Base64 encoded for error free transmission and must be decoded prior to rendering the ad.

The InMobi JSON responses follow the structure shown here:

  • The root element is ads array object containing one or more ads.
  • For non-native ads, each ad element contains the pubContent object which is a render-ready HTML snippet. This HTML must be executed as is and must not be parsed. Typically, the HTML snippet is expected to be injected within a webview to display the ad.
  • For native ads, the pubContent contains a list of assets as defined by the publisher in the InMobi CI. To display a native ad, please see the Integrating Native Ads section of this guide.

JSON Response Templates

This section shows templates of JSON responses. For Banner and Interstitial ads, you must extract the value of the pubContent object and render the same in a webview. For Native ads, please see the Integrating Native Ads section of this guide.

Fill Responses

Banner Ads

{
"ads":[
{
"pubContent":"plain text"
"adtype": " ",
"width": ,
"height": ,
"lp": ,
},
{
"pubContent": "plain text"
"adtype": " ",
"width": ,
"height": ,
"lp": , 
}
.
.
.
],
"requestId":""
}
		

Sample Response:

 { "ads": [  {"pubContent":"<div style=\"display:none; position:absolute;\" id=\"im_6640_clickTarget\"></div> <script type=\"text/javascript\"> (function() {var e=window,f=encodeURIComponent,h=document,k='appendChild',l='setAttribute',p='createElement',q='',r='&',s='0',t='2',u='=',v='?m=',w='Events',x='_blank',y='a',z='click',A='clickCallback',B='clickTarget',C='error',D='event',E='function',F='height',G='href',H='iatSendClick',I='iframe',J='img',K='impressionCallback',L='onclick',M='openLandingPage',N='recordEvent',O='seamless',P='src',Q='target',R='width';e.inmobi=e.inmobi||{};var S=e.inmobi;S.d=S.d||[]; S.c=function(a,b){for(var c=S.d,d=0;d<c.length;d++)c[d].call(this,a,b)};S.recordEvent=S.c; function T(a){function b(a,b){c.c(a,b)}this.j=a.lp;this.k=a.lps;this.b=a.ct;this.f=a.tc;this.h=a.bcu;this.a=a.ns;this.l=a.ws;this.g=a.sc;a=this.a;var c=this;e[a+M]=function(){var a=T.e(c.j),b=e.mraid;'undefined'!==typeof b&&'undefined'!==typeof b.openExternal?b.openExternal(a):(a=T.e(c.k),b=h[p](y),b[l](Q,x),b[l](G,a),h.body[k](b),T.i(b))};e[a+A]=function(a){U(c,a)};e[a+K]=function(){V(c)};e[a+N]=b;this.g&&S.d.push(b)}S.Bolt=T; T.i=function(a){if(typeof a.click==E)a.click.call(a);else if(a.fireEvent)a.fireEvent(L);else if(a.dispatchEvent){var b=h.createEvent(w);b.initEvent(z,!1,!0);a.dispatchEvent(b)}};T.e=function(a){return a.replace(/\\$TS/g,q+(new Date).getTime())};function W(a,b){var c=h.getElementById(a.a+B),d=h[p](I);d[l](P,b);d[l](O,O);d[l](F,s);d[l](R,t);c[k](d)} function U(a,b){var c=e[a.a+H];c&&c();if(null!=a.b)for(var c=a.b.length,d=0;d<c;d++)W(a,T.e(a.b[d]));a.l&&(b=b||eval(D),'undefined'!==typeof b&&(c=void 0!=b.touches?b.touches[0]:b,e.external.notify(JSON.stringify({m:c.clientX,n:c.clientY}))))}function V(a){if(null!=a.f)try{var b=h.getElementById(a.a+B),c=a.f,d=h[p](I);d[l](O,O);d[l](F,s);d[l](R,t);b[k](d);var g=d.contentWindow;g&&g.document.write(c)}catch(n){}} T.prototype.c=function(a,b){function c(a,b,g){if(!(0>=g)){var n=h.getElementById(d.a+B),m=h[p](J);m[l](P,a);m[l](F,s);m[l](R,t);void 0!=m.addEventListener&&m.addEventListener(C,function(){e.setTimeout(function(){3E5<b&&(b=3E5);c(a,2*b,g-1)},b*Math.random())},!1);n[k](m)}}var d=this,g=this.h,g=g+(v+a);if(b)for(var n in b)g+=r+f(n)+u+f(b[n]);c(g,1E3,5);18==a&&V(this);8==a&&U(this,null)};})(); (function() {var a=window,c='handleClick',e='handleTouchEnd',f='handleTouchStart';a.inmobi=a.inmobi||{};function g(b,h){this.b=h;this.a=this.c=!1;var d=this;a[b+c]=function(){d.click()};a[b+f]=function(){d.start(a.event)};a[b+e]=function(){d.end()}}a.inmobi.OldTap=g;g.prototype.click=function(){this.c||this.b()};g.prototype.start=function(b){this.a=this.c=!0;b&&b.preventDefault()};g.prototype.end=function(){this.a&&(this.a=!1,this.b())};})(); new window.inmobi.Bolt({\"lp\":\"https://itunes.apple.com/app/uber/id368677368?mt\\u003d8\\u0026ct\\u003dInMobi\",\"lps\":\"https://itunes.apple.com/app/uber/id368677368?mt\\u003d8\\u0026ct\\u003dInMobi\",\"ct\":[\"https://c.w.inmobi.com/c.asm/C/t/eanpprow7z/1blu/r/2m/ba/u/0/0/0/eyJVSUQiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEiLCJJREEiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEifQ~~/109dfe8a-0155-1000-dc5f-411d5fa80095/-1/0/-1/1/0/x/12887719/NW/2t/0/api/3.1.0/dir/Y29tLm1pZGFzcGxheWVyLmFwcHMuY2FuZHljcnVzaHNhZ2E~/FsjxCRaA9bIMFv6Dh9S7VDco1z72RURlPxQeFwAAAAAAAPA_FwAAAAAAAAAAF2Gr45wqvLQ_FAISGDg1TE11NER6NDQybFlLeVlJek1YdWQwbjJlRm5URTFnSDNnWFpDOXNLeDZkL20zZDB3SCtzeFE9PRgGQkFOTkVSHBQAFAIcHBaAwKiVwKL_nSEW1cX_vvS437dGABakzo3irMX72lkVABIAADkFIRQAForC4OnbUSgQd2ViMTA0MS5hZHMuaGtnMRQEEjwVAgAsFQIAAA/-1/AA/6/17f5e44d?at\\u003d1\\u0026am\\u003d0\"],\"bcu\":\"https://et.w.inmobi.com/c.asm/C/t/eanpprow7z/1blu/r/2m/ba/u/0/0/0/eyJVSUQiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEiLCJJREEiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEifQ~~/109dfe8a-0155-1000-dc5f-411d5fa80095/-1/0/-1/0/0/x/12887719/NW/2t/0/api/3.1.0/dir/Y29tLm1pZGFzcGxheWVyLmFwcHMuY2FuZHljcnVzaHNhZ2E~/FsjxCRaA9bIMFv6Dh9S7VDco1z72RURlPxQeFwAAAAAAAPA_FwAAAAAAAAAAF2Gr45wqvLQ_FAISGDg1TE11NER6NDQybFlLeVlJek1YdWQwbjJlRm5URTFnSDNnWFpDOXNLeDZkL20zZDB3SCtzeFE9PRgGQkFOTkVSHBQAFAIcHBaAwKiVwKL_nSEW1cX_vvS437dGABakzo3irMX72lkVABIAADkFIRQAForC4OnbUSgQd2ViMTA0MS5hZHMuaGtnMRQEEjwVAgAsFQIAAA/-1/AA/6/76cf6033\",\"ws\":false,\"ns\":\"im_6640_\",\"sc\":true}); new window.inmobi.OldTap(\"im_6640_\", function() { window['im_6640_openLandingPage'](); window['im_6640_recordEvent'](8); }); </script> <style> .inmC { margin-left: auto; margin-right: auto; display: block; }</style> <div onclick=\"im_6640_handleClick()\" ontouchstart=\"im_6640_handleTouchStart()\" ontouchend=\"im_6640_handleTouchEnd()\"> <img border=\"0\" class=\"inmC\" src=\"https://i.l.inmobicdn.net/banners/FileData/6649fab2-df07-45c8-be3a-29c3505c953d.jpeg\" alt=\"Uber\" height=\"48\" width=\"307\" /> </div> <style>body{margin:0}</style> <script type=\"text/javascript\"> im_6640_recordEvent(18); </script>","adtype":"rm","width":320,"height":48,"lp":"https://c.w.inmobi.com/c.asm/C/t/eanpprow7z/1blu/r/2m/ba/u/0/0/0/eyJVSUQiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEiLCJJREEiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEifQ~~/109dfe8a-0155-1000-dc5f-411d5fa80095/-1/0/-1/1/0/x/12887719/NW/2t/0/api/3.1.0/dir/Y29tLm1pZGFzcGxheWVyLmFwcHMuY2FuZHljcnVzaHNhZ2E~/FsjxCRaA9bIMFv6Dh9S7VDco1z72RURlPxQeFwAAAAAAAPA_FwAAAAAAAAAAF2Gr45wqvLQ_FAISGDg1TE11NER6NDQybFlLeVlJek1YdWQwbjJlRm5URTFnSDNnWFpDOXNLeDZkL20zZDB3SCtzeFE9PRgGQkFOTkVSHBQAFAIcHBaAwKiVwKL_nSEW1cX_vvS437dGABakzo3irMX72lkVABIAADkFIRQAForC4OnbUSgQd2ViMTA0MS5hZHMuaGtnMRQEEjwVAgAsFQIAAA/-1/AA/6/17f5e44d"}   ],"requestId" : "109dfe5e-0155-1000-c800-3e9000000090" }
		
Native Ads
{
   "ads":[
       {
           "pubContent":"json string of ad resources",
 	     "contextCode":"",
	     "namespace":"",
       },
       {
           "pubContent":"json string of ad resources",
           "contextCode":"",
	     "namespace":"",
       },
	  .
	  .
	  .
   ],
   "requestId":""
}
		

Sample Response:

 { "ads": [  {"pubContent":{"title":"Uber","description":"Get a reliable ride in minutes with the Uber app���no reservations or waiting in taxi lines. From lo","icon":{"width":300.0,"height":300.0,"url":"http://i.l.inmobicdn.net/uac-assets/368677368-us-1455192789646","aspectRatio":1.0},"screenshots":{"width":320.0,"height":480.0,"url":"http://i.l.inmobicdn.net/banners/FileData/cef51cdf-103b-4a61-81bf-7b34d81322a7.jpeg","aspectRatio":0.66},"landingURL":"https://itunes.apple.com/app/uber/id368677368?mt=8&ct=InMobi","cta":"install","rating":4.0},"contextCode":"<div style=\"display:none; position:absolute;\" id=\"im_4194_clickTarget\"></div>\n<script type=\"text/javascript\">\n 	(function() {var e=window,f=encodeURIComponent,h=document,k='appendChild',l='setAttribute',p='createElement',q='',r='&',s='0',t='2',u='=',v='?m=',w='Events',x='_blank',y='a',z='click',A='clickCallback',B='clickTarget',C='error',D='event',E='function',F='height',G='href',H='iatSendClick',I='iframe',J='img',K='impressionCallback',L='onclick',M='openLandingPage',N='recordEvent',O='seamless',P='src',Q='target',R='width';e.inmobi=e.inmobi||{};var S=e.inmobi;S.d=S.d||[];\nS.c=function(a,b){for(var c=S.d,d=0;d<c.length;d++)c[d].call(this,a,b)};S.recordEvent=S.c;\nfunction T(a){function b(a,b){c.c(a,b)}this.j=a.lp;this.k=a.lps;this.b=a.ct;this.f=a.tc;this.h=a.bcu;this.a=a.ns;this.l=a.ws;this.g=a.sc;a=this.a;var c=this;e[a+M]=function(){var a=T.e(c.j),b=e.mraid;'undefined'!==typeof b&&'undefined'!==typeof b.openExternal?b.openExternal(a):(a=T.e(c.k),b=h[p](y),b[l](Q,x),b[l](G,a),h.body[k](b),T.i(b))};e[a+A]=function(a){U(c,a)};e[a+K]=function(){V(c)};e[a+N]=b;this.g&&S.d.push(b)}S.Bolt=T;\nT.i=function(a){if(typeof a.click==E)a.click.call(a);else if(a.fireEvent)a.fireEvent(L);else if(a.dispatchEvent){var b=h.createEvent(w);b.initEvent(z,!1,!0);a.dispatchEvent(b)}};T.e=function(a){return a.replace(/\\$TS/g,q+(new Date).getTime())};function W(a,b){var c=h.getElementById(a.a+B),d=h[p](I);d[l](P,b);d[l](O,O);d[l](F,s);d[l](R,t);c[k](d)}\nfunction U(a,b){var c=e[a.a+H];c&&c();if(null!=a.b)for(var c=a.b.length,d=0;d<c;d++)W(a,T.e(a.b[d]));a.l&&(b=b||eval(D),'undefined'!==typeof b&&(c=void 0!=b.touches?b.touches[0]:b,e.external.notify(JSON.stringify({m:c.clientX,n:c.clientY}))))}function V(a){if(null!=a.f)try{var b=h.getElementById(a.a+B),c=a.f,d=h[p](I);d[l](O,O);d[l](F,s);d[l](R,t);b[k](d);var g=d.contentWindow;g&&g.document.write(c)}catch(n){}}\nT.prototype.c=function(a,b){function c(a,b,g){if(!(0>=g)){var n=h.getElementById(d.a+B),m=h[p](J);m[l](P,a);m[l](F,s);m[l](R,t);void 0!=m.addEventListener&&m.addEventListener(C,function(){e.setTimeout(function(){3E5<b&&(b=3E5);c(a,2*b,g-1)},b*Math.random())},!1);n[k](m)}}var d=this,g=this.h,g=g+(v+a);if(b)for(var n in b)g+=r+f(n)+u+f(b[n]);c(g,1E3,5);18==a&&V(this);8==a&&U(this,null)};})();\n (function() {var a=window,c='handleClick',e='handleTouchEnd',f='handleTouchStart';a.inmobi=a.inmobi||{};function g(b,h){this.b=h;this.a=this.c=!1;var d=this;a[b+c]=function(){d.click()};a[b+f]=function(){d.start(a.event)};a[b+e]=function(){d.end()}}a.inmobi.OldTap=g;g.prototype.click=function(){this.c||this.b()};g.prototype.start=function(b){this.a=this.c=!0;b&&b.preventDefault()};g.prototype.end=function(){this.a&&(this.a=!1,this.b())};})();\n\n	new window.inmobi.Bolt({\"lp\":\"https://itunes.apple.com/app/uber/id368677368?mt\\u003d8\\u0026ct\\u003dInMobi\",\"lps\":\"https://itunes.apple.com/app/uber/id368677368?mt\\u003d8\\u0026ct\\u003dInMobi\",\"ct\":[\"https://36210.measurementapi.com/serve?action\\u003dclick\\u0026publisher_id\\u003d36210\\u0026site_id\\u003d17688\\u0026agency_id\\u003d608\\u0026ref_id\\u003d109f95b2-0155-1000-d565-429c5fa80090\\u0026unid\\u003dFC0F3445-0FCE-40EE-8646-3CA8BB2663EA\\u0026sub_placement\\u003dGWL2I9EN\\u0026sub_campaign\\u003dDisplay-Inmobi-Fetch_1_-99_US-national_R_iOS_ACQ_CPI_en_Ongoing\\u0026sub_adgroup\\u003dA081_A064_C625845\\u0026sub_ad\\u003d16039-MD-R-Photo-Q1-Refresh-Rd-2-US_Woman-3-GoingSomewhereTakeUber_320x480\",\"http://c.w.inmobi.com/c.asm/C/t/eaqys9splx/1blu/r/2m/ba/u/0/0/0/eyJVSUQiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEiLCJJREEiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEifQ~~/109f95b2-0155-1000-d565-429c5fa80090/-1/0/-1/1/0/x/12887725/NW/2t/0/api/3.1.0/dir/Y29tLm1pZGFzcGxheWVyLmFwcHMuY2FuZHljcnVzaHNhZ2E~/FqDvDxaA9bIMFoKnn-rIVDdEUC-4uk18PxQeFwAAAAAAAPA_FwAAAAAAAAAAF6RwPQrXo8A_FAISGDg1TE11NER6NDQybFlLeVlJek1YdWQwbjJlRm5URTFnSDNnWFpDOXNLeDZkL20zZDB3SCtzeFE9PRgGTkFUSVZFHBQAFAIcHBaAwKiVwOzKnyEW39m4-ZvZ3tJUABbQ-vn5v6P-viEVABIAADkFIhQAForC4OnbUSgQd2ViMTA2NS5hZHMuaGtnMRQCEjwVAgAsFQIAAA/-1/AA/6/12447bb2?at\\u003d1\\u0026am\\u003d0\"],\"bcu\":\"http://et.w.inmobi.com/c.asm/C/t/eaqys9splx/1blu/r/2m/ba/u/0/0/0/eyJVSUQiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEiLCJJREEiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEifQ~~/109f95b2-0155-1000-d565-429c5fa80090/-1/0/-1/0/0/x/12887725/NW/2t/0/api/3.1.0/dir/Y29tLm1pZGFzcGxheWVyLmFwcHMuY2FuZHljcnVzaHNhZ2E~/FqDvDxaA9bIMFoKnn-rIVDdEUC-4uk18PxQeFwAAAAAAAPA_FwAAAAAAAAAAF6RwPQrXo8A_FAISGDg1TE11NER6NDQybFlLeVlJek1YdWQwbjJlRm5URTFnSDNnWFpDOXNLeDZkL20zZDB3SCtzeFE9PRgGTkFUSVZFHBQAFAIcHBaAwKiVwOzKnyEW39m4-ZvZ3tJUABbQ-vn5v6P-viEVABIAADkFIhQAForC4OnbUSgQd2ViMTA2NS5hZHMuaGtnMRQCEjwVAgAsFQIAAA/-1/AA/6/fd482491\",\"ws\":false,\"ns\":\"im_4194_\",\"sc\":true});\n	new window.inmobi.OldTap(\"im_4194_\", function() {\n	window['im_4194_openLandingPage']();\n	window['im_4194_recordEvent'](8);\n});\n</script>","namespace":"im_4194_"}   ],"requestId" : "109f956b-0155-1000-fc00-3ec000000090" }
		

Interstitial Ads

{
   "ads":[
       {
           "pubContent":"plain text",
		"adtype": " ",
		 "width": ,
"height": ,
"lp": ,
       },
 {
           "pubContent":"plain text",
		 "adtype": " ",
		 "width": ,
"height": ,
"lp": ,
       }
	  .
	  .
	  .
   ],
   "requestId":""
}
		
Response for No-Fill
{
    "ads":[
    ],
    "requestId":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
		
Description
  • ads: The Ads object contains one or more ads which can be rendered within the publisher property
  • pubContent: The pubContent contains a render ready HTML snippet which must be used as is to display the ad

    • Base 64 decoding of the Pub content results in a JSON response, which contains the necessary meta information for the creative.
    • In the example above, the value displays the meta information like this {"landing_url":"https://play.google.com/store/apps/details?id\u003dcom.toptable","cta":"Download","icon_ad":{"w":1 94,"url":"http://mkhoj-av.s3.amazonaws.com/com.toptable-ANDROID-us-1345243w194h310","h":310}}
    • The K-V pair for this JSON are generated in the way as desired by the publisher.
    • For native ads: The information present in the JSON will have the necessary information required for creating a native ad.
  • Native Ads:
    • eventTracking:Contains a set of event URLs.
  • requestId: This is an identifier generated by InMobi denoting the request. This parameter is used to debug issues or identify ads which might have problems.
  • adtype: The type of ad contained in the response. Possible values are text, banner, rm.
  • width: The width of the ad creative.
  • height: The height of the ad creative.
  • lp:The click URL of the ad.

Integrating Native Ads

Parsing the Ad Response

A successful ad request results in an ad response as per the following template:

{
    "ads":[
        {
            "pubContent":"Json of ad resources",
            "landingPage":"",
            "beaconUrl":"",
		"eventTracking":
		{
		 "eventvalue":
		 {
 		  "urls”:[]
	       },
	       "eventvalue":
		 {
 		  "urls”:[]
	       },
		},
        },
        {
            "pubContent":"Json of ad resources",
            "landingPage":"",
            "beaconUrl":"",
		"eventTracking":
		{
		 "eventvalue":
		 {
 		  "urls”:[]
	       },
	       "eventvalue":
		 {
 		  "urls”:[]
	       },
		},
        },
	  .
	  .
	  .
    ],
    "requestId":""
}
		

A sample JSON value in the pubContent is shown below:

{
    "title":"Amazon App",
    "description":"Comprehensive Browse, search, get product details, read reviews and purchase millions of products",
    "icon":{
        "height":300,
        "width":300,
        "aspectRatio":1.0,
        "url":"http://uac-assets.inmobicdn.net/297606951-us-1448064792715"
    },
    "screenshots":{
        "height":480,
        "width":320,
        "aspectRatio":0.66,
        "url":"http://r.edge.inmobicdn.net/FileData/d2ea997b-c370-4d12-8ace-373251018df5.png"
    },
    "landingURL":"https://itunes.apple.com/app/amazon-app-shop-browse-scan/id297606951?mt\u003d8"
}
		

Each JSON parameter represents an ad asset. From the example above,

  • title: Represents the title of the ad
  • description: Description of the app on the store
  • landingURL: Represents the landing URL of the ad
  • screenshot: Represents the image associated with the ad
  • icon: Represents the Store App icon

Note: The list of fields above is not exhaustive; they have been used only as a sample. You can configure the ad template as per your site layout.

Rendering the Native Ads

Native ad rendering is completely controlled by the publisher. The publisher can decide how to handle layout and placement of the assets based the app's design and layout.

Along with rendering the ad, the publisher must also ensure events related to the ad render and click are transmitted to InMobi. For this, the steps below must be followed:

  • Fire impressions when the ad is rendered and visible on the screen.
  • Fire clicks when the ad is interacted with.

To conform to MRC’s viewability guidelines, the render beacon must only be fired when at least 50% of the ad unit is visible on the screen for at least 1 second.

The following table elicits the various event beacon values.

Interaction ID When to Fire
CTA (m=8) On click
RENDER (m=18) For new creatives, the recommendation is this needs to be done at top level record event, so that it counts render for the whole ad unit.
CLIENT_FILL (m=120) (Optional) In case the client side cache is implemented, this beacon should be fired whenever an ad unit is extracted from the cache for rendering. This helps in accurately tracking the true fill and render rates.

Recording impressions and clicks on the Native Ads

To record impression/ click on the native-ad, follow these steps:

  1. Get the list of urls based on event id eventTracking
    • For example, 8 for click, 18 for render etc.
  2. Get the list of URLs for that event for the ad.
  3. For each tracker url, do the following:
    1. Send a GET request to the urls, with an http client.
    2. Retry up to 5 times if the url fails, with an exponential backoff defined by retryTime * Uniform[0, 1], and retryTime doubled for every failure with start retry time as 1 second.
    3. Follow redirects, stop if you find a non http and non https url and mark the ping as successful.
  4. For custom event tracking:
    • Fetch the beaconUrl and append the custom event id: beaconUrl?m=id, id being the event id.

Note:

  • Impression: We recommend calling the impression function when the ad is actually displayed to the user.
  • Click: We recommend calling the click function when the ad is actually clicked by the user.

Handling landing pages

  • Fetch the value from landingPage.

Testing the Integration

Publishers can utilize the InMobi Diagnostics tool for testing integration. See the Setting Up Publisher Diagnostics topic for more details.

Ad Sizes

Parameter Value Ad Size Intended Inventory
1 120x20 All Phones (Feature Phones, iOS, Android, Windows)
2 168x28 All Phones (Feature Phones, iOS, Android, Windows)
3 216x36 All Phones (Feature Phones, iOS, Android, Windows)
4 300x50 All Phones (Feature Phones, iOS, Android, Windows)
9 320x48 Smartphones and Tablets (iOS, Android, Windows, Others)
10 300x250 Smartphones and Tablets (iOS, Android, Windows, Others)
11 728x90 Smartphones and Tablets (iOS, Android, Windows, Others)
12 468x60 Smartphones and Tablets (iOS, Android, Windows, Others)
13 120x600 Smartphones and Tablets (iOS, Android, Windows, Others)
14 320x480 Smartphones and Tablets (iOS, Android, Windows, Others) – Portrait Interstitial ads
32 480x320 Smartphones and Tablets (iOS, Android, Windows, Others) – Landscape Interstitial ads
15 320x50 Smartphones and Tablets (iOS, Android, Windows, Others)
33 1024x768 Tablets (iOS, Android, Windows) – Landscape Interstitial ads
16 768x1024 Tablets (iOS, Android, Windows) – Portrait Interstitial ads
34 1280x800 Tablets (iOS only) – Landscape Interstitial ads
17 800x1280 Tablets (iOS only) – Portrait Interstitial ads
18 160x600 Smartphones and Tablets (iOS, Android, Windows, Others)
21 480x75 Smartphones and Tablets (Windows)
27 500x130 Smartphones and Tablets (Windows)
28 292x60 Smartphones and Tablets (Windows)
29 250x250 Smartphones and Tablets (Windows)
30 250x125 Smartphones and Tablets (Windows)

Appendix

Valid Category Values

The table below contains the acceptable list of string values. Please pass comma-separated list of categories of the property during the request.

Parameter Value

Parameter description

im1

Books & Reference

im2

Business

im3

Catalogs

im4

Comics

im5

Communication

im6

Education

im7

Entertainment

im8

Finance

im9

Food & Drink

im10

Games

im10-1

Action

im10-2

Adventure

im10-3

Arcade

im10-4

Board

im10-5

Card

im10-6

Casino

im10-7

Dice

im10-8

Educational

im10-9

Family

im10-10

Kids

im10-11

Music

im10-12

Puzzle

im10-13

Racing

im10-14

Role Playing

im10-15

Simulation

im10-16

Sports

im10-17

Strategy

im10-18

Trivia

im10-19

Word

im10-20

Health & Fitness

im10-21

Lifestyle

im10-22

Media & Video

im10-23

Medical

im10-24

Music & Audio

im11

News & Magazines

im11-1

Arts & Photography

im11-2

Automotive

im11-3

Brides & Weddings

im11-4

Business & Investing

im11-5

Children's Magazines

im11-6

Computers & Internet

im11-7

Cooking, Food & Drink

im11-8

Crafts & Hobbies

im11-9

Electronics & Audio

im11-10

Entertainment

im11-11

Fashion & Style

im11-12

Health, Mind & Body

im11-13

History

im11-14

Home & Garden

im11-15

Literary Magazines & Journals

im11-16

Men's Interest

im11-17

Movies & Music

im11-18

News & Politics

im11-19

Outdoors & Nature

im11-20

Parenting & Family

im11-21

Pets

im11-22

Professional & Trade

im11-23

Regional News

im11-24

Science

im11-25

Sports & Leisure

im11-26

Teens

im11-27

Travel & Regional

im11-28

Women's Interest

im12

Personalization

im13

Productivity

im14

Shopping

im15

Social Networking

im16

Software Libraries and Demos

im17

Sports

im18

Tools

im19

Travel & Local

im20

WAP Portals

im21

Weather

Versioning

API versions are maintained using the endpoint to which ad requests need to be sent. For example: http://api.w.inmobi.com/showad/v3.1

  • Patch version updates are bug fixes and will not affect the endpoint. For example: API version 3.1.1
  • Minor version updates are additional support for new values in existing parameters. These will reflect on the endpoint. For example, API version 3.2.0.
  • Major version releases will have an impact on the endpoint. For example, Version 4.0.0.

ko-help-articles | VAST (Server to Server)

ko-help-articles | VAST (Client to Server)

ko-help-articles | Passing p-chain value

ko-help-articles | iOS

Prerequisites

  • The latest version of InMobi Mediation SDK supports iOS 9 or higher. Also, this version of iOS Mediation SDK requires XCode 10.2 or higher.
  • We recommend to call all InMobi Mediation APIs on main thread.

Step 1: Integrating the SDK

  • Step 1.1: Download the InMobi SDK

    a. Download the latest InMobi SDK below. We also provide the option to use CocoaPods!

    Download the InMobi iOS Mediation SDK here.

    The SDK bundle contains all media adapters that we support. Prune the downloaded folder to retain the media adapters you need.


    b. CocoaPods (Optional)

    In the same directory as your YOUR_PROJECT.xcodeproj, create an empty file named Podfile and copy and paste the following:

              platform :ios, '9.0'
              target 'APP_NAME' do
                    pod 'InMobiMediationSDK'
              end
    		

    Ensure your project has been closed. Using the terminal, navigate to the directory containing the Podfile and run the command: pod install. Once the installation finishes, use YOUR_PROJECT.xcworkspace to access your project moving forward.

    Inside the xcworkspace there should be a Pods directory included with an ios-sdk-pod sub-directory.

    Warning: Please remove all older versions of the InMobi SDK (8.X.X and older) and all older versions of the AerServ SDK. Otherwise, your code will not compile! Please reach out to your account manager if you have any questions. If you are using CocoaPods, be sure to remove the 'aerserv-ios-sdk' pod from your podfile and only use the 'inmobi-ios-sdk' pod.

  • Step 1.2: Add the Required Libraries

    Add the following framework into your project from the InMobi SDK download:

    • InMobiSDK.framework
    • InMobiMediationSDK.framework

    All supported mediation partner libraries and headers are present in the network-support folder, please add the mediation partners as per choice.

    Note: When using any mediation through the InMobi SDK, it is highly recommended that you use the framework that is provided along with the InMobi SDK download. These versions have been tested by our team and using any other version may not be officially supported.

  • Step 1.3: General Settings

    Under the General tab within your project's target, you'll need to add the following settings:

    • Select all desired Device Orientation inside 'Deployment Info'.
    • Add the following dependencies to Linked Frameworks and Libraries:
      • WebKit.framework
      • libsqlite3.0.tbd
      • libz.tbd
  • Step 1.4: Create a bridging header (Swift Only)

    You will need to create a bridging header if your application is built with Swift. The bridging header exposes the Objective-C implementation to Swift. To create the bridging header, you'll need to do the following:

    1. Create a new header file, InMobiSDK-Bridging-Header.h.
    2. Add the following entry to the Bridging Header:
      #import <InMobiSDK/InMobiSDK.h>
      			
    3. Add the newly created header file's path to the target'sBuild Setting->Linking->Objective-C Bridging Header

  • Step 1.5: Build Settings

    Add the following flags to the target's Build Setting->Linking->Other Flag:

    • -ObjC

  • Step 1.6: Info.plist

    You will need to add the following entries into your info.plist:

    <key>LSApplicationQueriesSchemes</key>
    <array>
    <string>fb</string>
    <string>instagram</string>
    <string>tumblr</string>
    <string>twitter</string>
    </array>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Location is used to help target content to your general area</string>
    <key>NSCalendarsUsageDescription</key>
    <string>Some ad content may create a calendar event.</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Some ad content may require access to the photo library.</string>
    <key>NSCameraUsageDescription</key>
    <string>Some ad content may access camera to take picture.</string>
    <key>NSMotionUsageDescription</key>
    <string>Some ad content may require access to accelerometer for interactive ad experience.</string>
    		

    Note: For iOS 9 and above, you will need to disable App Transport Security (ATS).
    We recommend that you disable ATS to improve fill rates. Should you choose to leave ATS enabled, your monetization may get affected! Please refer here for more detail.
    Please reach out to your account manager for any further questions you may have.

Step 2: Initializing the InMobi SDK

You must initialize our SDK before loading any ads. Initializing InMobi SDK will update server-side configurations and additionally initialize any mediated ad sources.

Within the AerServ + InMobi dashboard, click on the inventory tab and edit the specific application that is being integrated. There will be an App ID associated with that application. Use that App ID to call InMobi SDK's initializeWithAppID:. Suggested place to kick off the initialization process is in the application's AppDelegate inside the application:didFinishLaunchingWithOptions: method.

It is recommended that you initialize the InMobi SDK as early as possible and 10 seconds before making your first ad request.

  • Objective-C
    /*!
         * Looks into the supplied app id and will run pre-initialization for any mediation partner sources that requires an extra setup phase.
         *
         * @param appId a string of the app id
         * @param error error object to be populated if initialization is not completed
    */
    + (void)initializeWithAppID:(NSString*)appId andError:(NSError * _Nullable * _Nonnull)error;
    /**
         * Initialize the sdk. This must be called before any other API for the SDK is used.
         * @param appId App id obtained from the Aerserv portal.
         * @param consentDictionary InMobi relies on the publishers to obtain explicit consent from users for continuing business activities in EU as per GDPR . Consent dictionary allows publishers to indicate consent status as obtained from the users for InMobi services to function appropriately.
         * It has Three optional keys:"gdpr", IM_GDPR_CONSENT_AVAILABLE, IM_GDPR_CONSENT_IAB
         * "gdpr"(String): Whether or not the request is subjected to GDPR regulations (0 = No, 1 = Yes), omission indicates Unknown.
         * IM_GDPR_CONSENT_AVAILABLE(string): "true" : User has provided consent to collect and use data.
         *                                    "false": User has not provided consent to collect and use data.
         * IM_GDPR_CONSENT_IAB(string): Key to send the IAB consent string.
         * @param error error object to be populated if initialization is not completed
     */
     + (void)initializeWithAppID:(NSString*)appId andUserConsent:(nullable NSDictionary *)consentDictionary andError:(NSError     * _Nullable     * _Nonnull)error;
    /*!
     	* updates the user consent for a session of the app
     	* @param consentDictionary consent dictionary allows publishers to provide its consent to collect user data and use it.
     	* It has Three optional keys:"gdpr", IM_GDPR_CONSENT_AVAILABLE, IM_GDPR_CONSENT_IAB
     	* "gdpr"(String): Whether or not the request is subjected to GDPR regulations (0 = No, 1 = Yes), omission indicates Unknown.
     	* IM_GDPR_CONSENT_AVAILABLE(string): "true" : User has provided consent to collect and use data.
     	* "false": User has not provided consent to collect and use data.
     	* IM_GDPR_CONSENT_IAB(string): Key to send the IAB consent string.
     	*/
    + (void)setGDPRWithUserConsent:(NSDictionary *)consentDictionary;
    		

How to obtain the app ID:

  • Log in to the AerServ + InMobi platform.
  • Go to the 'Inventory' tab in the top navigation bar.
  • Click the 'Edit' icon next to the app whose ID you wish to obtain.
  • You will find the app ID at the very top of the page.

To set or update the General Data Protection Regulation (GDPR) user consent flag, call InMobi SDK’s +setGDPRWithUserConsent: method. Pass a dictionary with InMobi provided keys:

{	IM_GDPR_CONSENT_AVAILABLE : “true”,
		IM_GDPR_CONSENT_IAB : <IAB STRING>
}
	

If user consent was granted and if user consent was denied or unknown change IM_GDPR_CONSENT_AVAILABLE value to “FALSE” in the above dictionary.

To have the GDPR user consent flag to be set before an ad request, call +setGDPRWithUserConsent: before calling -loadAd. The values passed into +setGDPRWithUserConsent: will be stored in the NSUserDefaults, persisting the chosen consent. Thus, it is not necessary to reset the user consent value prior to each ad request; the value set is applicable for all subsequent requests until that value is reset.

An example would be:

  • Objective-C
    NSDictionary *consentDictionary =   @{IM_GDPR_CONSENT_AVAILABLE: @"true",IM_GDPR_CONSENT_IAB: @"iabConsentString"};
    [AerServSDK initializeWithAppID:@"APP_ID" andUserConsent:consentDictionary andError:&error];
    if(error) {
        NSLog(@"**** ERROR: Failed to initialize with error %@. ****",error.description);
    }
    // or
    [AerServSDK initializeWithAppID:@"APP_ID" andError:&error];
    if(error) {
        NSLog(@"**** ERROR: Failed to initialize with error %@. ****",error.description);
    }
    [AerServSDK setGDPRWithUserConsent:consentDictionary];
    		
  • Swift
    let consentDictionary : [String:String] = [IM_GDPR_CONSENT_AVAILABLE : "true", IM_GDPR_CONSENT_IAB : "iabConsentString"]
    AerServSDK.initialize(withAppID: "APP_ID", andUserConsent: consentDictionary, andError: &error)
    if((error) != nil) {
        print("**** ERROR: Failed to initialize with error %@. ****",error?.description as Any);
    }
    // or
    AerServSDK.initialize(withAppID: "APP_ID", andError: &error)
    if((error) != nil) {
        print("**** ERROR: Failed to initialize with error %@. ****",error?.description as Any);
    }
    AerServSDK.setGDPRWithUserConsent(consentDictionary)
    		

Mediation Disclaimer: Please be advised that although we are GDPR compliant, we currently have no way to send GDPR compliance as well as user consent to our mediated SDK partners. Compliance responsibility and request handling will solely depend on the SDK mediated partner. Please contact your mediated partners to avoid any issues and/or complications.

Step 3: Displaying Banner Ads

  • Step 3.1: Loading and Showing Banners

    • Create an ASAdView object by passing in a placement setup on the AerServ + InMobi dashboard as well as the banner's size. Refer to ASAdView.h for InMobi SDK's predefined sizes.
      • Objective-C
        #import <InMobiSDK/InMobiSDK.h>
        @interface ViewController()
        @property(nonatomic, strong) ASAdView* asAdView;
        @end
        @implementation ViewController
        - (void)loadBannerAd {
          // Create the AerServ banner object
          self.asAdView = [ASAdView viewWithPlacementID:@"1024876" andAdSize:ASBannerSize];   
        }
        @end
        				
      • Swift
        class ViewController: UIViewController, {
          var asAdView: ASAdView?
          func loadBannerAd() {
            // Create the AerServ banner object
            asAdView? = ASAdView(placementID: "1024876", andAdSize: ASBannerSize)
          }
        }
        				

    • Add the ASAdView object to your application's view.
      • Objective-C
        #import <InMobiSDK/InMobiSDK.h>
        @interface ViewController()
        @property(nonatomic, strong) ASAdView* asAdView;
        @end
        @implementation ViewController
        - (void)loadBannerAd {
          // Create the AerServ banner object
          self.asAdview = [ASAdView viewWithPlacementID:@"1024876" andAdSize:ASBannerSize];
          // Add banner to a parent view
          [self.view addSubview:asAdView];
        }
        @end
        				
      • Swift
        class ViewController: UIViewController {
          var asAdView: ASAdView?
          func loadBannerAd() {
            // Create the AerServ banner object
            asAdView? = ASAdView(placementID: "1024876", andAdSize: ASBannerSize)
            // Add banner to a parent view
            view.addSubview(asAdView!)
          }
        }
        				
    • In the view controller that the ASAdView object is added to, make sure that the view controller adheres to the ASAdViewDelegate protocol. Additionally, add the callback -viewControllerForPresentingModalView that will return itself.
      • Objective-C
        #import <InMobiSDK/InMobiSDK.h>
        @interface ViewController() <ASAdViewDelegate>
        @property(nonatomic, strong) ASAdView* asAdView;
        @end
        @implementation ViewController
        - (void)loadBannerAd {
          // Create the AerServ banner object
          self.asAdview = [ASAdView viewWithPlacementID:@"1024876" andAdSize:ASBannerSize];
          self.asAdview.delegate = self;
          // Add banner to a parent view
          [self.view addSubview:asAdView];
        }
        #pragma mark - AerServ Interstitial Callbacks 
        - (UIViewController*)viewControllerForPresentingModalView {
          return self;
        }
        @end
        				
      • Swift
        class ViewController: UIViewController, ASAdViewDelegate {
          var asAdView: ASAdView?
          func loadBannerAd() {
            // Create the AerServ banner object
            asAdView? = ASAdView(placementID: "1024876", andAdSize: ASBannerSize)
            asAdView?.delegate = self
            // Add banner to a parent view
            view.addSubview(asAdView!)
          }
          //MARK: AerServ Banner Callback
          func viewControllerForPresentingModalView() -> UIViewController! {
            return self  
          }
        }
        				
    • Lastly, kick off the ad request by loading the ad.
      • Objective-C
        #import <InMobiSDK/InMobiSDK.h>
        @interface ViewController() <ASAdViewDelegate>
        @property(nonatomic, strong) ASAdView* asAdView;
        @end
        @implementation ViewController
        - (void)loadBannerAd {
          // Create the AerServ banner object
          self.asAdview = [ASAdView viewWithPlacementID:@"1024876" andAdSize:ASBannerSize];
          self.asAdview.delegate = self;
          // Add banner to a parent view
          [self.view addSubview:asAdView];
          // Use loadAd to make a request to the AerServ ad server for an ad
          [self.asAdView loadAd];
        }
        #pragma mark - AerServ Banner Callbacks
        - (UIViewController*)viewControllerForPresentingModalView {
          return self;
        }
        @end
        				
      • Swift
        class ViewController: UIViewController, ASAdViewDelegate {
          var asAdView: ASAdView?
          func loadBannerAd() {
            // Create the AerServ banner object
            asAdView? = ASAdView(placementID: "1024876", andAdSize: ASBannerSize)
            asAdView?.delegate = self
            // Add banner to a parent view
            view.addSubview(asAdView!)
            // Use loadAd to make a request to the AerServ ad server for an ad
            asAdView?.loadAd()
          }
          //MARK: AerServ Banner Callback
          func viewControllerForPresentingModalView() -> UIViewController! {
            return self  
          }
        }
        				

  • Step 3.2: Optional Banner Callbacks

    You can additionally assign a delegate to listen for the banner's callback events. A few of the callbacks that can be listened to are:

    • Objective-C
      #pragma mark - AerServ Banner Callbacks
      - (void)adViewDidLoadAd:(ASAdView*)adView { }
      - (void)adViewDidPreloadAd:(ASAdView*)adView { }
      - (void)adViewDidFailToLoadAd:(ASAdView*)adView withError:(NSError*)error { }
      - (void)adWasClicked:(ASAdView*)adView { }
      			
    • Swift
      //MARK: AerServ Banner Callbacks
      func adViewDidLoadAd(_ adView: ASAdView!) { }
      func adViewDidPreloadAd(_  adView: ASAdView!) { }
      func adViewDidFail(toLoadAd adView: ASAdView!, withError error: Error!) { }
      func adWasClicked(_ adView: ASAdView!) { }
      			

    Please refer to ASAdView.h for all available callbacks and descriptions of each. Settings for specifying the banner refresh time interval, preloading, and more can be found in the ASAdView header as well.

Step 4: Displaying Interstitial Ads

  • Step 4.1: Loading and Displaying Interstitials

    • Create an ASInterstitialViewController object with a placement setup on the AerServ + InMobi dashboard and a delegate that conforms to ASInterstitialViewControllerDelegate.
      • Objective-C
        #import <InMobiSDK/InMobiSDK.h>
        @interface ViewController() <ASInterstitialViewControllerDelegate>
        @property(nonatomic, strong) ASInterstitialViewController* asInterstitialVC;
        @end
        @implementation ViewController
        - (void)loadInterstitialAd {
          // Create the AerServ interstitial object
          self.asInterstitialVC = [ASInterstitialViewController viewControllerForPlacementID:@"1000741" withDelegate:self];
        }
        @end
        				
      • Swift
        import AerServSDK
        class ViewController: UIViewController, ASInterstitialViewControllerDelegate {
          var asInterstitialVC: ASInterstitialViewController?
          func loadInterstitialAd() {
            // Create the AerServ interstitial object
            asInterstitialVC? = ASInterstitialViewController(forPlacementID: "1000741", with: self)
          }
        }
        				

    • Start the ad request by loading an ad with your specified settings.
      • Objective-C
        #import <InMobiSDK/InMobiSDK.h>
        @interface ViewController() <ASInterstitialViewControllerDelegate>
        @property(nonatomic, strong) ASInterstitialViewController* asInterstitialVC;
        @end
        @implementation ViewController
        - (void)loadInterstitialAd {
          // Create the AerServ interstitial object
          self.asInterstitialVC = [ASInterstitialViewController viewControllerForPlacementID:@"1000741" withDelegate:self];
          // Use loadAd to make a request to the AerServ ad server for an ad
          [self.asInterstitialVC loadAd];
        }
        @end
        				
      • Swift
        class ViewController: UIViewController, ASInterstitialViewControllerDelegate {
          var interstitial: ASInterstitialViewController?
          func loadInterstitialAd() {
            // Create the AerServ interstitial object
            asInterstitialVC? = ASInterstitialViewController(forPlacementID: "1000741", with: self)
            // Use loadAd to make a request to the AerServ ad server for an ad
            asInterstitialVC?.loadAd()
          }
        }
        				
    • When the ad is ready, a callback event will be triggered. From the callback, the interstitial ad can be shown from a parent view controller.
      • Objective-C
        #import <InMobiSDK/InMobiSDK.h>
        @interface ViewController() <ASInterstitialViewControllerDelegate>
        @property(nonatomic, strong) ASInterstitialViewController* asInterstitialVC;
        @end
        @implementation ViewController
        - (void)loadInterstitialAd {
          // Create the AerServ interstitial object
          self.asInterstitialVC = [ASInterstitialViewController viewControllerForPlacementID:@"1000741" withDelegate:self];
          // Use loadAd to make a request to the AerServ ad server for an ad
          [self.asInterstitialVC loadAd];
        }
        #pragma mark - AerServ Interstitial Callbacks
        - (void)interstitialViewControllerAdLoadedSuccessfully:(ASInterstitialViewController*)viewController {
          [viewController showFromViewController:self];
        }
        @end
        				
      • Swift
        class ViewController: UIViewController, ASInterstitialViewControllerDelegate {
          var asInterstitialVC: ASInterstitialViewController?
          func loadInterstitialAd() {
            // Create the AerServ interstitial object
            asInterstitialVC? = ASInterstitialViewController(forPlacementID: "1000741", with: self)
            // Use loadAd to make a request to the AerServ ad server for an ad
            asInterstitialVC?.loadAd()
          }
          //MARK: AerServ Interstitial Callbacks
          func interstitialViewControllerAdLoadedSuccessfully(_ viewController: ASInterstitialViewController!) {
            asInterstitialVC?.show(from: self)
          } 
        }
        				

  • Step 4.2: Optional Interstitial Steps

    Preloading Interstitial Ads

    Preloading an ad works in a similar fashion. Before loading the ad, the isPreload flag should be set to YES. Another callback event can be listened to for notification that a preloaded ad is ready to be shown.

    • Objective-C
      #import <InMobiSDK/InMobiSDK.h>
      @interface ViewController() <ASInterstitialViewControllerDelegate>
      @property(nonatomic, strong) ASInterstitialViewController* asInterstitialVC;
      @property(nonatomic) BOOL didPreload;
      @end
      @implementation ViewController
      /**
       * We check if the preload flag has been previously set. This is so that we don't waste an ad that has already been preloaded
       * and calling another load won't necessary fill.
       */
      - (void)loadAd {
        if(!self.didPreload) {
          self.asInterstitialVC = [ASInterstitialViewController viewControllerForPlacementID:@"1000741" withDelegate:self];
          self.asInterstitialVC.isPreload = YES;
          [self.asInterstitialVC loadAd];
        } else {
          NSLog(@"--- Ad is already loaded ---");
        }
      }
      - (void)showAd {
        if(self.didPreload) {
          [self.asInterstitialVC showFromViewController:aViewController];
        } else {
          NSLog(@"--- Interstitial hasn't preloaded ---");
        }
      }
      #pragma mark - AerServ Interstitial Callbacks
      - (void)interstitialViewControllerDidPreloadAd:(ASInterstitialViewController*)viewController {
        NSLog(@"--- Interstitial View Controller Did Preload Ad ---");
        self.didPreload = YES;
        // - [self.asInterstitialVC showFromViewController] can be called anything after this point.
      }
      - (void)interstitialViewControllerAdFailedToLoad:(ASInterstitialViewController*)viewController withError:(NSError*)error {
        NSLog(@"--- Interstitial ad failed: ', error, ' ---");
        self.didPreload = NO;
      }
      - (void)interstitialViewControllerDidDisappear:(ASInterstitialViewController*)viewController {
        NSLog(@"--- Interstitial ad did disappear ---");
        self.didPreload = NO;
      }
      @end
      			
    • Swift
      class ViewController: UIViewController, ASInterstitialViewControllerDelegate {
        var asInterstitialVC: ASInterstitialViewController?
        var didPreload = false
        /**
         * We check if the preload flag has been previously set. This is so that we don't waste an ad that has already been preloaded
         * and calling another load won't necessary fill.
         */
        func loadAd() {
          if(!didPreload) {
            asInterstitialVC? = ASInterstitialViewController(forPlacementID: "1000741", with: self)
            asInterstitialVC?.isPreload = true
            asInterstitialVC?.loadAd()
          }
        }
        func showAd() {
          if(didPreload) {
            asInterstitialVC?.show(from: aViewController)
          } else {
            print("--- Interstitial hasn't preloaded ---")
          }
        }
        //MARK: AerServ Interstitial Callbacks
        func interstitialViewControllerDidPreloadAd(_ viewController: ASInterstitialViewController!) {
          print("---- Interstitial ViewController Did Preload Ad ---")
          didPreload = true
          // interstitial?.show(from: self) can be called anything after this point.
        }
        func interstitialViewControllerAdFailed(toLoad viewController: ASInterstitialViewController!, withError error: Error!) {
          print("--- Interstitial ad failed: ", error, " ---")
          didPreload = false;
        }
        func interstitialViewControllerDidDisappear(_ viewController: ASInterstitialViewController!) {
          print("--- Interstitial ad did disappear ---")
          didPreload = false;
        }
      }
      			
    Additional Interstitial Callbacks

    Other callback events that can be listened to are:

    • Objective-C
      #pragma mark - AerServ Interstitial Callbacks
      - (void)interstitialViewControllerWillAppear:(ASInterstitialViewController*)viewController { }
      - (void)interstitialViewControllerDidAppear:(ASInterstitialViewController*)viewController { }
      - (void)interstitialViewControllerWillDisappear:(ASInterstitialViewController*)viewController { }
      - (void)interstitialViewControllerDidDisappear:(ASInterstitialViewController*)viewController { }
      - (void)interstitialViewControllerAdWasTouched:(ASInterstitialViewController*)viewController { }
      - (void)interstitialViewControllerAdFailedToLoad:(ASInterstitialViewController*)viewController withError:(NSError*)error { }
      			
    • Swift
      //MARK: AerServ Interstitial Callbacks
      func interstitialViewControllerWillAppear(_ viewController: ASInterstitialViewController!) { }
      func interstitialViewControllerDidAppear(_ viewController: ASInterstitialViewController!) { }
      func interstitialViewControllerWillDisappear(_ viewController: ASInterstitialViewController!) { }
      func interstitialViewControllerDidDisappear(_ viewController: ASInterstitialViewController!) { }
      func interstitialViewControllerAdWasTouched(_ viewController: ASInterstitialViewController!) { }
      func interstitialViewControllerAdFailed(toLoad viewController: ASInterstitialViewController!, withError error: Error!) { }
      			

    Please refer to ASInterstitialViewController.h for all available callbacks and descriptions for each. Settings for supplying video player controls, and more can be found in the ASInterstitialViewController header as well.

Step 5: Additional Settings

Virtual Currency

  • Once you have setup your placement with virtual currency, there are two additional callbacks that conform to the protocol ASInterstitialViewControllerDelegate. The first callback will notify that the virtual currency data has loaded.

    • Objective-C
      #import <InMobiSDK/InMobiSDK.h>
      @interface ViewController() <ASInterstitialViewControllerDelegate>
      @property(nonatomic, strong) ASInterstitialViewController* asInterstitialVC;
      @end
      @implementation ViewController
      - (void)loadInterstitialAd {
        self.asInterstitialVC = [ASInterstitialViewController viewControllerForPlacementID:@"1000741" withDelegate:self];
        [self.asInterstitialVC loadAd];
      }
      #pragma mark - AerServ Interstitial Callbacks
      - (void)interstitialViewControllerAdLoadedSuccessfully:(ASInterstitialViewController*)viewController {
        [viewController showFromViewController:self];
      }
      /**
       * The first callback will notify when we load the creative. Note that you can also get the buyerName and buyer price throught the didLoadAdWithTransactionInfo and
       * didShowAdWithTransactionInfo.
       */
      - (void)interstitialViewControllerDidVirtualCurrencyLoad:(ASInterstitialViewController*)viewController vcData:(NSDictionary*)vcData {
        NSString* name = vcData[@"name"];
        NSNumber* rewardAmount = vcData[@"rewardAmount"];
        NSString* buyerName = vcData[@"buyerName"];
        NSNumber* buyerPrice = vcData[@"buyerPrice"];
        // Add your logic here  
      }
      /** 
       * The second callback will notify when the virtual currency has been rewarded. This will only fire after the user has watch 100% of the video on a virtual currency
       * enable placement.
       */
      - (void)interstitialViewControllerDidVirtualCurrencyReward:(ASInterstitialViewController*)viewController vcData:(NSDictionary*)vcData {
        NSString* name = vcData[@"name"];
        NSNumber* rewardAmount = vcData[@"rewardAmount"];
        // Add your logic here  
      }
      @end
      		
    • Swift
      class ViewController: UIViewController, ASInterstitialViewControllerDelegate {
        var asInterstitialVC: ASInterstitialViewController?
        func loadInterstitialAd() {
          asInterstitialVC? = ASInterstitialViewController(forPlacementID: "1000741", with: self)
          asInterstitialVC?.loadAd()
        }
        //MARK: AerServ Interstitial Callback
        func interstitialViewControllerAdLoadedSuccessfully(_ viewController: ASInterstitialViewController!) {
          asInterstitialVC?.show(from: self)
        }
        /**
         * The first callback will notify when we load the creative. 
         */
        func interstitialViewControllerDidVirtualCurrencyLoad(_ viewController: ASInterstitialViewController!, vcData: [AnyHashable : Any]!) {
          let name: String = vcData?["name"] as! String
          let amount: NSNumber = vcData?["rewardAmount"] as! NSNumber
          let buyerName: String = vcData?["buyerName"] as! String
          let buyerPrice: NSNumber = vcData?["buyerName"] as! NSNumber
          // Add your logic here  
        }
        /**
         * The second callback will notify when the virtual currency has been rewarded. This will only fire after the user has watch 100% of the video on a virtual currency 
         * enable placement.
         */
        func interstitialViewControllerDidVirtualCurrencyReward(_ viewController: ASInterstitialViewController!, vcData: [AnyHashable : Any]!) {
          let name: String = vcData?["name"] as! String
          let amount: NSNumber = vcData?["rewardAmount"] as! NSNumber
          // Add your logic here  
        }
      }
      		

    For both of these callbacks, there is a vcData dictionary object attached that will contain the keys "name" and "rewardAmount".

  • Ad Transaction Information

    During the process of showing an ad, the InMobi SDK will additionally return information pertaining to the buyer for your ad space and the price that the ad space was bought for. This detailed information can be found from these callbacks:

    • Objective-C
      #import <InMobiSDK/InMobiSDK.h>
      @interface ViewController() <ASInterstitialViewControllerDelegate, ASAdViewDelegate>
      @property(nonatomic, strong) ASInterstitialViewController* asInterstitialVC;
      @property(nonatomic, strong) ASAdView* asAdView;
      @end
      @implementation ViewController 
      /**
       * When gettings the ad transaction information, no change are needed in how we load the ASInterstitialViewController. We
       * just need to add in the callback.
       */
      - (void)loadInterstitialAd {
        self.asInterstitialVC = [ASInterstitialViewController viewControllerForPlacementID:@"1000741" withDelegate:self];
        [self.asInterstitialVC loadAd];
      }
      /**
       * When gettings the ad transaction information, no change are needed in how we load the ASAdView. We
       * just need to add in the callback.
       */
      - (void)loadBannerAd {
        self.asAdView = [ASAdView viewWithPlacementID:@"1024876" andAdSize:ASBannerSize];
        self.asAdView.delegate = self;
        [self.view addSubview:self.asAdView];
        [self.asAdView loadAd];
      }
      #pragma mark - AerServ Interstitial Callbacks
      - (void)interstitialViewControllerAdLoadedSuccessfully:(ASInterstitialViewController*)viewController {
        [viewController showFromViewController:self];
      }
      /**
       * The didLoadAdWithTransactionInfo callback will contain the transaction information of the ad from the first load attempt. The transaction 
       * information from this callback may be different from the ad the produce the impression.
       */
      - (void)interstitialAdManager:(ASInterstitialAdManager*)viewController didLoadAdWithTransactionInfo:(NSDictionary*)transactionInfo {
        NSString* buyerName = transcationData[@"buyerName"];
        NSNumber* buyerPrice = transcationData[@"buyerPrice"];
        // Add your logic here  
      }
      /**
       * The didShowAdWithTransactionInfo callback will cotanin the transaction information of the ad that produced an impression.  
       */
      - (void)interstitialViewController:(ASInterstitialViewController*)viewController didShowAdWithTransactionInfo:(NSDictionary*)transcationData {
        NSString* buyerName = transcationData[@"buyerName"];
        NSNumber* buyerPrice = transcationData[@"buyerPrice"];
        // Add your logic here  
      }
      #pragma mark - AerServ Banner Callbacks
      - (UIViewController*)viewControllerForPresentingModalView {
        return self;
      }
      /**
       * The didLoadAdWithTransactionInfo callback will contain the transaction information of the ad from the first load attempt. The transaction 
       * information from this callback may be different from the ad the produce the impression.
       */
      - (void)adView:(ASAdView*)adVidew didLoadAdWithTransactionInfo:(NSDictionary*)transcationData {
        NSString* buyerName = transcationData[@"buyerName"];
        NSNumber* buyerPrice = transcationData[@"buyerPrice"];
        // Add your logic here  
      }
      /**
       * The didShowAdWithTransactionInfo callback will cotanin the transaction information of the ad that produced an impression.  
       */
      - (void)adView:(ASAdView*)adVidew didShowAdWithTransactionInfo:(NSDictionary*)transcationData {
        NSString* buyerName = transcationData[@"buyerName"];
        NSNumber* buyerPrice = transcationData[@"buyerPrice"];
        // Add your logic here
      }
      @end
      		
    • Swift
      class ViewController: UIViewController, ASInterstitialViewControllerDelegate, ASAdViewDelegate {
        var asInterstitialVC: ASInterstitialViewController?
        var asAdView: ASAdView?
        /**
         * When gettings the ad transaction information, no change are needed in how we load the ASInterstitialViewController. We
         * just need to add in the callback.
         */
        func loadInterstitialAd() {
          asInterstitialVC? = ASInterstitialViewController(forPlacementID: "1000741", with: self)
          asInterstitialVC?.loadAd()
        }
        /**
         * When gettings the ad transaction information, no change are needed in how we load the ASAdView. We
         * just need to add in the callback.
         */
        func loadBannerAd() {
          asAdView? = ASAdView(placementID: "1024876" andAdSize: ASBannerSize)
          asAdView?.delegate = self
          view.addSubview(asAdView!)
          asAdView?.loadAd()
        }
        //MARK: AerServ Interstitial Callbacks
        func interstitialViewControllerAdLoadedSuccessfully(_ viewController: ASInterstitialViewController!) {
          asInterstitialVC?.show(from: self)
        }
        /**
         * The didLoadAdWithTransactionInfo callback will contain the transaction information of the ad from the first load attempt. The transaction 
         * information from this callback may be different from the ad the produce the impression.
         */
        func interstitialViewController(_ viewController: ASInterstitialViewController!, didLoadAdWithTransactionInfo transcationData: [AnyHashable : Any]!) {
          let buyerName:String = transcationData?["buyerName"] as! String;
          let buyerPrice:NSNumber = transcationData?["buyerName"] as! NSNumber;
          // Add your logic here
        }
        /**
         * The didShowAdWithTransactionInfo callback will cotanin the transaction information of the ad that produced an impression.  
         */
        func interstitialViewController(_ viewController: ASInterstitialViewController!, didShowAdWithTransactionInfo transcationData: [AnyHashable : Any]!) {
          let buyerName:String = transcationData?["buyerName"] as! String;
          let buyerPrice:NSNumber = transcationData?["buyerName"] as! NSNumber;
          // Add your logic here
        }
        //MARK: Aerserv Banner Callback
        func viewControllerForPresentingModalView() -> UIViewController! {
          return self  
        }
        /**
         * The didLoadAdWithTransactionInfo callback will contain the transaction information of the ad from the first load attempt. The transaction 
         * information from this callback may be different from the ad the produce the impression.
         */ 
        func adView(_ adView: ASAdView!, didLoadAdWithTransactionInfo transcationData: [AnyHashable : Any]!) { 
          let buyerName:String = transcationData?["buyerName"] as! String;
          let buyerPrice:NSNumber = transcationData?["buyerName"] as! NSNumber;
          // Add your logic here
        }
        /**
         * The didShowAdWithTransactionInfo callback will cotanin the transaction information of the ad that produced an impression.  
         */
        func adView(_ adView: ASAdView!, didShowAdWithTransactionInfo transcationData: [AnyHashable : Any]!) { 
          let buyerName:String = transcationData?["buyerName"] as! String;
          let buyerPrice:NSNumber = transcationData?["buyerName"] as! NSNumber;
          // Add your logic here
        }
      }
      		

    The transactionData dictionary object contains keys for "buyerName" and "buyerPrice" that can be accessed for the transaction information values.

    Adding Publisher Keys

    Custom revenue reports can be generated via the SDK by assigning a dictionary object with publisher key value pairs to the pubKeys property. This is available for both interstitials and banners. For details about publisher keys, click here.

    • Objective-C
      #import <InMobiSDK/InMobiSDK.h>
      @interface ViewController() <ASInterstitialViewControllerDelegate, ASAdViewDelegate>
      @property(nonatomic, strong) ASInterstitialViewController* asInterstitialVC;
      @property(nonatomic, strong) ASAdView* asAdView;
      @end
      @implementation ViewController
      /**
       * Before loading an ad with ASInterstitialViewController, you'll need to set the values for pubKeys.
       */
      - (void)loadInterstitialAd {
        self.asInterstitialVC = [ASInterstitialViewController viewControllerForPlacementID:@"1000741" withDelegate:self];
        self.asInterstitialVC.pubKeys = @{@"channel_category":@"music", @"content_rating":@"4 stars"}; // Dictionary containing publisher keys
        [self.asInterstitialVC loadAd];
      }
      /**
       * Before loading an ad with ASAdView, you'll need to set the values for pubKeys.
       */
      - (void)loadBannerAd() {
        self.asAdView = [ASAdView viewWithPlacementID:@"1024876" andAdSize:ASBannerSize];
        self.asAdView.delegate = self;
        self.asAdView.pubKeys = @{@"partner_name":@"bloomberg", @"episode_id":@"77889"}; // Dictionary containing publisher keys
        [self.view addSubview:self.asAdView];
        [self.asAdView loadAd];
      }
      #pragma mark - AerServ Interstitial Callbacks
      - (void)interstitialViewControllerAdLoadedSuccessfully:(ASInterstitialViewController*)viewController {
        [viewController showFromViewController:self];
      }
      #pragma mark - AerServ Banner Callbacks
      - (UIViewController*)viewControllerForPresentingModalView {
        return self;
      }
      @end
      		
    • Swift
      class ViewController: UIViewController, ASInterstitialViewControllerDelegate, ASAdViewDelegate {
        var asInterstitialVC: ASInterstitialViewController?
        var asAdView: ASAdView?
        /**
         * Before loading an ad with ASInterstitialViewController, you'll need to set the values for pubKeys.
         */
        func loadInterstitialAd() {
          asInterstitialVC? = ASInterstitialViewController(forPlacementID: "1000741", with: self)
          asInterstitialVC?.pubKeys = ["channel_category": "music", "content_rating": "4 stars"] // Dictionary containing publisher keys
          asInterstitialVC?.loadAd()
        }
        /**
         * Before loading an ad with ASAdView, you'll need to set the values for pubKeys.
         */
        func loadBannerAd() {
          asAdView? = ASAdView(placementID: "1024876" andAdSize: ASBannerSize)
          asAdView?.delegate = self
          asAdView?.pubKeys = ["partner_name": "bloomberg", "episode_id": "77889"] // Dictionary containing publisher keys.
          view.addSubview(asAdView!)
          asAdView?.loadAd()
        }
        //MARK: AerServ Interstitial Callbacks
        func interstitialViewControllerAdLoadedSuccessfully(_ viewController: ASInterstitialViewController!) {
          asInterstitialVC?.show(from: self)
        }
        //MARK: AerServ Banner Callbacks
        func viewControllerForPresentingModalView() -> UIViewController! {
          return self  
        }
      }
      		

    Note: Publisher Keys can also be used as custom macro on the SSUI. Please contact support on instructions on how to use this feature.

  • Enabling Geolocation Targeting

    If your application already requests permission for geolocation, skip this step. Enabling geolocation will help target ads relevant to your user's physical location. This can be done by adding key-value pairs to your application's Info.plist. The keys will be:

    • NSLocationAlwaysUsageDescription
    • NSLocationWhenInUseUsageDescription

    The value for both will be a string that will be displayed when your application is requesting for geolocation permission.

    <key>NSLocationAlwaysUsageDescription</key> 
    <string>Location is used to help target content to your general area</string>
    <key>NSLocationWhenInUseUsageDescription</key> 
    <string>Location is used to help target content to your general area</string>
    	
  • Disabling App Transport Security for iOS 9 and above

    Select your application's Info.plist, right-click on it and open as source code. Copy the following code into your Info.plist's xml.

    <key>NSAppTransportSecurity</key>
    <dict>
      <key>NSAllowsArbitraryLoads</key><true/>
    </dict>
    	
  • iOS 12 Wifi Settings

    Enable XCode WiFi Settings

    From iOS 12 onwards Apple has introduced privacy settings to access WiFi details. If the publisher decides to share wifi details, they can take advantage of targeted ads. Benefits of ad targeting are that the ads are more useful and meaningful to users.

    How to enable Access Wifi Information?

    1. Enable access WiFi information feature to your App ID.


    2. Enable access WiFi information feature for your target app from XCode capabilities.


    3. WiFi Access should get added to your App.entitlements file. If not please add the following code to your App.entitlements file.
              <dict>
                  <key>com.apple.developer.networking.wifi-info</key>
                  <true/>
              </dict>
      		

    AVAudioSession event changes in WKWebView

    WKWebView ignores AVAudioSessionCategory, Publisher can handle audio interruptions by registering to observe AVAudioSessionInterruptionnotification posted by AVAudioSession. Publisher should ensure minimum possible disruption, and the most graceful possible recovery, from the perspective of the user.

    Observing Audio Interruptions

    To handle audio interruptions, begin by registering to observe notifications of type AVAudioSessionInterruptionNotification.

        - (void)registerForAudioInterruptionNotification {
        AVAudioSession *audioSession = [AVAudioSession sharedInstance];
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAudioSessionInterruption:) name:AVAudioSessionInterruptionNotification object:audioSession];
    }
    - (void)handleAudioSessionInterruption:(NSNotification *)notification {
        NSNumber *interruptionType = [[notification userInfo] objectForKey:AVAudioSessionInterruptionTypeKey];
        NSNumber *interruptionOption = [[notification userInfo] objectForKey:AVAudioSessionInterruptionOptionKey];
        switch (interruptionType.unsignedIntegerValue) {
            case AVAudioSessionInterruptionTypeBegan: {
                /* the system has interrupted your audio session */
                /* Pause, Save State, Update UI */
                break;
            }
            case AVAudioSessionInterruptionTypeEnded: {
                if (interruptionOption && interruptionOption.unsignedIntegerValue == AVAudioSessionInterruptionOptionShouldResume) {
                    /* the interruption has ended */
                    /* Resume, Update State, Update UI */
                }
                break;
            }
        }
    }
    	

    The posted NSNotification instance contains a userInfo dictionary providing the details of the interruption. You can determine the type of interruption by retrieving the AVAudioSessionInterruptionType value from the userInfo dictionary. The interruption type indicates whether the interruption has begun or has ended. If the interruption type is AVAudioSessionInterruptionTypeEnded, the userInfo dictionary might contain an AVAudioSessionInterruptionOptions value.

    An options value of AVAudioSessionInterruptionOptionShouldResume is a hint that indicates whether your app should automatically resume playback if it had been playing when it was interrupted. Media playback apps should always look for this flag before beginning playback after an interruption. If it’s not present, playback should not begin again until initiated by the user. Apps that don’t present a playback interface, such as a game, can ignore this flag and reactivate and resume playback when the interruption ends.

    Please Note: There is no guarantee that a begin interruption will have a corresponding end interruption. Your app needs to be aware of a switch to a foreground running state or the user pressing a Play button. In either case, determine whether your app should reactivate its audio session.

    For more details, please refer to the following:

    1. https://developer.apple.com/documentation/avfoundation/avaudiosession/1616596-interruptionnotification
    2. https://developer.apple.com/library/archive/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/HandlingAudioInterruptions/HandlingAudioInterruptions.html
  • Version History

    SDK 9.0

    • 9.0.2: 11/20/19

      - Update IMAB MoPub Plugin to support MoPub v5.10.0

      - Add SDK support for Xcode 10.2

    • 9.0.1: 10/25/19

      - Upgrade OMSDK to v1.2.19

      - Separate Moat SDK from Inmobi Core SDK

      - Separate OMSDK from Inmobi Core SDK

      - Add CocoaPods for DFP AB plugin

      - Add CocoaPods for MoPub AB plugin

      - GDPR changes, addition of new key "gdpr_consent"

    • 9.0.0: 9/20/19

      - Changes to support iOS 13

      - New and improved Modularised SDK design

      - Add InMobiMediationSDK.framework to your project for AerServ Mediation.

      - Addressing issue with layering of FAN banners upon refresh

      - SKStoreProductViewController crash fix.

      - Removed Support for iOS 8.

      - Removed Support for AerServ Native ad format.

      - Removed UIWebView from InMobi SDK. Viewability Partners might be using it.

      - Size reduction for both Framework and ipa inflation.

      - Various Bug Fixes and performance improvements

      - Adapter updates for the following mediation partners:

      • MoPub - v5.9.0
      • Google Mobile Ads - v7.50.0

      - APIs Added

      • IMBanner Class + -(void)cancel;
      • IMInterstitial Class + -(void)cancel;
      - APIs Added
      • ASAdView Class
        - @property (nonatomic, assign) ASEnvironmentType env;
        - @property (nonatomic, assign) ASPlatformType platform;
        - @property (nonatomic, assign) BOOL isMuted;
        - @property (nonatomic, assign) BOOL outlineAd;
        - @property (nonatomic, assign) BOOL sizeAdToFit;
        - @property (nonatomic, assign) BOOL useHeaderBidding;
        - @property (nonatomic, strong) NSArray* keyWords;
        - @property (nonatomic, assign) BOOL allowAdvertiserCloseButton;
        - -(void)forceRefreshAd;
        - -(CGSize)adContentSize;
        - -(void)rotateToOrientation:(UIInterfaceOrientation)newOrientation;
        - -(void)play;
        - -(void)pause;

      • ASAdViewDelegate Protocol
        - -(void)willLeaveApplicatonFromAd:(ASAdView*)adView;
        - -(void)adSizeChanged:(ASAdView*)adView;
        - -(void)adView:(ASAdView*)adView didFireAdvertiserEventWithMessage:(NSString*)msg;

      • ASInterstitialViewController Class
        - @property (nonatomic, assign) ASEnvironmentType env;
        - @property (nonatomic, assign) ASPlatformType platform;
        - @property (nonatomic, assign) BOOL isMuted;
        - @property (nonatomic, assign) BOOL showOutline;
        - @property (nonatomic, assign) BOOL useHeaderBidding;
        - -(void)play;
        - -(void)pause;
      • ASInterstitialViewControllerDelegate Protocol
        - -(void)interstitialViewControllerAdInteraction:(ASInterstitialViewController*)viewController;
        - -(void)interstitialViewController:(ASInterstitialViewController*)viewController didFireAdvertiserEventWithMessage:(NSString*)msg;
    • 8.2.0: 8/5/19
      • Chrome Custom tabs support
      • Thread Optimizations
      • Bug Fixes for SDK and AudienceBidder Plugin
    • 8.1.2: 7/18/19
      • Size reduction
      • Support for Audience Bidding for DFP
      • New api to set slot size for Banner in Audience Bidding
    • 8.1.1: 6/19/19
      • Updated AdColony SDK support to 3.3.10
      • Updated Audience Network (Facebook) support to 5.3.1
    • 8.1.0: 5/14/19
      • DFP Plugin Support
      • Mopub Audience Bidding Plugin Keyword Handling
      • Bug fixes
    • 8.0.8: 4/17/19
      • Bug Fixes
    • 8.0.7: 4/05/19
      • Additional support for higher granularity keywords
    • 8.0.5: 3/11/19
      • Audience Bidder for the Mopub Plugin
      • Telaria Adapter Deprecation
      • Flurry Banner Adapter Deprecation
      • Applovin 3rd Party API Reporting updates
      • Chartboost 3rd Party API Reporting updates
      • Mediated SDK updates
      • Bug Fixes
    • 8.0.2: 12/13/18
      • Mediation bug Fixes
    • 8.0.1: 11/28/18
      • Unified InMobi + AerServ SDK

    ko-help-articles | Android

    Prerequisites

    • The latest version of InMobi Mediation SDK supports Android 4.2.2 (Jelly Bean, API 17) and higher. Additionally, MRAID ads require API 19 and higher.
      Note: Older Android versions may work but are not officially supported.
    • Google Play Services will adhere to the user’s ad tracking preferences. For more information, please see Google's website regarding their Advertising ID.
    • We recommend to call all InMobi Mediation APIs on UiThread.

    Now that you have ensured these requirements, let's look at some checkpoints before we integrate the SDK:

    Checkpoint 1: Preparing Your App for Android 10

    InMobi SDK is compatible with Android 10 (API level 29), the latest version of the Android platform. On Android P onwards, apps make connections over HTTPS by default. Though InMobi supports the adoption of HTTPS, the current setup requires our demand partners to support HTTPS as well. The publisher can change their settings to HTTP if it has an impact on the revenue potential.

    Checkpoint 2: Preparing Your App for AndroidX

    InMobi SDK is compatible with AndroidX (JetPack) library. In case your app uses the AndroidX library, then follow the standard guidelines by Google for migration by adding both the flags in build file.

    android.useAndroidX=true
    android.enableJetifier=true
    	

    It is highly recommended to upgrade Android Gradle plugin version to 4.1 or greater to avoid known issues in the jetifier which is fixed in the latest Gradle plugin version. To upgrade Android gradle plugin version please refer to Android developer documentation.

    Step 1: Integrating the SDK

    • Step 1.1: Adding the InMobi SDK to your Project

      Option 1: Pulling the Latest SDK via JCenter

      If you are using Gradle to build your Android applications, you can pull the latest version of the SDK from JCenter as described below:

      1. Include JCenter in your top-level build.gradle file:
        allprojects {
            repositories {
                jcenter()
            }
        }
        			
      2. Add the following line to the dependencies element in your application module’s build.gradle file.
        implementation 'com.inmobi.monetization:inmobi-ads:9.0.4'
        implementation 'com.inmobi.monetization:inmobi-mediation:9.0.4'
        			
      3. Sync your Gradle project to ensure that the dependency is downloaded by the build system.

      Option 2: Adding the SDK Library to your Application Project

      Alternately, you can download the latest version of InMobi’s SDK here and copy the library to your application module’s libs/ directory.

      To add the library to your project’s dependencies, add this line to the dependencies element in your module’s build.gradle:

      implementation fileTree(dir: 'libs', include: ['*.aar'])
      		
    • Step 1.2: Adding and Verifying the Dependencies

      To monetize with the InMobi Mediation SDK, you must add the following dependencies to your app module build.gradle. For more information on why each dependency is required, see below:

      android {
        defaultConfig { 
        }
        buildTypes {
          ...
        }
        sourceSets {
          main {
          }
        }
      }
      repositories {
        ...
      }
      dependencies {
      	implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
      	implementation 'com.google.android.gms:play-services-location:17.0.0' //optional dependency for better targeting
      	implementation 'com.android.support:customtabs:28.0.0'
      	implementation 'com.squareup.picasso:picasso:2.71828'
      	implementation 'com.android.support:support-v4:28.0.0'
      	implementation 'com.android.support:recyclerview-v7:28.0.0'
      }
      		
        • Google Play Services

          The InMobi SDK for Android needs the Google Play Services library to enable better ad targeting via the Google Play Advertising ID. Additionally, the SDK also uses the Google Play Services for getting a location fix, should the user consent to collecting their location.

          To add the Google Play Services client library to your application:

          1. Add the following line to the application module’s dependency element.
            implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
            implementation 'com.google.android.gms:play-services-location:17.0.0' //optional dependency for better targeting
            					
          2. Sync your Gradle project to ensure that the dependencies are included.
        • Chrome Custom Tab

          This is required to redirect the users to URLs outside InMobi WebView:

          To add the Chrome Custom library to your application:

          1. Add the following line to the application module's dependency element in the Gradle build script:
            implementation 'com.android.support:customtabs:28.0.0'
            					
          2. Sync your Gradle project to ensure dependencies are included.

          Note: Failure to include Chrome Custom Tab dependency in your application gradle scripts will cause ad requests to fail, thus affecting monetization of your app with the InMobi SDK.

      • Picasso Library

        The InMobi SDK for Android uses the popular Picasso library for loading the ad assets. To add the Picasso library to your application:

          1. Add the following line to the application module’s dependency element in the Gradle build script:
            implementation 'com.squareup.picasso:picasso:2.71828'
            					
          2. Sync your Gradle project to ensure that the dependencies are included.

        Note: Failure to include Picasso dependency in your application gradle scripts will cause interstitial ad requests to fail, thus affecting monetization of your app with the InMobi SDK.

      • Support Library

        For supporting paged scroll of a deck of images or ads, you must use support-v4 library.

        To do so, add the following line to the application module’s dependency element in the Gradle build script.

        implementation 'com.android.support:support-v4:28.0.0'
        			
      • RecyclerView

        For supporting free scroll of a deck of images or ads, you must use use RecyclerView.

        To do so, add the following line to the application module’s dependency element in the Gradle build script.

        implementation 'com.android.support:recyclerview-v7:28.0.0'
        			

        Note: Failure to include RecyclerView dependency in your application gradle scripts will cause interstitial ad requests to fail, thus affecting monetization of your app with the InMobi SDK.

      • Miscellaneous

        At times, including the InMobi SDK may cause the 64K limit on methods that can be packaged in an Android dex file to be breached. This can happen if, for example, your app packs a lot of features for your users and includes substantive code to realize this.

        If this happens, you can use the multidex support library to enable building your app correctly. To do this:

        1. Modify the defaultConfig to mark your application as multidex enabled:
          defaultConfig {
                      applicationId "com.inmobi.samples"
                      minSdkVersion 15
                      targetSdkVersion 29 
                      versionCode 1
                      versionName "1.0.0"
                      multiDexEnabled true // add this to enable multi-dex
                  }
          				
        2. Add the following line to the dependencies element in your application module’s build script.
          implementation 'com.android.support:multidex:1.0.3'
          				
    • Note: Now that you have added the dependencies, your app's build.gradle at this point will look like as shown below:

    • Step 1.2a: Additional Configurations

      Granting Permissions

      It is highly recommended that you include ACCESS_FINE_LOCATION to enable better ad targeting. This is not a mandatory permission; however, including it will enable accurate ad targeting.

      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
      		

      For further improved targeting, you can add the ACCESS_WIFI_STATE and CHANGE_WIFI_STATE permissions to the manifest.

      <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
      <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
      		

      Hardware Acceleration

      Hardware acceleration allows you to display HTML5 video ads. To do this, add hardwareAccelerated:true element to the application tag.

      <application
          ...
          android:hardwareAccelerated="true"
          ...
      >
      		
    • Step 1.3: Proguard Configuration

      Proguarding helps to remove unused symbols and reduce the final application footprint. The following proguard directives should be added to your application’s proguard configuration file:

      -keepattributes SourceFile,LineNumberTable
      -keep class com.inmobi.** { *; }
      -keep public class com.google.android.gms.**
      -dontwarn com.google.android.gms.**
      -dontwarn com.squareup.picasso.**
      -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient{
           public *;
      }
      -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info{
           public *;
      }
      # skip the Picasso library classes
      -keep class com.squareup.picasso.** {*;}
      -dontwarn com.squareup.okhttp.**
      # skip Moat classes
      -keep class com.moat.** {*;}
      -dontwarn com.moat.**
      # skip IAB classes
      -keep class com.iab.** {*;}
      -dontwarn com.iab.**
      		
    • Step 1.4: Android Manifest

      • Add the following Android permission and activities into your Android Manifest:
        <?xml version='1.0' encoding='utf-8'?>
        <manifest xmlns:android='http://schemas.android.com/apk/res/android' package='com.sample.myapp' >
        <!-- Optional Permissions -->
        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <application
        android:allowBackup='true'
        android:label='@string/app_name'>
        </application>
        </manifest>
        			

        Note: Not including the optional permission MAY negatively impact fill for the respective networks that use these permissions.

    Step 2: Initialize the SDK

    • You must initialize SDK before loading any ads.We recommend that you invoke the initialization routine and wait for the completion callback before you intend to show your first ad. We suggest you initialize the SDK during the onCreate() state within your main activity. Failure in the initialization of SDK will cause every ad request to timeout as initialization is mandatory.
    • To initialize the SDK, invoke AerServSdk.init(activity<Activity>, siteId<String>, gdprConsentObject<JSONObject>, sdkInitializatonListener<SdkInitializationListener>) on the AerServSdk class.
    • To set or update the General Data Protection Regulation (GDPR) user consent flag, you can either call AerServSDK’s setGdprConsent method or pass it through the initialization method.

      What is a consentObject?

      A consentObject is a JSONObject representation of all kind of consent provided by the publisher to the SDK. The key is mandatory if you wish to monetize traffic from European Economic Area; InMobi relies on publishers to obtain user consent to comply with the regulations. You can read further on GDPR regulations here
      Key Type Inference
      gdpr_consent String A consent string is a series of numbers, which identifies the consent status of an Ad tech Vendor.

      The string must follow the IAB contracts as mentioned here.

      The key, gdpr_consent can be accessed via string constant IM_GDPR_CONSENT_IAB.

      gdpr_consent_available boolean

      true: Publisher has provided consent to collect and use user’s data.

      false: - Publisher has not provided consent to collect and use user’s data.

      Any value other than “true” and “false” is invalid and will be treated as value not provided by publisher, i.e. empty value.

      The key gdpr_consent_available can be accessed via string constant IM_GDPR_CONSENT_AVAILABLE.

      gdpr String Whether or not the request is subjected to GDPR regulations, deviation from the set values (0 = No, 1 = Yes ), indicate an unknown entity.
    /**
    * Start "pre-init". Returns error object with an appropriate message when SDK was
    * not successfully initialized, otherwise null.
    *
    * @param context  Context
    * @param siteId   AerServ's "siteID" or "appId"
    * @param listener Represents a listener object to provide callback when SDK initialization
    *                 process is complete
    */
    public static void init(@NonNull final Context context,
                            @NonNull final String siteId,
                            @Nullable SdkInitializationListener listener)
    /**
    * Start "pre-init". Returns error object with an appropriate message when SDK was
    * not successfully initialized, otherwise null
    *
    * @param context           Context
    * @param siteId            AerServ's "siteID" or "appId"
    * @param gdprConsentObject User consent for GDPR
    * @param listener          Represents a listener object to provide callback when SDK
    *                          initialization process is complete
    */
    public static void init(@NonNull final Context context,
                            @NonNull final String siteId,
                            @Nullable final JSONObject gdprConsentObject,
                            @Nullable final SdkInitializationListener listener)
    /**
    * Set the flag for user consent.
    *
    * @param gdprConsentObject Users' consent for GDPR.
    */
    public static void setGdprConsent(@Nullable JSONObject gdprConsentObject);
    /**
     * Returns the consent flag for GDPR
     * @param context Context. This is left in for legacy reason. Pre-unification, the AS stored the
     *                consentFlag inside the SharedPreferences. This meant we needed the context. At
     *                the same time, we don't want to remove this parameter for publisher already
     *                integrated with the older API.
     * @return Returns the flag for user consent in GDPR
     */
    @Nullable
    public static Boolean getGdprConsentFlag(@NonNull Context context);
    	

    How to obtain the app ID:

    • Log in to the AerServ + InMobi platform.
    • Go to the 'Inventory' tab in the top navigation bar.
    • Click the 'Edit' icon next to the app whose ID you wish to obtain.
    • You will find the app ID at the very top of the page.

    Mediation Disclaimer: Please be advised that although we are GDPR compliant, we currently have no way to send GDPR compliance as well as user consent to our mediated SDK partners. Compliance responsibility and request handling will solely depend on the SDK mediated partner. Please contact your mediated partners to avoid any issues and/or complications.

    Step 3: Displaying Banner Ads

    • Create an instance of the AerServBanner object. One way of doing this is to define it in your Activity's layout file, e.g. activity_main.xml. The following example will create a 320x50 banner within the MainActivity:
      <com.aerserv.sdk.AerServBanner
          android:id='@+id/banner'
          android:layout_width='320dp'
          android:layout_height='50dp'/>
      		
    • In your code, obtain a reference to the AerServBanner instance and use it to call configure() and show().
      package com.sample.myapp;
      import android.app.Activity;
      import android.os.Bundle;
      import com.aerserv.sdk.AerServBanner;
      import com.aerserv.sdk.AerServConfig;
      import com.aerserv.sdk.AerServSdk;
      public class MainActivity extends Activity {
        private static final String APP_ID = "1000473";
        private static final String PLACEMENT_ID = "1024876";
        @Override
        public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                  @Override
                  public void onInitializationComplete(@Nullable Error error) {
                      if (null != error) {
                          Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                      } else {
                          Log.d(TAG, "AerServ Init Successful");
                      }
                  }
              });
        }
        /**
         * The banner doesn't need to be loaded in the main activity. However, the context that's passed 
         * in must also be a activity context. 
         */
        public void loadBannerAd() {
          AerServConfig config = new AerServConfig(this, PLACEMENT_ID);
          /**
           * After finding the view, you'll have to typecast the view into a AerServBanner object;
           */
          banner = (AerServBanner) findViewById(R.id.banner);
          /**
           * If you are not preloading, you MUST call show right after configure is called. Failing to do
           * so will result in unintended behavior.
           */
          banner.configure(config).show();
        }
      }
      		
    • Alternatively, you can also create the AerServ Banner instance programmatically.
      package com.sample.myapp;
      import android.app.Activity;
      import android.content.res.Resources;
      import android.os.Bundle;
      import android.util.TypedValue;
      import android.view.ViewGroup;
      import android.widget.RelativeLayout;
      import com.aerserv.sdk.AerServBanner;
      import com.aerserv.sdk.AerServConfig;
      public class MainActivity extends Acitvity {
        private static final String APP_ID = "1000473";
        private static final String PLACEMENT_ID = "1024876";
        private AerServBanner banner;
        @Override
        public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                  @Override
                  public void onInitializationComplete(@Nullable Error error) {
                      if (null != error) {
                          Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                      } else {
                          Log.d(TAG, "AerServ Init Successful");
                      }
                  }
              });
        }
        /**
        * AerServBanner is a subclass of the RelativeLayout class and can be modify as such. 
        * (e.g.RelativeLayout.setLayoutParams to change the width and height of the view)
        */
        public void loadBannerAd() {
          AerServConfig config = new AerServConfig(this, PLACEMENT_ID);
          banner = new AerServBanner(this);
          /**
           * Setting the height and width of the banner. This was previously done in the xml.
           */
          Resources r = getResources();
          float width = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 320, r.getDisplayMetrics());
          float height = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, r.getDisplayMetrics());
          banner.setLayoutParams(new RelativeLayout.LayoutParams(Math.round(width), Math.round(height)));
          /**
           * Add the banner as a child view. You MUST add the view into the UI before calling configure 
           * and show. In this example, we'll be adding it to the root view group.
           */
          ((ViewGroup) findViewById(android.R.id.content)).addView(banner);
          banner.configure(config).show();
        }
      }
      		

      If you’d like your app to listen to ad events and know when an ad has loaded or failed, implement an AerServEventListener and add it to your AerServConfig object:

      package com.sample.myapp;
      import android.app.Activity;
      import android.os.Bundle;
      import android.util.Log;
      import java.util.List;
      import com.aerserv.sdk.AerServBanner;
      import com.aerserv.sdk.AerServConfig;
      import com.aerserv.sdk.AerServEvent;
      import com.aerserv.sdk.AerServEventListener;
      import com.aerserv.sdk.AerServSdk;
      public class MainActivity extends Acitivity {
        private static final String APP_ID = "1000473";
        private static final String PLACEMENT_ID = "1024876";
        @Override
        public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                  @Override
                  public void onInitializationComplete(@Nullable Error error) {
                      if (null != error) {
                          Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                      } else {
                          Log.d(TAG, "AerServ Init Successful");
                      }
                  }
              });
        }
        public void loadBannerAd() {
          AerServEventListener listener = new AerServEventListener() {
            @Override
            public void onAerServEvent(AerServEvent event, List params) {
              switch (event) {
                case AD_LOADED:
                  // Execute some code when AD_LOADED event occurs.
                  break;
                case AD_DISMISSED:
                  // Execute some code when AD_DISMISSED event occurs.
                  break;
                case AD_FAILED:
                  // Execute some code when AD_FAILED event occurs.
                  break;
              }
            }
          };
          AerServConfig config = new AerServConfig(this, PLACEMENT_ID);
          /**
          * You'll have to pass the AerServEventListener through the the AerServConfig.
          */
          config.setEventListener(listener); 
          AerServbanner banner = (AerServBanner) findViewById(R.id.banner);
          banner.configure(config).show();
        }
      }
      		

    For additional events, please see Additional Settings section.

    • You should pause your banner when your app is backgrounded, and play it when the app resumes. You can also kill a banner.

      The methods are:

      package com.sample.myapp;
      import android.app.Activity;
      import android.os.Bundle;
      import com.aerserv.sdk.AerServBanner;
      import com.aerserv.sdk.AerServConfig;
      import com.aerserv.sdk.AerServSdk;
      public class MainActivity extends Activity {
        private static final String APP_ID = "1000473";
        private static final String PLACEMENT_ID = "1024876";
        private AerServBanner banner = null;
        @Override
        public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                  @Override
                  public void onInitializationComplete(@Nullable Error error) {
                      if (null != error) {
                          Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                      } else {
                          Log.d(TAG, "AerServ Init Successful");
                      }
                  }
              });
        }
        /**
         * You will want to call pause when the banner goes out of view. One example of this occurring is 
         * when the activity goes into the pause state, it prevents the banner from refreshing in the 
         * background. This will occur when you switch the intent to another activity or when the
         * application goes into the background.
         */
        @Override
        public void onPause() {
          if(banner != null) {
            banner.pause();
          }
        }
        /**
         * Once the activity resumes and the banner is in view again, you can resume the banner refresh.
         */
        @Override
        public void onResume() {
          if(banner != null) {
            banner.play();
          }
        }
        /**
         * Once the activity is about to be destroyed, you'll want to call kill on the banner object to 
         * to ensure that all resources is cleaned.
         */
        @Override
        public void onDestroy() {
          if(banner != null) {
            banner.kill();
          }
        }
        public void loadBannerAd() {
          // The PLC 1024876 is for testing only and returns a 320x50 static HTML banner
          AerServConfig config = new AerServConfig(this, PLACEMENT_ID);
          AerServBanner banner = (AerServBanner) findViewById(R.id.banner);
          banner.configure(config).show();
        }
      }
      		
    • Pausing a banner will prevent it from refreshing, and killing it will remove it from the view.

    Step 4: Display Interstitial Ads

    You can configure and show a test interstitial ad in your Activity, as follows:

    package com.sample.myapp;
    import android.app.Activity;
    import android.os.Bundle;
    import com.aerserv.sdk.AerServSdk;
    import com.aerserv.sdk.AerServConfig;
    import com.aerserv.sdk.AerServInterstitial;
    public class MainActivity extends Activity {
      private static final String APP_ID = "1000473";
      private static final String PLACEMENT_ID = "1000741";
      @Override
      public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                @Override
                public void onInitializationComplete(@Nullable Error error) {
                    if (null != error) {
                        Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                    } else {
                        Log.d(TAG, "AerServ Init Successful");
                    }
                }
            });
      }
      public void loadInterstitialAd() {
          AerServConfig config = new AerServConfig(this, PLACEMENT_ID); 
          AerServInterstitial interstitial = new AerServInterstitial(config); 
          interstitial.show();
      }
    ]
    	

    If you’d like your app to listen to ad events and know when an ad has loaded or failed, implement an AerServEventListener and add it to your AerServConfig object:

    package com.sample.myapp;
    import android.app.Activity;
    import android.os.Bundle;
    import android.util.Log;
    import java.util.List;
    import com.aerserv.sdk.AerServConfig;
    import com.aerserv.sdk.AerServEvent;
    import com.aerserv.sdk.AerServEventListener;
    import com.aerserv.sdk.AerServInterstitial;
    import com.aerserv.sdk.AerServSdk;
    public class MainActivity extends Acitivity {
      private static final String APP_ID = "1000473";
      private static final String PLACEMENT_ID = "1000741";
      @Override
      public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                @Override
                public void onInitializationComplete(@Nullable Error error) {
                    if (null != error) {
                        Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                    } else {
                        Log.d(TAG, "AerServ Init Successful");
                    }
                }
            });
      }
      public void loadInterstitialAd() {
        AerServEventListener listener = new AerServEventListener() {
          @Override
          public void onAerServEvent(AerServEvent event, List params) {
            switch (event) {
              case AD_LOADED:
                // Execute some code when AD_LOADED event occurs.
                break;
              case AD_DISMISSED:
                // Execute some code when AD_DISMISSED event occurs.
                break;
              case AD_FAILED:
                // Execute some code when AD_FAILED event occurs.
                break;
            }
          }
        };
        AerServConfig config = new AerServConfig(this, PLACEMENT_ID);
        /**
         * You'll have to pass the AerServEventListener through the the AerServConfig.
         */
        config.setEventListener(listener); 
        AerServInterstitial interstitial = new AerServInterstitial(config); 
        interstitial.show();
      }
    }
    	
  • For additional events, please see Additional Settings section.
  • Preloading will start the process of fetching an ad and caching the video. It also informs the app earlier whether it will get an ad. We highly recommend that you use this feature whenever possible.

    To preload an interstitial ad, the steps are:

    1. Create an AerServEventListener listener and listen to the PRELOAD_READY event. When the event is fired, the ad is successfully preloaded.
    2. Create an AerServConfig object, and set the above AerServEventListener as listener. Set preload flag to true in above AerServConfig object.
    3. Instantiate an AerServInterstitial object, which will start the preload process. Do NOT call show() yet, as the ad is still being loaded. When you are ready to show the ad, call show(). You must only call show after you have received PRELOAD_READY event in step 1 above.

    Here is the code snippet for the above steps:

    package com.sample.myapp;
    import android.app.Activity;
    import android.os.Bundle;
    import android.util.Log;
    import java.util.List;
    import com.aerserv.sdk.AerServConfig;
    import com.aerserv.sdk.AerServEvent;
    import com.aerserv.sdk.AerServEventListener;
    import com.aerserv.sdk.AerServInterstitial;
    import com.aerserv.sdk.AerServSdk;
    public class MainActivity extends Activity {
      private static final String APP_ID = "1000473";
      private static final String PLACEMENT_ID = "1000741";
      private AerServInterstitial interstitial = null;
      private bool isAdLoaded = false; 
      @Override
      public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                @Override
                public void onInitializationComplete(@Nullable Error error) {
                    if (null != error) {
                        Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                    } else {
                        Log.d(TAG, "AerServ Init Successful");
                    }
                }
            });
      }
      /**
       * We check if the preload flag has been previously set. This is so that we don't waste an ad that 
       * has already been preloaded and calling another load won't necessary fill.
       */
      public void loadInterstitialAd() {
          if(isAdLoaded == false) {
            AerServEventListener listener = new AerServEventListener() {
              @Override
              public void onAerServEvent(AerServEvent event, List params) {
                switch (event) {
                  case PRELOAD_READY:
                    MainActivity.this.isAdLoaded = true;
                    // Anywhere after this point you can call showInterstitial();
                    break;
                  case AD_DISMISSED:
                    MainActivity.this.isAdLoaded = false;
                    Log.v(MainActivity.class.getSimpleName(), "Interstitial was shown.");
                    break;
                  case AD_FAILED:
                    MainActivity.this.isAdLoaded = false;
                    Log.v(MainActivity.class.getSimpleName(), "Interstitial failed to load.");
                    break;
                }
              }
            };
            AerServConfig config = new AerServConfig(this, PLACEMENT_ID)
              .setEventListener(listener)
              .setPreload(true); // This flag needs to be set for preload to work correctly.
            interstitial = new AerServInterstitial(config);
          } else {
            Log.v(MainActivity.class.getSimpleName(), "Interstitial has already been loaded");
          }
      }
      public void showInterstitial() {
        if(interstitial != null && isAdLoaded) {
          interstitial.show();
        } else {
          Log.v(MainActivity.class.getSimpleName(), "Interstitial has not been loaded");
        }
      }
    }
    	
  • Step 5: Additional Settings

    • Complete List of Events

      • Our SDK fires these additional AerServEvent events that can be caught by AerServEventListener:
      EVENT CALLBACK ENUM PURPOSE
      AD_CLICKED Ad was clicked or touched
      AD_COMPLETED Ad has completed
      AD_DISMISSED Ad has been closed
      AD_FAILED Ad failed to load
      AD_IMPRESSION Ad has shown
      LOAD_TRANSACTION This event will return a BuyerName as well as a BuyerPrice for the loaded ad.
      AD_LOADED Ad has been loaded
      PRELOAD_READY Ad has been preloaded
      VC_READY This event communicates the Virtual Currency (VC) name, amount, buyer name, and buyer price of the loaded ad. Please note that it does not imply the ad is preloaded nor does it imply that VC is rewarded. For those, you need to listen to PRELOAD_READY and VC_REWARDED events, respectively.
      VC_REWARDED Virtual Currency was rewarded
      VIDEO_COMPLETED Video has completed
      VIDEO_START Video ad has started
      SHOW_TRANSACTION This event communicates the Transaction Information of the loaded ad. This includes the buyer name and buyer price.
    • Virtual Currency

      • Virtual Currency (VC) allows you to reward users based on completed video views. You can configure the VC name and amount on SSUI, and the SDK will inform your app via events when the user has fully watched a video.
      • Here is the code example of how to listen to VC events:
        package com.sample.myapp;
        import android.app.Activity;
        import android.os.Bundle;
        import android.util.Log;
        import java.utils.List;
        import com.aerserv.sdk.AerServConfig;
        import com.aerserv.sdk.AerServEvents;
        import com.aerserv.sdk.AerServEventListener;
        import com.aerserv.sdk.AerServInterstitial;
        import com.aerserv.sdk.AerServVirtualCurrency;
        public class MainActivity extends Activity {
          private static final String APP_ID = "1000473";
          private static final String PLACEMENT_ID = "1000741";
          @Override
          public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                    @Override
                    public void onInitializationComplete(@Nullable Error error) {
                        if (null != error) {
                            Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                        } else {
                            Log.d(TAG, "AerServ Init Successful");
                        }
                    }
                });
          }
          public loadInterstitialAd() {
            AerServEventListener listener = new AerServEventListener() {
              @Override
              public void onAerServEvent(AerServEvent event, List params) {
                switch (event) {
                  /**
                   * The VC_READY event will notify when we load the creative. Note that you can also get 
                   * the buyerName and buyer price throught the LOAD_TRANSACTION and SHOW_TRANSACTION event.
                   */
                  case VC_READY:
                    AerServVirtualCurrency vc = (AerServVirtualCurrency) params.get(0);
                    String name = vc.getName();
                    BigDecimal amount = vc.getAmount();
                    String buyerName = vc.getBuyerName();
                    BigDecimal buyerPrice = vc.getBuyerPrice();
                    // Add your logic here  
                    break;
                  /**
                   * The second callback will notify when the virtual currency has been rewarded. This will 
                   * only fire after the user has watch 100% of the video on a virtual currency enable 
                   * placement.
                   */
                  case VC_REWARDED:
                    AerServVirtualCurrency vc = (AerServVirtualCurrency) params.get(0);
                    String name = vc.getName();
                    BigDecimal amount = vc.getAmount();
                    String buyerName = vc.getBuyerName();
                    BigDecimal buyerPrice = vc.getBuyerPrice();
                    // Add your logic here  
                    break;
                }
              }
            };
            /**
             * Nothing change when using either of these AerServEvent. Both VC_READY and VC_REWARDED will 
             * work with banners and interstitial integration. 
             */
            AerServConfig config = new AerServConfig(this, PLACEMENT_ID)
              .setEventListener(listener)
            AerServInterstitial interstitial = new AerServInterstitial(config);
            interstitial.show();
          }
        }
        			

        Note: The buyer name and buyer price can be null, so if you intend to use those objects, make sure you check for a null value.

        • Use AerServConfig object to set user ID:
          String USER_ID = "MyUserId";
          String PLACEMENT_ID = "1000741";
          AerServConfig config = new AerServConfig(MainActivity.this, PLACEMENT_ID).setUserId(USER_ID);
          				
        • We also support server VC callbacks. To use this feature please see the How to Set Up Rewarded Currency (Virtual Currency).The userId is required for VC enabled placements to be used on the server VC callback and for frequency capping.

          The userId is required for VC enabled placements to be used on the server VC callback and for frequency capping.

      • Ad Transaction Information

        During the process of showing an ad, the InMobi SDK will additionally return information pertaining to the buyer for your ad space and the price that the ad space was bought for.

        This detailed information can be found from these events:

        package com.sample.myapp;
        import android.app.Activity;
        import android.os.Bundle;
        import java.util.List;
        import com.aerserv.sdk.AerServConfig;
        import com.aerserv.sdk.AerServEvent;
        import com.aerserv.sdk.AerServEventListener;
        import com.aerserv.sdk.AerServInterstitial;
        import com.aerserv.sdk.AerServSdk;
        import com.aerserv.sdk.AerServTransactionInformation;
        public class MainActivity extend Activity {
          private static final String APP_ID = "1000473";
          private static final String PLACEMENT_ID = "1000741";
          @Override
          public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                    @Override
                    public void onInitializationComplete(@Nullable Error error) {
                        if (null != error) {
                            Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                        } else {
                            Log.d(TAG, "AerServ Init Successful");
                        }
                    }
                });
          }
          public void loadInterstitialAd() {
            AerServEventListener listener = new AerServEventListener() {
              @Override
              public void onAerServEvent(AerServEvent event, List params) {
                switch (event) {
                  /**
                   * The LOAD_TRANSACTION event will contain the transaction information of the ad from the 
                   * first load attempt. The transaction information from this callback may be different 
                   * from the ad the produce the impression.
                   */
                  case LOAD_TRANSACTION:
                      AerServTransactionInformation vc = (AerServTransactionInformation) params.get(0);
                      String buyerName = vc.getBuyerName();
                      BigDecimal buyerPrice = vc.getBuyerPrice();
                      // Add your logic here  
                      break;
                  /**
                   * The didShowAdWithTransactionInfo callback will cotanin the transaction information of 
                   * the ad that produced a impression.  
                   */
                  case SHOW_TRANSACTION:
                      AerServTransactionInformation vc = (AerServTransactionInformation) params.get(0);
                      String buyerName = vc.getBuyerName();
                      BigDecimal buyerPrice = vc.getBuyerPrice();
                      // Add your logic here  
                      break;
                }
              }
            };
            /**
             * Nothing change with this implementation. Both LOAD_TRANSACTION and SHOW_TRANSACTION will work
             * with banners and interstitial integration. 
             */
            AerServConfig config = new AerServConfig(this, PLACEMENT_ID)
              .setEventListener(listener)
            AerServInterstitial interstitial = new AerServInterstitial(config);
            interstitial.show();
          }
        }
        			
      • Adding Publisher Keys

        Custom revenue reports can be generated via the SDK by assigning a dictionary object with publisher key value pairs to the pubKeys property. This is available for both interstitials and banners.

        package com.sample.myapp;
        import android.app.Activity;
        import android.os.Bundle;
        import java.util.HashMap;
        import java.util.Map;
        import com.aerserv.sdk.AerServConfig;
        import com.aerserv.sdk.AerServInterstitial;
        import com.aerserv.sdk.AerServSdk;
        public class MainActivity extends Activity {
          private static final String APP_ID = "1000473";
          private static final String PLACEMENT_ID = "1000741";
          @Override
          public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                    @Override
                    public void onInitializationComplete(@Nullable Error error) {
                        if (null != error) {
                            Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                        } else {
                            Log.d(TAG, "AerServ Init Successful");
                        }
                    }
                });
          }
          public void loadInterstitialAd() {
            Map<String, String> pubkeys = new HashMap();
            pubkeys.put("key", "value");
            AerServConfig config = new AerServConfig(this, PLACEMENT_ID)
                    .setPubKeys(pubkeys); // Pass in the Map object.
            interstitial = new AerServInterstitial(config);
            interstitial.show();
          }
        }
        			

        For details about publisher keys, click here.

      • Enabling the Back Button(not supported in InMobi SDK 8.0.1)

        Enable the back button for interstitial. When the user clicks on the back button, the interstitial will exit. This is similar to when skip is enabled on the AerServ + InMobi dashboard. This will only work for ads coming from AerMarket, S2S or tags. By default, the backbutton is only enabled when the a becomes skippable.

        package com.sample.myapp;
        import android.app.Activity;
        import android.os.Bundle;
        import com.aerserv.sdk.AerServConfig;
        import com.aerserv.sdk.AerServInterstitial;
        import com.aerserv.sdk.AerServSdk;
        public class MainActivity extends Activity {
          private static final String APP_ID = "1000473";
          private static final String PLACEMENT_ID = "1000741";
          @Override
          public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            AerServSdk.init(this, APP_ID,new SdkInitializationListener() {
                    @Override
                    public void onInitializationComplete(@Nullable Error error) {
                        if (null != error) {
                            Log.e(TAG, "AerServ Init Failed with error message: " + error.getMessage());
                        } else {
                            Log.d(TAG, "AerServ Init Successful");
                        }
                    }
                });
          }
          public void loadInterstitialAd() {
            AerServConfig config = new AerServConfig(this, PLACEMENT_ID)
            config
              /**
                * This will enable the back button when a interstitial is shown. This will do nothing 
                * when passed into a banner. This will also only work for ads coming form AerMarket, 
                * S2S and tags. By default, the back button is only enabled when skippability is
                * enabled.
                */
              .enableBackButton(true)
              /**
                * As previously stated, the back button is only enabled when skippability is enabled.
                * This is set through the AerServ + InMobi dashboard. You can also override the time for when
                * the back button is enabled.
                */
              .setBackButtonTimeout(5000);
            interstitial = new AerServInterstitial(config);
            interstitial.show();
          }
        }
        			
      • Header Bidding Requests

        The Header Bidding flag is now enabled by default, and "useHeaderBidding" has been deprecated and is no longer needed.

    Version History


      9.0.4: 3/3/20
    • Added support for InMobi Initialization callback
    • Improvements and Bug Fixes
    • Interface Changes

      - APIs Added

      • InMobiSdk

        public static void init(@NonNull final Context context, @NonNull @Size(min = 32, max = 36) String accountId, @Nullable JSONObject consentObject, @Nullable final SdkInitializationListener sdkInitializationListener)

      • SdkInitializationListener

        void onInitializationComplete(@Nullable Error error)

      - APIs Deprecated

      • InMobiSdk

        public static @InitializationStatus String init(@NonNull final Context context, @NonNull @Size(min = 32, max = 36) String accountId)

        public static @InitializationStatus String init(@NonNull final Context context, @NonNull @Size(min = 32, max = 36) String accountId, @Nullable JSONObject consentObject)


      9.0.2: 01/27/20
    • Added support for success/failure status for InMobi Initialization
    • Proactive detection of abnormal network calls by fraudulent creatives
    • Improvements and Bug Fixes
    • Interface Changes

      - APIs Updated

      • InMobiSdk

        public static @InitializationStatus String init(@NonNull final Context context, @NonNull @Size(min = 32, max = 36) String accountId)

        public static @InitializationStatus String init(@NonNull final Context context, @NonNull @Size(min = 32, max = 36) String accountId, @Nullable JSONObject consentObject)


      9.0.1: 10/25/19
    • Added support for IAB GDPR consent string
    • Updated OMSDK to v1.2.19
    • Added Banner refresh support from SSUI
    • Added support for Facebook Audience Network 5.5
    • Bug Fixes for SDK and AudienceBidder Plugin

      9.0.0: 9/20/19
    • Modular SDK

      - Added an ability to integrate Mediation as a separate module.

    • Added support for Android 10
    • Support for Mopub 5.8
    • Interface Changes
      • - APIs added

        AerServTransactionInformation

        public String getCreativeID()

      • - APIs removed
        • InMobiNative

          public InMobiNative(Context context, long placementId, NativeAdListener listener)

          public void setNativeAdListener(NativeAdListener listener)

        • InMobiNative.NativeAdListener
        • InMobiBanner

          public void setListener(BannerAdListener listener)

        • InMobiBanner.BannerAdListener
        • InMobiInterstitial

          public InMobiInterstitial(Context context, long placementId, InterstitialAdListener2 listener)

          public void setInterstitialAdListener(InterstitialAdListener2 listener)

        • InMobiInterstitial.InterstitialAdListener2
    • Bug fixes and performance improvements
    • 8.2.1: 8/22/19
      • Bug Fixes for SDK and AudienceBidder Plugin
    • 8.2.0: 8/5/19
      • Chrome Custom tabs support
      • Thread Optimizations
      • Bug Fixes for SDK and AudienceBidder Plugin
    • 8.1.3: 7/18/19
      • Support for Audience Bidding for DFP
      • Bug Fixes
    • 8.1.2: 6/19/19
      • Updated AdColony SDK support to 3.3.10
      • Updated Audience Network (Facebook) support to 5.3.1
    • 8.1.1: 5/27/19
      • Support for new Picasso version 2.71828
      • Bug Fixes
    • 8.1.0: 5/14/19
      • DFP Plugin Support
      • Mopub Audience Bidding Plugin Keyword Handling
    • 8.0.9: 4/22/19
      • Bug Fixes
    • 8.0.8: 4/17/19
      • Bug Fixes
    • 8.0.7: 4/5/19
      • Bug Fixes
      • Updated AudienceBidder to v1.0.1
        • Support for granular keywords
        • Fixed issue with updateBid not working with MoPub's refresh
        • Replaced source file with a aar
        • Various API Changes (see documentation)
    • 8.0.5: 3/11/19
      • Audience Bidder for the Mopub Plugin
      • Telaria Adapter Deprecation
      • Flurry Banner Adapter Deprecation
      • Applovin 3rd Party API Reporting updates
      • Chartboost 3rd Party API Reporting updates
      • Mediated SDK updates
      • Bug Fixes
    • 8.0.1: 11/28/18
      • Unified InMobi + AerServ SDK

    ko-help-articles | Frequently Asked Questions

    Are you new to monetization ? To help you learn more about how InMobi works, we've put together these FAQs from publishers for your reference. If you do not find what you are looking for here or need further assistance, please contact your dedicated InMobi account manager or email us at sales@inmobi.com.

    But before we begin, let’s get a few things out of the way:

    • If you wish to download our latest SDK, please visit the Download SDK page.
    • If you have downloaded the SDK and wish to get started, then please visit the Getting Started page.

    Now that you know where to begin, let’s get to the questions.

    1. Integrating the SDK

    2. Creating Account

    3. Creating Placements

    4. Mediating InMobi

    5. Reporting

    6. Payment

    7. Compliance Guidelines

    ko-help-articles | Audience Bidding (Header Bidding)

    Audience Bidding is InMobi’s In-app Header Bidding solution. You can leverage unique audience intelligence to pre-fetch audience-driven bids from 70+ DSPs with a single call to our in-app header bidding SDK.

    Important:
    1. If you wish to get started with Audience Bidding, then begin by downloading our Mediation/Header Bidding SDK for iOS and Android.
    2. To create an account or set up placements, visit https://www.inmobi.com/user/index?productId=1#signup

    Audience Bidding works hand-in-hand with your existing mediation platform. The following guides will help you get started with:

    Here's how Audience Bidding will help you:

    1. Revenue Optimization:

      Boost in-app revenue with dynamic bids optimized for each user.
      Maximize fills and revenue by increasing inventory exposure through simultaneous requests to 70+ DSPs that have global access to high intent advertisers.

    2. Enriched Supply:

      Secure your in-app revenue by differentiating your supply path.
      Stand out as enriched supply in a crowded marketplace by augmenting your inventory with high quality audience signals while working directly with the industry’s most preferred demand partners.

    3. Optimized Trafficking:

      Optimize your demand partnerships with smart bids across price points.
      Challenge your existing waterfall with pre-fetched bids across price points with a single SDK call. Get the most optimal bid through unified auctions.

    ko-help-articles | Migrating to SDK 9xx

    InMobi’s SDK 9xx (iOS 12 and Android 10 compliant), brings a superior monetization opportunity for your apps. The upgrade is super simple with just a drag-n-drop integration coupled with few compliance steps.


    The new integration guides are available here: iOS & Android.


    The latest version of InMobi SDK supports:

    • iOS - minimum iOS 9 and XCode 10.2
    • Android - minimum Android 4.1 (API level 16)

    Migration prerequisites for iOS

    Wifi Settings

    Apple has introduced privacy settings to access WiFi details from iOS 12 onwards. To boost monetization and relevant user experience we encourage sharing WiFi details for targeted advertising. This can be done in three steps as shown below:

    Step 1: Enable ‘Access WiFi Information’ on your App ID.

    Step 2: Enable access ‘Access WiFi Information’ for your target app from XCode capabilities.

    Step 3: Ensure WiFi Access is added to your App.entitlements file.

    Migration prerequisites for Android

    1. Preparing For Android P

    InMobi SDK is compatible with Android P (API level 28), the latest version of the Android platform. In Android P and onwards, apps make connections over HTTPS by default. Though InMobi supports the adoption of HTTPS, the current setup requires our demand partners to support HTTPS as well. The publisher can change their settings to HTTP if it has an impact on the revenue potential.


    2. Preparing your app for AndroidX (JetPack)

    InMobi SDK is compatible with AndroidX (JetPack) library. In case your app uses the AndroidX library, then follow the standard guidelines by Google for migration by adding both the flags in build file.

    android.useAndroidX=true
    android.enableJetifier=true
    	

    It is highly recommended taht you upgrade Android Gradle plugin version to 4.1 or greater to avoid known issues in the jetifier which is fixed in the latest Gradle plugin version. To upgrade Android gradle plugin version, please refer to the Android developer documentation.

    3. New Bundle format - aar

    Android SDK has moved to a new format bundle, ‘aar’ for ease of integration. With InMobi SDK 800+, you do not need to add InMobiAdActivity into your application manifest.

    Note: InMobi SDK 900 and above will include the mandatory permissions automatically to the application manifest in order to proceed. Permissions added are as follows:

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    	

    It is highly recommended to include the library from jCenter by adding the following line in your app/build.gradle:

    implementation 'com.inmobi.monetization:inmobi-ads:9.0.1'
    	

    But in case you’re manually integrating the SDK, include the .aar file into the project using the following:

    implementation fileTree(dir: 'libs', include: ['*.aar'])
    	

    4. Changing the Manifest File (if migrating from SDK < 8XX)

    Please remove InMobiAdActivity element from your manifest as aar file will take care of that.

    5. Added API(s)

    The following API has been added:

    • InMobiBanner
      public void destroy()
    	

    6. Removed APIs

    The following legacy APIs have been removed :

    • InMobiNative
        public InMobiNative(Context context, long placementId, NativeAdListener listener)
        public void setNativeAdListener(NativeAdListener listener)
        public static void requestAd(.......)
      		
    • InMobiNative.NativeAdListener
    • InMobiBanner
      public void setListener(BannerAdListener listener)
      public static void requestAd(.......)
      		
    • InMobiBanner.BannerAdListener
    • InMobiInterstitial
      public InMobiInterstitial(Context context, long placementId, InterstitialAdListener2 listener)
      public void setInterstitialAdListener(InterstitialAdListener2 listener)
      public static void requestAd(.......)
      		
    • InMobiInterstitial.InterstitialAdListener2

    Note: For the project to compile, please remove any invocation of this API.

    ko-help-articles | Audience Bidding for MoPub (iOS)

    Setup

    In order to start setting up, you’ve to ensure that the steps mentioned in the InMobi Integration have already been incorporated.

    Step 1: Initialising the InMobi SDK

    Option 1. Initialise InMobi SDK while Initialisating MoPub SDK using MPMoPubConfiguration. Follow instructions as mentioned here

    #import <InMobiMoPubPlugin/InMobiAdapterConfiguration.h> 
    MPMoPubConfiguration *sdkConfig = [[MPMoPubConfiguration alloc] 
        initWithAdUnitIdForAppInitialization: <MoPubAppId>]; 
    sdkConfig.additionalNetworks = [NSArray 
        arrayWithObject:InMobiAdapterConfiguration.class]; 
    NSMutableDictionary *inmobiDict = [[NSMutableDictionary alloc] 
        initWithObjectsAndKeys:@"<InMobiAccountID>", @"accountid", nil]; 
    NSMutableDictionary *configDictionary = [[NSMutableDictionary alloc] 
        initWithObjectsAndKeys:inmobiDict, @"InMobiAdapterConfiguration", nil]; 
    sdkConfig.mediatedNetworkConfigurations = configDictionary; 
    [[MoPub sharedInstance] initializeSdkWithConfiguration:sdkConfig 
        completion:^{ 
            NSLog(@"Mopub and third party SDKs are initialised"); 
    }];
    	

    Note : Import the InMobiAdapterConfiguration.h header

    Option 2: Initialise InMobi SDK directly

    NSError* error= nil; 
    [InMobiSDKInitialiser initialiseSDK:[info valueForKey:kIMAccountID] 
        withError:&error];
    	

    Note : Initialize once per app’s lifecycle, typically on app launch, using valid account ID for your app. Make no ad requests until the SDK initialization has completed.

    Step 2: Adding the InMobiMoPubPlugin to your Project

    Option 1: Using CocoPods

    pod 'InMobiMoPubPlugin'
      pod 'InMobiSDK'
    	

    Note : Add pod 'mopub-ios-sdk' for resolving dependancy.

    Option 2: Adding the SDK Library to your Application Project

    Add the framework in your project. Download the MoPub-InMobi plugin from here

    Note : If the version is X.Y.Z.A , X.Y.Z denotes the compatible media SDK version whereas A denotes the patch number.

    Banner Ads

    Step 1: Setting up and adding Banner Ad to your App

    Creating a Banner Ad

    To add a banner ad in iOS code, create an instance of IMABMoPubBanner:

     IMABMoPubBanner* bannerAd = [[IMABMoPubBanner alloc] initWithSize:<size> 
        placementId:<placementID> delegate:<delegate>];
    	

    Notes

    • The IMABMoPubBanner class is not thread-safe. A banner instance must be created on the main thread.
    • Similarly, all methods on this instance must be called on the main thread. Not doing so will lead to unpredictable behavior and may affect your ability to monetize with InMobi.

    Step 2: Requesting for Bid

    Requesting for a bid requires you to call the IMABMoPubBanner: requestBid method on the instance you just created to request for a bid. Note that there are two API(s) available to request for a bid -

    • IMABMoPubBanner: -(void)requestBid:(nullable id)ad timeout:(NSTimeInterval)timeout; When you pass a MoPubView instance, the InMobi SDK automatically takes care of setting the keyword to this instance and saving the IMBanner instance for future usage in CustomEvent class.
      /** 
      * A sample code to request bid with MoPubView 
      */ 
      @interface BannerViewController () <IMABMoPubDelegate, MPAdViewDelegate> 
      //Hold the instance of IMABMoPubBanner, to load an InMobi's ad. 
      @property (nonatomic, strong) IMABMoPubBanner* abMoPubBanner; 
      @property (nonatomic, strong) MPAdView* mpBanner; 
      @end 
      @implementation BannerViewController 
      - (void)loadUABannerAd { 
          // Write code to initialise your MoPub ad object and then do the following 
          self.mpBanner = [[MPAdView alloc] initWithAdUnitId:<adUnitID> size:
              <adSize>]; 
          self.mpBanner.delegate = <delegate>; 
          //Create an instance of IMABMoPubBanner and call requestBid 
          self.abMoPubBanner = [[IMABMoPubBanner alloc] initWithSize:<size> 
              placementId:<placementID> delegate:<delegate>]; 
          [self.abMoPubBanner requestBid:self.mpBannerTop timeout:<timeout>]; 
      } 
      #pragma mark - IMABMopubBannerDelegate method 
      /** 
      * Notifies Bid is recieved successfully with transaction keyword. 
      * @param mpAd MoPub ad object passed in requestBid. It can be either MPAdView or MPInterstitialAdController type 
      *          It will be null if the MoPub ad object was not passed while calling the requestBid API 
      * @param imAd InMobi ad Object for which the keyword is recieved. In case of nil mpAd, set imAd inside localExtras of mopub 
      *          ad object. Kindly refer intergation document. 
      * @param keyword  keyword derived from the bid received. 
      */ 
      - (void)bidReceivedFor:(nullable id)mpAd andInMobiAd:(id)imAd 
          withTransactionInfo:(NSString*)keyword { 
              NSLog(@"Test MP Banner:- bidReceivedFor withTransactionInfo: %@", keyword); 
              [self.mpBanner loadAd]; 
              //add mpBanner to the subView. 
      } 
      /** 
      * Notifies Bid fetch is failed with error. 
      * @param ad MoPub ad object passed in requestBid. It can be either MPAdView or MPInterstitialAdController type 
      *          It will be null if the MoPub ad object was not passed while calling the requestBid API 
      * @param error error which caused failure. 
      */ 
      - (void)bidFailedFor:(nullable id)ad withError:(NSError*)error { 
          NSLog(@"Test MP Banner:- bidFailedForAd withError: %@", error); 
      } 
      @end
      		
    • IMABMoPubBanner: -(void)requestBid:(NSTimeInterval)timeout; In case you don’t wish to pass the MoPubView instance, then you need to take care of not only setting the keyword to the MoPubView instance (for which bid was requested) but also you’ve to pass IMBanner instance to CustomEvent for rendering the ad, for that we create an instance of IMFacadeWrapper and add it in the localExtras of MPAdView, as mentioned in the following code:
      /** 
      * A sample code to request bid without MoPubView 
      */ 
      @interface BannerViewController () <IMABMoPubDelegate, MPAdViewDelegate> 
      //Hold the instance of IMABMoPubBanner, to load an InMobi's ad. 
      @property (nonatomic, strong) IMABMoPubBanner* abMoPubBanner; 
      @property (nonatomic, strong) MPAdView* mpBanner; 
      @end 
      @implementation BannerViewController 
      - (void)loadUABannerAd { 
          // Write code to initialise your MoPub ad object and then do the following 
          self.mpBanner = [[MPAdView alloc] initWithAdUnitId:<adUnitID> size:
              <adSize>]; 
          self.mpBanner.delegate = <delegate>; 
          //Create an instance of IMABMoPubBanner and call requestBid 
          self.abMoPubBanner = [[IMABMoPubBanner alloc] initWithSize:<size> 
              placementId:<placementID> delegate:<delegate>]; 
          [self.abMoPubBanner requestBid:<timeout>]; 
      } 
      #pragma mark - IMABMopubBannerDelegate method 
      /** 
      * Notifies Bid is recieved successfully with transaction keyword. 
      * @param mpAd MoPub ad object passed in requestBid. It can be either MPAdView or MPInterstitialAdController type 
      *          It will be null if the MoPub ad object was not passed while calling the requestBid API 
      * @param imAd InMobi ad Object for which the keyword is recieved. In case of nil mpAd, set imAd inside localExtras of mopub 
      *          ad object. Kindly refer intergation document. 
      * @param keyword  keyword derived from the bid received. 
      */ 
      - (void)bidReceivedFor:(nullable id)mpAd andInMobiAd:(id)imAd 
          withTransactionInfo:(NSString*)keyword { 
              //mpAd is null. 
              NSLog(@"Test MP Banner:- bidReceivedFor withTransactionInfo: %@", keyword); 
              IMFacadeWrapper* facadeWrapper = [[IMFacadeWrapper alloc] 
                  initWithMoPubObject:self.mpAdView andInMobiObject:imAd]; 
              [self.mpBanner setKeywords:keyword]; // set keyword 
              self.mpBanner.localExtras = @{kIMABInMobiObjectKey : facadeWrapper}; 
              [self.mpBanner loadAd]; 
              //add mpBanner to the subView. 
      } 
      /** 
      * Notifies Bid fetch is failed with error. 
      * @param ad MoPub ad object passed in requestBid. It can be either MPAdView or MPInterstitialAdController type 
      *          It will be null if the MoPub ad object was not passed while calling the requestBid API 
      * @param error error which caused failure. 
      */ 
      - (void)bidFailedFor:(nullable id)ad withError:(NSError*)error { 
          NSLog(@"Test MP Banner:- bidFailedForAd withError: %@", error); 
      } 
      @end
      		

    Notes :

    The keyword received will be in the format of "bidKeyword": "IMAB:9.00, IMAB:9.10"/ “IMAB:9.00” It’s a passthrough key, kindly add bidKeyword as keyword of MoPub object. The first bid value is the absolute keyword and the second bid keyword is granular keyword.

    Note that the IMAB keyword set to the MoPubView must be cleared off post each ad opportunity and before loading the banner ad again.

    Passing mopub object in facadeWrapper is optional. If mopub object will be passed to IMFacadeWrapper, the keyword removal will be handled.

    Step 3: Setting up for MoPubView refresh

    In case your MoPubView has auto refresh feature enabled, then simply you need to request a bid for every success/failure for callback.

    - (void)adViewDidLoadAd:(MPAdView *)view adSize:(CGSize)adSize { 
    	NSLog(@"-------- MPAdView, adViewDidLoadAd:"); 
    	 [self.abBanner requestBid:self.mpAdView timeout:]; 
    } 
    
    - (void)adView:(MPAdView *)view didFailToLoadAdWithError:(NSError *)error { 
    	NSLog(@"-------- MPAdView, didFailToLoadAdWithError:"); 
    	 [self.abBanner requestBid:self.mpAdView timeout:]; 
    } 
    	

    Interstitial Ads

    Step 1: Setting up and adding an Interstitial Ad to your App

    Creating an Interstitial Ad

    To create an interstitial ad, create an instance of an IMABMoPubInterstitial like so:

    IMABMoPubInterstitial* interstitialAd = [[IMABMoPubInterstitial alloc] initWithPlacementId:<placementID> 
    	delegate:<delegate>];
    	

    Notes:

    • The IMABMoPubInterstitial class is not thread-safe. An interstitial instance must be created on the UI thread.
    • Similarly, all methods on this instance must be called on the UI thread. Not doing so will lead to unpredictable behavior and may affect your ability to monetize with InMobi.

    Step 2: Requesting for Bid

    Requesting for a bid requires you to call the IMABMoPubInterstitial: requestBid method on the instance you just created to request for a bid. Note that there are two API(s) available to request for a bid -

    • IMABMoPubInterstitial: -(void)requestBid:(nullable id)ad timeout: (NSTimeInterval) timeout; When you pass a MPInterstitialAdController instance, the InMobi SDK automatically takes care of setting the keyword to this instance and saving the IMInterstitial instance for future usage in CustomEvent class.
      /** 
      * A sample code to request bid with MPInterstitialAdController 
      */ 
      @interface InterstitialViewController () <IMABMoPubDelegate, MPInterstitialAdControllerDelegate> 
      //Hold the instance of IMABMoPubInterstitial, to load an InMobi's ad. 
      @property (strong, nonatomic) MPInterstitialAdController *mpInterstitial; 
      @property (strong, nonatomic) IMABMoPubInterstitial *abInterstitial; 
      @end 
      @implementation InterstitialViewController 
      - (void)loadUABannerAd { 
          // Write code to initialise your MoPub ad object and then do the following 
          self.mpInterstitial = [MPInterstitialAdController interstitialAdControllerForAdUnitId:<adUnitID>]; 
          self.mpInterstitial.delegate = <delegate>; 
          //Create an instance of IMABMoPubInterstitial and call requestBid 
          self.abInterstitial = [[IMABMoPubInterstitial alloc]initWithPlacementId:<placementID> delegate:<delegate>]; 
          [self.abInterstitial requestBid:self.mpInterstitial timeout:<timeout>];
      } 
      #pragma mark - IMABMopubBannerDelegate method
      /** 
      * Notifies Bid is recieved successfully with transaction keyword. 
      * @param mpAd MoPub ad object passed in requestBid. It can be either MPAdView or MPInterstitialAdController type 
      * It will be null if the MoPub ad object was not passed while calling the requestBid API 
      * @param imAd InMobi ad Object for which the keyword is recieved. 
      * In case of nil mpAd, set imAd inside localExtras of mopub 
      * ad object. Kindly refer intergation document. 
      * @param keyword  keyword derived from the bid received. 
      */ 
      - (void)bidRecievedFor:(nullable id)mpAd andInMobiAd:(id)imAd withTransactionInfo:(NSString*)keyword { 
      	//mpAd is null. 
          NSLog(@"Test MP Banner:- bidRecievedFor withTransactionInfo: %@", keyword); 
          [self.mpInterstitial loadAd]; 
      } 
      /** 
      * Notifies Bid fetch is failed with error. 
      * @param ad MoPub ad object passed in requestBid. It can be either MPAdView or MPInterstitialAdController type 
      * It will be null if the MoPub ad object was not passed while calling the requestBid API 
      * @param error error which caused failure. 
      */ 
      - (void)bidFailedFor:(nullable id)ad withError:(NSError*)error {
          NSLog(@"Test MP Banner:- bidFailedForAd withError: %@", error); 
      } 
      @end
      		
    • IMABMoPubInterstitial: -(void)requestBid:(NSTimeInterval)timeout; In case you don’t wish to pass the MPInterstitialAdController instance, then you need to take care of not only setting the keyword to the MPInterstitialAdController instance (for which bid was requested) but also you’ve to pass IMInterstitial instance to CustomEvent for rendering the ad, for that we create an instance of IMFacadeWrapper and add it in the localExtras of MPInterstitialAdController, as mentioned in the following code:
      /** 
      * A sample code to request bid without MPInterstitialAdController 
      */ 
      @interface InterstitialViewController () <IMABMoPubDelegate, 
          MPInterstitialAdControllerDelegate> 
      //Hold the instance of IMABMoPubInterstitial, to load an InMobi's ad. 
      @property (strong, nonatomic) MPInterstitialAdController *mpInterstitial; 
      @property (strong, nonatomic) IMABMoPubInterstitial *abInterstitial; 
      @end 
      @implementation InterstitialViewController 
      - (void)loadUAInterstitialAd { 
          // Write code to initialise your MoPub ad object and then do the following 
          self.mpInterstitial = [MPInterstitialAdController 
              interstitialAdControllerForAdUnitId:<adUnitID>]; 
          self.mpInterstitial.delegate = <delegate>; 
          //Create an instance of IMABMoPubInterstitial and call requestBid 
          self.abInterstitial = [[IMABMoPubInterstitial alloc]
              initWithPlacementId:<placementID> delegate:<delegate>]; 
          [self.abInterstitial requestBid:<timeout>]; 
      } 
      #pragma mark - IMABMopubBannerDelegate method 
      /** 
      * Notifies Bid is recieved successfully with transaction keyword. 
      * @param mpAd MoPub ad object passed in requestBid. It can be either MPAdView or MPInterstitialAdController type 
      *          It will be null if the MoPub ad object was not passed while calling the requestBid API 
      * @param imAd InMobi ad Object for which the keyword is recieved. In case of nil mpAd, set imAd inside localExtras of mopub 
      *          ad object. Kindly refer intergation document. 
      * @param keyword  keyword derived from the bid received. 
      */ 
      - (void)bidReceivedFor:(nullable id)mpAd andInMobiAd:(id)imAd 
          withTransactionInfo:(NSString*)keyword { 
              //mpAd is null. 
              NSLog(@"Test MP Banner:- bidReceivedFor withTransactionInfo: %@", keyword); 
              IMFacadeWrapper* facadeWrapper = [[IMFacadeWrapper alloc] 
                  initWithMoPubObject:self.mpInterstitial andInMobiObject:imAd]; 
              [self.mpInterstitial setKeywords:keyword]; // set keyword 
              self.mpInterstitial.localExtras = @{kIMABInMobiObjectKey : 
                  facadeWrapper}; 
              [self.mpInterstitial loadAd]; 
              //add mpBanner to the subView. 
      } 
      /** 
      * Notifies Bid fetch is failed with error. 
      * @param ad MoPub ad object passed in requestBid. It can be either MPAdView or MPInterstitialAdController type 
      *          It will be null if the MoPub ad object was not passed while calling the requestBid API 
      * @param error error which caused failure. 
      */ 
      - (void)bidFailedFor:(nullable id)ad withError:(NSError*)error { 
          NSLog(@"Test MP Banner:- bidFailedForAd withError: %@", error); 
      } 
      @end
      		

    Notes :

    The keyword received will be in the format of "bidKeyword": "IMAB:9.00, IMAB:9.10"/ “IMAB:9.00” It’s a passthrough key, kindly add bidKeyword as keyword of MoPub object. The first bid value is the absolute keyword and the second bid keyword is granular keyword.

    Note that the IMAB keyword set to the MPInterstitialAdController must be cleared off post each ad opportunity and before loading the banner ad again.

    Passing mopub object in facadeWrapper is optional. If mopub object will be passed to IMFacadeWrapper, the keyword removal will be handled.

    After load success/failure callback, new bid request can be called.

    ko-help-articles | Audience Bidding for MoPub (Android)

    Setup

    In order to start setting up, you’ve to ensure that the steps mentioned here have already been incorporated. In addition to these steps, you’ve to add one more library to your project.

    Step 1: Adding the SDK to your Project

    Option 1: Pulling the Latest SDK via JCenter (Recommended)

    If you are using Gradle to build your Android applications, you can pull the latest version of the SDK from JCenter as described below:

    1. Include JCenter in your top-level build.gradle file
          allprojects {
              repositories {
                  jcenter()
              }
          }
      		
    2. Add the following line to the dependencies element in your application module’s build.gradle.
          implementation 'com.inmobi.monetization:inmobi-mopub-plugin:9.0.7.0'
      		

      Note : If the version is X.Y.Z.A , X.Y.Z denotes the compatible media SDK version whereas A denotes the patch number.

    3. Sync your Gradle project to ensure that the dependency is downloaded by the build system.

    Option 2: Adding the SDK Library to your Application Project

    Alternatively, you can download the latest version of InMobi’s SDK here and copy the library to your application module’s libs/ directory.

    To add the library to your project’s dependencies, add this line to the dependencies element in your module’s build.gradle:

        implementation fileTree(dir: 'libs', include: ['*.aar])
    	

    Step 2: Integrating MoPub Plugin

    Step 2.1: Audience Bidding

    Note: Contact your account manager for Audience Bidding placement setup.

    To use the InMobi Audience Bidding SDK, here is how you can expect the flow to go:

    • The InMobi Audience Bidder SDK will make an ad request and return a bid token
    • The bid token from the ad network will have an updated MoPub Ad Object and have pricing keywords attached
    • You then call loadAd() on the MoPub ad object as before
    • If InMobi is selected to fill, The InMobi Audience Bidder SDK will handle the rendering
    Step 2.1.1: Enabling Audience Bidding Setup on MoPub

    To enable Audience Bidding, you will need to do 2 things:

    1. Set up the line item to use the specific keywords with pricing used by the IMAudienceBidder class.
    2. Update your existing MoPub implementation.
    Step 2.1.1.1: Setting Up the MoPub Line Items

    Option 1 (Setting up Line Items Manually)

    1. Click on Orders -> Create Order
    2. Create a new order
      • Give your order a name (ex. Audience_Bidding_Test)
      • Enter in an advertiser name (ex. InMobi)
    3. Line item type
      • Give your line item a name (ex.IMAB_Banner_0.50)
      • Select type: Network Line Item
      • Select Network: Custom SDK network
      • Custom event class:
        • Banner: com.inmobi.plugin.mopub.IMABCustomEventBanner
        • Interstitial: com.inmobi.plugin.mopub.IMABCustomEventInterstitial
      • Custom event data: {}
      • Under "Budget & schedule", please enter the rate that matches what you have set up on your InMobi + AerServ dashboard for your eCPM (ex. 0.50)
    4. Ad unit targeting
      • Select the app and ad unit for your line item
    5. Audience Targeting
    Enter the keyword in the "Keyword targeting" in this format IMAB:0.00 (ex. IMAB:0.50)

    eCPM

    Keyword

    eCPM

    Keyword

    0.01 IMAB:0.01 5.00 IMAB:5.00
    0.05 IMAB:0.05 6.00 IMAB:6.00
    0.10 IMAB:0.10 7.00 IMAB:7.00
    0.20 IMAB:0.20 8.00 IMAB:8.00
    0.30 IMAB:0.30 9.00 IMAB:9.00
    0.40 IMAB:0.40 10.00 IMAB:10.00
    0.50 IMAB:0.50 11.00 IMAB:11.00
    0.60 IMAB:0.60 12.00 IMAB:12.00
    0.70 IMAB:0.70 13.00 IMAB:13.00
    0.80 IMAB:0.80 14.00 IMAB:14.00
    0.90 IMAB:0.90 15.00 IMAB:15.00
    1.00 IMAB:1.00 16.00 IMAB:16.00
    1.10 IMAB:1.10 17.00 IMAB:17.00
    1.20 IMAB:1.20 18.00 IMAB:18.00
    1.30 IMAB:1.30 19.00 IMAB:19.00
    1.40 IMAB:1.40 20.00 IMAB:20.00
    1.50 IMAB:1.50 21.00 IMAB:21.00
    1.60 IMAB:1.60 22.00 IMAB:22.00
    1.70 IMAB:1.70 23.00 IMAB:23.00
    1.80 IMAB:1.80 24.00 IMAB:24.00
    1.90 IMAB:1.90 25.00 IMAB:25.00
    2.00 IMAB:2.00 26.00 IMAB:26.00
    2.50 IMAB:2.50 27.00 IMAB:27.00
    3.00 IMAB:3.00 28.00 IMAB:28.00
    3.50 IMAB:3.50 29.00 IMAB:29.00
    4.00 IMAB:4.00 30.00 IMAB:30.00

    Option 2 (Setting up Line Items with an Automated Script)

    Add a Chrome extension to your browser. Download extension here.

    1. Login to the MoPub Dashboard
    2. Create your order
    3. Create the first line item under the order
      • Line Item Setup:
        • Type & Priority: Network Line Item
        • Network: Custom SDK Network
        • Custom Event Class:
          • Banner: com.inmobi.plugin.mopub.IMABCustomEventBanner
          • Interstitial: com.inmobi.plugin.mopub.IMABCustomEventInterstitial
        • Example:

        • Under the "Audience Targeting" section:
          • Please enter a keyword in this format: IMAB:0.01
          • Example:

    4. Staying on the current tab, open the extension.
    5. Input the order name and the first line item name
    6. Click 'Run' to execute
    7. Wait for all the line items to be created

    Banner Ads

    Step 1: Setting up a Banner Ad

    To display a banner ad on your app, you would first need to create a banner placement ID. After adding your app, select BANNER AD to create a placement for the ad type - Banner. Once you create the banner placement, the placement ID is available.

    Step 2: Adding a Banner Ad to your App

    Creating a Banner Ad

    To add a banner ad in Android code, create an instance of IMABMoPubBanner:

    IMABMoPubBanner bannerAd = new IMABMoPubBanner(context, <placementID>, <widthInDp>, <heightInDp>, listener);
    	

    Notes:

    • The IMABMoPubBanner class is not thread-safe. A banner instance must be created on the UI thread.
    • Similarly, all methods on this instance must be called on the UI thread. Not doing so will lead to unpredictable behavior and may affect your ability to monetize with InMobi.

    Step 3: Requesting for Bid

    Requesting for a bid requires you to call the IMABMoPubBanner#requestBid(...) method on the instance you just created to request for a bid. Note that there are two API(s) available to request for a bid -

    • IMABMoPubBanner#requestBid(moPubView, timeoutInMillis) : When you pass a MoPubView instance, the InMobi SDK automatically takes care of setting the keyword to this instance and saving the InMobiBanner instance for future usage in CustomEvent class.
      /**
      * A sample code to request bid with MoPubView
      */
      public class YourActivity {
          private IMABMoPubBanner banner;
          private MoPubView moPubView;
         public void requestBid() {
             // Write code to initialise your MoPub ad object and then do the following
             banner = new IMABMoPubBanner(context, <placementId>, 320, 50, new IMABMoPubListener<MoPubView, InMobiBanner>() {
                 /**
                  * The callback to notify that bid fetch was successful
                  * @param moPubAdObject a MoPub ad object passed in requestBid. It will be null if the MoPub ad object was not passed while calling the requestBid API
                  * @param imAdObject a InMobi ad object.
                  * @param keyword a keyword derived from the bid received.
                 */
                  @Override
                  public void onBidReceived(@Nullable MoPubView moPubAdObject,
                                            @NonNull InMobiBanner inMobiBanner, @NonNull String keyword) {
                      Log.d(TAG, "Keywords received:" + keyword);
                      // Load your MoPub ad here
                  }
                 /**
                  * The callback to notify that bid fetch resulted into failure
                  * @param moPubAdObject a MoPub ad object passed in requestBid.
                  *                      It will be null if the MoPub ad object was not passed while calling the requestBid API
                  * @param error a {@link Error} to inform what went wrong while fetching the bid
                 */
                  @Override
                  public void onBidFailed(@Nullable MoPubView moPubAdObject, @NonNull Error error) {
                      Log.d(TAG, "Bid failure :" + error.getMessage());
                      // Load your MoPub ad here
                  }
             // Requesting for bid, where timeout is 5seconds
             banner.requestBid(moPubView, 5000);
         }
      }
      		
    • IMABMoPubBanner#requestBid(timeoutInMillis) : In case you don’t wish to pass the MoPubView instance, then you need to take care of not only setting the keyword to the MoPubView instance (for which bid was requested) but also you’ve to save the InMobiBanner instance so that you can use it in the CustomEvent for rendering the ad in case InMobi wins the auction. Also, note that the IMAB keyword set to the MoPubView must be cleared off post each ad opportunity and before loading the banner ad again.
      /**
      * A sample code to request bid without MoPubView
      */
      public class YourActivity {
          private IMABMoPubBanner banner;
          private MoPubView moPubView;
         public void requestBid() {
             // Write code to initialise your MoPub ad object and then do the following
             banner = new IMABMoPubBanner(context, <placementId>, 320, 50, new IMABMoPubListener<MoPubView, InMobiBanner>() {
                 /**
                  * The callback to notify that bid fetch was successful
                  * @param moPubAdObject a MoPub ad object passed in requestBid. It will be null if the MoPub ad object was not passed while calling the requestBid API
                  * @param imAdObject a InMobi ad object.
                  * @param keyword a keyword derived from the bid received.
                 */
                  @Override
                  public void onBidReceived(@Nullable MoPubView moPubAdObject,
                                            @NonNull InMobiBanner inMobiBanner, @NonNull String keyword) {
                      Log.d(TAG, "Keywords received:" + keyword);
                      // Since MoPubView has not been passed in the request, you need to do the following
                      String oldKeyword = mopubView.getKeywords();
                      moPubView.setKeywords(TextUtils.isEmpty(oldKeyword) ? keyword :
                          String.format("%s,%s", oldKeyword, keyword));
                      Map<String, Object> localExtras = moPubView.getLocalExtras();
                      localExtras.put(IMABCustomEventBanner.AD_OBJECT_KEY, inMobiBanner);
                      moPubView.setLocalExtras(localExtras);
                      // Load your MoPub ad here
                  }
                 /**
                  * The callback to notify that bid fetch resulted into failure
                  * @param moPubAdObject a MoPub ad object passed in requestBid.
                  *                      It will be null if the MoPub ad object was not passed while calling the requestBid API
                  * @param error a {@link Error} to inform what went wrong while fetching the bid
                 */
                  @Override
                  public void onBidFailed(@Nullable MoPubView moPubAdObject, @NonNull Error error) {
                      Log.d(TAG, "Bid failure :" + error.getMessage());
                      // Load your MoPub ad here
                  }
             // Requesting for bid, where timeout is 5seconds
             banner.requestBid(5000);
         }
      }
      		

    Step 4: Setting up for MoPubView refresh

    In case your MoPubView has auto refresh feature enabled, then simply you need to request a bid for every success/failure for callback, as mentioned below.

    /**
    * A sample code to request bid without MoPubView
    */
    public class YourActivity {
        private IMABMoPubBanner banner;
        private MoPubView moPubView;
        private MoPubView.BannerAdListener bannerAdListener = new MoPubView.BannerAdListener() {
            @Override
            public void onBannerLoaded(MoPubView banner) {
                Log.d(TAG, "Banner loaded");
                // Requesting for bid, where timeout is 5seconds
                banner.requestBid(moPubView, 5000);
            }
            @Override
            public void onBannerFailed(MoPubView banner, MoPubErrorCode errorCode) {
                Log.d(KLOG_TAG, "Banner load failed : " + errorCode.toString());
                // Requesting for bid, where timeout is 5seconds
                banner.requestBid(moPubView, 5000);
            }
        };
        // Other code
    }
    	

    Interstitial Ads

    Step 1: Setting up an Interstitial Ad

    1. To display an Interstitial ad, you need an interstitial placement ID.
    2. After adding your app, select INTERSTITIAL AD to create a placement for ad type Interstitial.
    3. Once you successfully create the placement, the placement ID is available.

    Step 2: Adding an Interstitial Ad to your App

    Creating an Interstitial Ad

    To create an interstitial ad, create an instance of an IMABMoPubInterstitial like so:

    IMABMoPubInterstitial interstitialAd = new IMABMoPubInterstitial(context, <placementID>, listener);
    	

    Notes:

    • The IMABMoPubInterstitial class is not thread-safe. An interstitial instance must be created on the UI thread.
    • Similarly, all methods on this instance must be called on the UI thread. Not doing so will lead to unpredictable behavior and may affect your ability to monetize with InMobi.

    Step 3: Requesting for Bid

    Requesting for a bid requires you to call the IMABMoPubInterstitial#requestBid(...) method on the instance you just created to request for a bid. Note that there are two API(s) available to request for a bid -

    • IMABMoPubInterstitial#requestBid(moPubInterstitial, timeoutInMillis) : When you pass a MoPubInterstitial instance, the InMobi SDK automatically takes care of setting the keyword to this instance and saving the InMobiInterstitial instance for future usage in CustomEvent class.
      /**
      * A sample code to request bid with MoPubView
      */
      public class YourActivity {
          private IMABMoPubInterstitial interstitial;
          private MoPubInterstitial moPubInterstitial;
         public void requestBid() {
             // Write code to initialise your MoPub ad object and then do the following
             interstitial = new IMABMoPubInterstitial(context, <placementId>, new IMABMoPubListener<MoPubInterstitial, InMobiInterstitial>() {
                 /**
                  * The callback to notify that bid fetch was successful
                  * @param moPubAdObject a MoPub ad object passed in requestBid. It will be null if the MoPub ad object was not passed while calling the requestBid API
                  * @param imAdObject a InMobi ad object.
                  * @param keyword a keyword derived from the bid received.
                 */
                  @Override
                  public void onBidReceived(@Nullable MoPubInterstitial moPubAdObject,
                                            @NonNull InMobiInterstitial inMobiInterstitial, @NonNull String keyword) {
                      Log.d(TAG, "Keywords received:" + keyword);
                      // Load your MoPub ad here
                  }
                 /**
                  * The callback to notify that bid fetch resulted into failure
                  * @param moPubAdObject a MoPub ad object passed in requestBid.
                  *                      It will be null if the MoPub ad object was not passed while calling the requestBid API
                  * @param error a {@link Error} to inform what went wrong while fetching the bid
                 */
                  @Override
                  public void onBidFailed(@Nullable MoPubInterstitial moPubAdObject, @NonNull Error error) {
                      Log.d(TAG, "Bid failure :" + error.getMessage());
                      // Load your MoPub ad here
                  }
             // Requesting for bid, where timeout is 5seconds
             interstitial.requestBid(moPubInterstitial, 5000);
         }
      }
      		
    • IMABMoPubInterstitial#requestBid(timeoutInMillis) : In case you don’t wish to pass the MoPubView instance, then you need to take care of not only setting the keyword to the MoPubView instance (for which bid was requested) but also you’ve to save the InMobiInterstitial instance so that you can use it in the CustomEvent for rendering the ad in case InMobi wins the auction. Also, note that the IMAB keyword set to the MoPubInterstitial must be cleared off post each ad opportunity and before loading the interstitial ad again.
      /**
      * A sample code to request bid without MoPubView
      */
      public class YourActivity {
          private IMABMoPubInterstitial interstitial;
          private MoPubInterstitial moPubInterstitial;
         public void requestBid() {
             // Write code to initialise your MoPub ad object and then do the following
             interstitial = new IMABMoPubInterstitial(context, <placementId>, new IMABMoPubListener<MoPubInterstitial, InMobiInterstitial>() {
                 /**
                  * The callback to notify that bid fetch was successful
                  * @param moPubAdObject a MoPub ad object passed in requestBid. It will be null if the MoPub ad object was not passed while calling the requestBid API
                  * @param imAdObject a InMobi ad object.
                  * @param keyword a keyword derived from the bid received.
                 */
                  @Override
                  public void onBidReceived(@Nullable MoPubInterstitial moPubAdObject,
                                            @NonNull InMobiInterstitial inMobiInterstitial, @NonNull String keyword) {
                      Log.d(TAG, "Keywords received:" + keyword);
                      // Since MoPubInterstitial has not been passed in the request, you need to do the following
                      String oldKeyword = moPubInterstitial.getKeywords();
                      moPubInterstitial.setKeywords(TextUtils.isEmpty(oldKeyword) ? keyword :
                          String.format("%s,%s", oldKeyword, keyword));
                      Map<String, Object> localExtras = moPubInterstitial.getLocalExtras();
                      localExtras.put(IMABCustomEventInterstitial.AD_OBJECT_KEY, inMobiInterstitial);
                      moPubInterstitial.setLocalExtras(localExtras);
                      // Load your MoPub ad here
                  }
                 /**
                  * The callback to notify that bid fetch resulted into failure
                  * @param moPubAdObject a MoPub ad object passed in requestBid.
                  *                      It will be null if the MoPub ad object was not passed while calling the requestBid API
                  * @param error a {@link Error} to inform what went wrong while fetching the bid
                 */
                  @Override
                  public void onBidFailed(@Nullable MoPubInterstitial moPubAdObject, @NonNull Error error) {
                      Log.d(TAG, "Bid failure :" + error.getMessage());
                      // Load your MoPub ad here
                  }
             // Requesting for bid, where timeout is 5seconds
             interstitial.requestBid(5000);
         }
      }
      		

    ko-help-articles | Android Changelogs

    We are constantly improving the InMobi SDK to ensure that you get the best results on app monetization. The release notes here will give you an overview on all the important changes on InMobi SDK that impact our publishers.

    Build 9.0.7 [08/June/2020]

    • Critical bug fixes and optimizations

    Build 9.0.6 [08/May/2020]

    • Bug Fixes for MAX Audience Bidder & WebView

    Build 9.0.5 [24/April/2020]

    • MAX Audience Bidding Support
    • Custom Audience Bidding Support
    • MoPub Audience Bidding Support
    • Several Threading Optimizations and Improvements
    • Bug Fixes
    • Interface changes
      • - APIs Added
        • BannerAdEventListener

          public void onAdFetchSuccessful(@NonNull InMobiBanner ad, @NonNull AdMetaInfo info)

          public void onAdLoadSucceeded(@NonNull InMobiBanner ad, @NonNull AdMetaInfo info)

          public void onAdFetchFailed(@NonNull InMobiBanner ad, @NonNull InMobiAdRequestStatus status)

        • InterstitialAdEventListener

          public void onAdFetchSuccessful(@NonNull InMobiInterstitial ad, @NonNull AdMetaInfo info)

          public void onAdLoadSucceeded(@NonNull InMobiInterstitial ad, @NonNull AdMetaInfo info)

          public void onAdDisplayed(@NonNull InMobiInterstitial ad, @NonNull AdMetaInfo info)

          public void onAdFetchFailed(@NonNull InMobiInterstitial ad, @NonNull InMobiAdRequestStatus status)

        • NativeAdEventListener

          public void onAdFetchSuccessful(@NonNull InMobiNative ad, @NonNull AdMetaInfo info)

          public void onAdLoadSucceeded(@NonNull InMobiNative ad, @NonNull AdMetaInfo info)

        • PreloadManager

          void preload()

          void load()

        • InMobiBanner

          @NonNull public PreloadManager getPreloadManager()

        • InMobiInterstitial

          @NonNull public PreloadManager getPreloadManager()

      • - APIs Deprecated
        • BannerAdEventListener

          public void onAdLoadSucceeded(@NonNull InMobiBanner ad)

        • InterstitialAdEventListener

          public void onAdLoadSucceeded(@NonNull InMobiInterstitial ad)

          public void onAdReceived(@NonNull InMobiInterstitial ad)

          public void onAdDisplayed(@NonNull InMobiInterstitial ad)

        • NativeAdEventListener

          public void onAdLoadSucceeded(@NonNull InMobiNative ad)

          public void onAdReceived(@NonNull InMobiNative ad)

        • InMobiBanner

          public JSONObject getAdMetaInfo()

          public String getCreativeId()

        • InMobiInterstitial

          public JSONObject getAdMetaInfo()

          public String getCreativeId()

        • InMobiNative

          public JSONObject getAdMetaInfo()

          public String getCreativeId()

    Build 9.0.4 [3/March/2020]

    • Added support for InMobi Initialization callback
    • Improvements and Bug Fixes
    • Interface Changes
      • - APIs Added
        • InMobiSdk

          public static void init(@NonNull final Context context, @NonNull @Size(min = 32, max = 36) String accountId, @Nullable JSONObject consentObject, @Nullable final SdkInitializationListener sdkInitializationListener)

        • SdkInitializationListener

          void onInitializationComplete(@Nullable Error error)

      • - APIs Deprecated
        • InMobiSdk

          public static @InitializationStatus String init(@NonNull final Context context, @NonNull @Size(min = 32, max = 36) String accountId)

          public static @InitializationStatus String init(@NonNull final Context context, @NonNull @Size(min = 32, max = 36) String accountId, @Nullable JSONObject consentObject)

    Build 9.0.2 [27/January/2020]

    • Added support for success/failure status for InMobi Initialization
    • Proactive detection of abnormal network calls by fraudulent creatives
    • Improvements and Bug Fixes
    • Interface Changes
      • - APIs Updated

        InMobiSdk

    Build 9.0.1 [25/October/2019]

    • Added support for IAB GDPR consent string
    • Updated OMSDK to v1.2.19
    • Added Banner refresh support from SSUI
    • Added support for Facebook Audience Network 5.5
    • Bug Fixes for SDK and AudienceBidder Plugin

    Build 9.0.0 [20/September/2019]

    • Modular SDK

      - Added an ability to integrate Mediation as a separate module.

    • Added support for Android 10
    • Support for Mopub 5.8
    • Interface Changes
      • - APIs added

        AerServTransactionInformation

        public String getCreativeID()

      • - APIs removed
        • InMobiNative

          public InMobiNative(Context context, long placementId, NativeAdListener listener)

          public void setNativeAdListener(NativeAdListener listener)

        • InMobiNative.NativeAdListener
        • InMobiBanner

          public void setListener(BannerAdListener listener)

        • InMobiBanner.BannerAdListener
        • InMobiInterstitial

          public InMobiInterstitial(Context context, long placementId, InterstitialAdListener2 listener)

          public void setInterstitialAdListener(InterstitialAdListener2 listener)

        • InMobiInterstitial.InterstitialAdListener2
    • Bug fixes and performance improvements

    Build 8.2.1 [21/August/2019]

    • Bug Fixes for SDK and AudienceBidder Plugin

    Build 8.2.0 [02/Aug/2019]

    • Chrome Custom tabs support
    • Thread Optimizations
    • Bug Fixes for SDK and AudienceBidder Plugin

    Build 8.1.3 [05/July/2019]

    • Audience Bidder support for DFP
    • Bug Fixes

    Build 8.1.2 [13/Jun/2019]

    • Updated AdColony SDK support to 3.3.10
    • Updated Audience Network (Facebook) support to 5.3.1

    Build 8.1.1 [28/May/2019]

    • Improved Stability with crash fixes
    • Thread and Memory Optimizations
    • Support for new Picasso version 2.71828

    ### API added

    • NativeAdEventListener

    public void onAdReceived(InMobiNative ad)

    Build 8.1.0 [15/May/2019]

    • AudienceBidder
    • Added support for AppNexus
    • Added keyword implementation for MoPub
    • Added DFP plugin

    Build 8.0.9 [24/Apr/2019]

    • Bug fixes

    Build 8.0.8 [17/Apr/2019]

    • Bug fixes

    Build 8.0.7 [05/Apr/2019]

    • Bug fixes
    • Updated AudienceBidder to v1.0.1
    • Support for Amazon Publsiher Service
    • Support for granular keywords
    • Fix issue with updateBid not working with MoPub's refresh
    • Replaced source file with a aar
    • Change in API (see documentation)

    Build 8.0.5 [11/Mar/2019]

    • Added InMobi's Audience Bidder for MoPub
    • Update support for the following mediation adapters
    • AdColony SDKv 3.3.7
    • AdMob SDKv 17.1.1
    • AppLovin SDKv 9.1.0
    • AppNext SDKv 2.4.4.472
    • Audience Network (Facebook) SDKv 5.1.0
    • Chartboost SDKv 7.3.1
    • Flurry (Yahoo) SDKv 11.4.0
    • MoPub SDKv 5.4.1
    • MyTarget SDKv 5.3.1
    • Oath (AOL) SDKv 6.8.2
    • Unity SDKv 3.0.0
    • Vungle SDKv 6.3.24
    • Deprecated Tremor support
    • Deprecated Flurry (Yahoo) Banner
    • Added support for additional reporting for AppLovin and Chartboost
    • Bug fixes

    Build 8.0.1 [28/Nov/2018]

    • Bug Fixes

    Build 8.0.0 [17/Oct/2018]

    • Unification of InMobi SDK and AerServ SDK

    Build 7.3.0 [25/July/2019]

    • Bug fixes.

    Build 7.2.9 [10/July/2019]

    • Removal of createCalendar API from Mraid.
    • Support for new Picasso version 2.71828.
    • Bug fixes.

    ### Interface changes

    • API added:
    • InMobiNative

    public Boolean isVideo()

    Build 7.2.8 [6/May/2019]

    • Bug fixes.

    ### Interface changes

    • API added:
    • NativeAdEventListener

    public void onAdReceived(InMobiNative ad)

    Build 7.2.7 [25/Feb/2019]

    • MMA SDK Integration (China only)
    • Gif Enhancements

    ### Interface changes

    • Deprecated API:
    • InMobiNative

    public static void requestAd(Context context, final InMobiAdRequest adRequest,

    NativeAdRequestListener listener)

    • InMobiBanner

    public static void requestAd(Context context, final InMobiAdRequest adRequest,

    BannerAdRequestListener listener)

    • InMobiInterstitial

    public static void requestAd(Context context, InMobiAdRequest adRequest,

    InterstitialAdRequestListener interstitialAdRequestListener)

    Build 7.2.6 [8/Feb/2019]

    • Bug fix - Avoid crash in WebView processing.

    Build 7.2.4 [14/Dec/2018]

    • Bug fix - Release resource for failures with multiple banners in single AdContainer.

    ko-help-articles | iOS Changelogs

    We are constantly improving the InMobi SDK to ensure that you get the best results on app monetization. The release notes here will give you an overview of all the important changes on InMobi SDK that impact our publishers.

    Build 9.0.7 [24/Apr/2020]

    Change log for Monetisation SDK

    - Added MAX Header Bidding Support

    - Added MoPub Audience Bidding Support

    - Added Custom Audience Bidding Support

    - New APIs Added

    • IMBannerDelegate:
      -(void)banner:(IMBanner*)banner gotSignals:(NSData*)signals;
      -(void)banner:(IMBanner *)banner failedToGetSignalsWithError:(IMRequestStatus*)status;
      -(void)banner:(IMBanner*)banner didReceiveWithMetaInfo:(IMAdMetaInfo*)info;
      -(void)banner:(IMBanner*)banner didFailToReceiveWithError:(IMRequestStatus*)error;
    • IMInterstitialDelegate:
      -(void)interstitial:(IMInterstitial*)interstitial gotSignals:(NSData*)signals;
      -(void)interstitial:(IMInterstitial*)interstitial failedToGetSignalsWithError:(IMRequestStatus*)status;
      -(void)interstitial:(IMInterstitial*)interstitial didReceiveWithMetaInfo:(IMAdMetaInfo*)metaInfo;
      -(void)interstitial:(IMInterstitial*)interstitial didFailToReceiveWithError:(NSError*)error;
    • IMBannerPreloadManager:
      -(void)preload;
      -(void)load;
    • IMInterstitialPreloadManager:
      -(void)preload;
      -(void)load;

    - New Property "preloadManager" is added in IMBanner and IMInterstitial to enable functionality of IMBannerPreloadManager and IMInterstitialPreloadManager respectively

    - APIs Deprecated

    • IMInterstitialDelegate:
      -(void)interstitialDidReceiveAd:(IMInterstitial*)interstitial;

    Change log for Audience Bidding SDK

    - Added Audience Bidding Support.

    - New classes added:

    • IMABMoPubBanner:
      - (instancetype)initWithFrame:(CGRect)frame placementId:(long long)placementId delegate:(id)delegate;
      - (void)requestBid:(NSTimeInterval)timeout;
      - (void)requestBid:(nullable id)ad timeout:(NSTimeInterval)timeout;
    • IMABMoPubInterstitial:
      - (instancetype)initWithPlacementId:(long long)placementId delegate:(id)delegate;
      - (void)requestBid:(NSTimeInterval)timeout;
      - (void)requestBid:(nullable id)ad timeout:(NSTimeInterval)timeout;
    • IMABMoPubDelegate:
      - (void)bidRecievedFor:(nullable id)mpAd andInMobiAd:(id)imAd withTransactionInfo:(NSString*)keyword;
      - (void)bidFailedFor:(nullable id)ad withError:(NSError*)error;
    • IMFacadeObjectHolder:
      - (instancetype)initWithMoPubObject:(nullable id)mpAd andInMobiObject:(id)imAd;

    Build 9.0.6 [03/Mar/2020]

    - APIs Deprecated

    • - +(void)initWithAccountID:(NSString*)accountID consentDictionary:(nullable NSDictionary*) consentDictionary andError:(NSError * _Nullable * _Nonnull)error;
    • - +(void)initWithAccountID:(NSString *)accountID andError:(NSError * _Nullable * _Nonnull)error;

    - APIs Added

    • + +(void)initWithAccountID:(NSString*)accountID andCompletionHandler:(void (^ _Nullable)( NSError * _Nullable )) completionBlock;
    • + +(void)initWithAccountID:(NSString*)accountID consentDictionary:(nullable NSDictionary*) consentDictionary andCompletionHandler:(void (^ _Nullable)( NSError * _Nullable )) completionBlock;

    - Bug Fixes


    Build 9.0.4 [21/Jan/2020]

    - Deprecated initWithAccountID:consentDictionary: api of IMSdk.

    - Added initWithAccountID:consentDictionary:andError: api to IMSdk.

    - Video support for Banner ad

    - Improvement of fraud detection behaviour.

    - Support for Applovin(9.11.1), MoPub(5.10.0), AdColony(4.1.0), Vungle(6.4.11), Facebook (5.6.0)

    - Bug Fixes


    Build 9.0.3 [10/Dec/2019]

    - Bug Fixes


    Build 9.0.2 [20/Nov/2019]

    - Added ability to compile SDK on Xcode 10.2 onwards

    - Bug Fixes


    Build 9.0.1 [25/Oct/2019]

    - Added support for IAB GDPR consent string

    - Updated OMSDK to v1.2.19

    - Seperated Moat SDK from InMobi SDK and added it as an optional dependency

    - Removed UIWebView from the SDK

    - Bug Fixes


    Build 9.0.0 [20/Sept/2019]

    - Changes to support iOS 13

    - New and improved Modularised SDK design

    - Add InMobiMediationSDK.framework to your project for AerServ Mediation.

    - Addressing issue with layering of FAN banners upon refresh

    - SKStoreProductViewController crash fix.

    - Removed Support for iOS 8.

    - Removed Support for AerServ Native ad format.

    - Removed UIWebView from InMobi SDK. Viewability Partners might be using it.

    - Size reduction for both Framework and ipa inflation.

    - Various Bug Fixes and performance improvements

    - Adapter updates for the following mediation partners:

    • MoPub - v5.9.0
    • Google Mobile Ads - v7.50.0

    - APIs Added

    • IMBanner Class + -(void)cancel;
    • IMInterstitial Class + -(void)cancel;
    - APIs Added
    • ASAdView Class
      - @property (nonatomic, assign) ASEnvironmentType env;
      - @property (nonatomic, assign) ASPlatformType platform;
      - @property (nonatomic, assign) BOOL isMuted;
      - @property (nonatomic, assign) BOOL outlineAd;
      - @property (nonatomic, assign) BOOL sizeAdToFit;
      - @property (nonatomic, assign) BOOL useHeaderBidding;
      - @property (nonatomic, strong) NSArray* keyWords;
      - @property (nonatomic, assign) BOOL allowAdvertiserCloseButton;
      - -(void)forceRefreshAd;
      - -(CGSize)adContentSize;
      - -(void)rotateToOrientation:(UIInterfaceOrientation)newOrientation;
      - -(void)play;
      - -(void)pause;

    • ASAdViewDelegate Protocol
      - -(void)willLeaveApplicatonFromAd:(ASAdView*)adView;
      - -(void)adSizeChanged:(ASAdView*)adView;
      - -(void)adView:(ASAdView*)adView didFireAdvertiserEventWithMessage:(NSString*)msg;

    • ASInterstitialViewController Class
      - @property (nonatomic, assign) ASEnvironmentType env;
      - @property (nonatomic, assign) ASPlatformType platform;
      - @property (nonatomic, assign) BOOL isMuted;
      - @property (nonatomic, assign) BOOL showOutline;
      - @property (nonatomic, assign) BOOL useHeaderBidding;
      - -(void)play;
      - -(void)pause;
    • ASInterstitialViewControllerDelegate Protocol
      - -(void)interstitialViewControllerAdInteraction:(ASInterstitialViewController*)viewController;
      - -(void)interstitialViewController:(ASInterstitialViewController*)viewController didFireAdvertiserEventWithMessage:(NSString*)msg;

    Build 8.2.0 [16/July/2019]

    - TRC Removal

    - Caching Removal

    - Mraid Viewable Definition Change

    - Bug fixes

    Build 8.1.2 [16/July/2019]

    - Audience bidding support for DFP

    - SDK size Reduction

    - New api to set slot size for Banner in Audience Bidding

    - Bug fixes

    Build 8.1.1 [13/June/2019]

    - Adapter updates for the following mediation partners:

    • AdColony - 3.3.8
    • Facebook - 5.3.2

    - Bug fixes

    Build 8.1.0 [09/May/2019]

    - Audience bidding support for AppNexus

    - Added bid response support for Audience bidding

    - Added DFP Custom Event support

    - Bug fixes

    Build 8.0.8 [17/April/2019]

    - Addressing issue with layering of FAN banners upon refresh

    Build 8.0.7 [09/April/2019]

    - Audience bidding support for APS

    - Additional support for higher granularity keywords

    Build 8.0.5 [11/Mar/2019]

    - Audience bidding support for MoPub

    - Adapter updates for the following mediation partners:

    • AdColony - 3.3.6
    • AppLovin - 6.1.4
    • Chartboost - 7.3.0
    • Facebook - 5.1.0
    • Flurry - 9.2.3
    • MoPub - 5.4.1
    • MyTarget - 4.8.8
    • Vungle - 6.3.2
    • OneMobile AOL (Millennial Media) - 6.8.2
    • Vungle - 6.3.2
    • Unity - 3.0.0

    - Deprecated Tremor support

    - Deprecated Flurry banner support

    - Added support for additional reporting for AppLovin and Chartboost

    - Bug fixes

    - Google open auction support

    Build 8.0.2 [12/Dec/2018]

    - Mediation bug fixes

    Build 8.0.1 [21/Nov/2018]

    - Added mediation support

    - Bug fixes

    Build 8.0.0 [17/Oct/2018]

    - Added OMSDK support

    - Unification of InMobi and AerServ SDK

    Build 7.3.1 [11/July/2019]

    - Google open auction support

    Build 7.3.0 [27/Jun/2019]

    - Bug Fixes and Optimization

    Build 7.2.9 [28/May/2019]

    - Bug Fixes

    Build 7.2.8 [30/Apr/2019]

    • - Framework size reduction
    • - Bug Fixes
    • - APIs Added
    • * IMNative Class
    • + -(void)nativeAdIsAvailable:(IMNative*)native;

    Build 7.2.7 [26/Feb/2019]

    • - Support for MMA Viewability in China
    • - Bug Fixes

    Build 7.2.4 [21/Jan/2019]

    - Bug Fixes

    Build 7.3.1 [11/July/2019]

    - Google open auction support

    Build 7.3.0 [27/Jun/2019]

    - Bug Fixes and Optimization

    Build 7.2.9 [28/May/2019]

    - Bug Fixes

    Build 7.2.8 [30/Apr/2019]

    • - Framework size reduction
    • - Bug Fixes
    • - APIs Added
    • * IMNative Class
    • + -(void)nativeAdIsAvailable:(IMNative*)native;

    Build 7.2.7 [26/Feb/2019]

    • - Support for MMA Viewability in China
    • - Bug Fixes

    Build 7.2.4 [21/Jan/2019]

    - Bug Fixes

    ko-help-articles | Publisher Onboarding

    Welcome to InMobi!

    This is your official onboarding guide to help you navigate through the tips and tricks of monetizing with InMobi. This is also your knowledge hub to get all the required resources to learn everything from setting up an account with InMobi, monetizing ad formats effortlessly, understanding compliance initiatives and policies and other guidelines that affect publisher monetization.


    We've Got Your Back

    InMobi makes onboarding easy with a comprehensive guide and an intuitive UI for every tiny step you wish to take. In case you run into speed bumps, we have a concierge service that gives you access to a dedicated partner manager and a technical support. Ready ? Let’s dive into the details.

    The onboarding program has 5 major chapters to get you started. We would recommend that you go through each module so that you can make the best use of our platform.

    1. Getting Started Helps you set up an account, placement, select ad formats, etc.
    2. Download SDK Go-to page for all SDK updates
    3. Integration Guidelines (Android) Your guide to integrate InMobi SDK in your Android app
    4. Integration Guidelines (iOS) Your guide to integrate InMobi SDK in your iOS app
    5. Integrating InMobi with Mediation Go-to page for all InMobi adapters for mediation partners

    Once you have gone through the above, you can take your time to navigate through other supporting documents that will come handy once you begin monetization:

    6. Third-party Platform Guidelines Integration guidelines for platforms like Unity.
    7. Reporting Go-to page for all performance reports and insights
    8. Payments Reference guide for all payment-related details
    9. Compliance Reference guide for all publisher compliance policies including GDPR, App-Ads.txt, etc
    10. Frequently Asked Questions Lost? We’ve got your back!

    Ready to get started?

    ko-help-articles | Integrating the SDK

    What are the benefits of integrating InMobi SDK?

    • Featherlight, robust SDK with the largest brand and performance demand connections
    • Built-in Header Bidding (Audience Bidding) and Unified Auction technology
    • Easy plug-and-play integration
    • Crash analytics with proactive logging
    • Built-in ad quality controls
    • Integrated with MOAT and OM SDK viewability
    • True HD buffer-free video viewing experience

    Which devices does InMobi support?

    InMobi supports only Android and iOS devices.


    Where can I download the InMobi SDK?

    You can download the InMobi SDK for Android and iOS devices from here.


    How do I sign up with InMobi?

    You can sign up with InMobi here. If you face trouble signing up, please sign out of the account, clear your browsing data and try again. If you still face any issues, please contact sales@inmobi.com


    I need help with integrating the SDK, what do I do?

    Our team is here for you 24/7. Feel free to write to sales@inmobi.com or to your dedicated InMobi partner managers.


    What is the size of InMobi SDK?

    InMobi’s latest SDK is robust and featherlight ensuring that your app remains unbloated and performs efficiently to deliver the best user experience. Details on the SDK specifications including its size can be found here.


    Which frameworks does InMobi support?

    InMobi currently supports Cocos2dX and Unity. Please note that we no longer support Cordova.


    Does InMobi support VAST?

    VAST is an IAB specification which defines the mechanism to render a video in a publishing environment. InMobi currently supports VAST 4.0 on different platforms.


    Does InMobi have app guidelines that I must adhere to?

    Yes, publishers who choose to work with InMobi are required to adhere to the following InMobi guidelines. If you fail to comply with these guidelines, we may disable your InMobi account.

    This contract shall commence on the date on which you accept these conditions upon your registration with InMobi and shall remain in full force and effect unless and until terminated by either Party in accordance with the terms of the Contract.

    ko-help-articles | Creating Account

    I am a publisher, how do I create my first ad with InMobi?

    Getting started with InMobi is quick and easy. Here’s a step-by-step walkthrough to begin with.

    You might come across the following terms while you set up the account on the InMobi platform. We would recommend that you go through the same so that you are comfortable navigating our platform.

    • Username: Any name that can uniquely identify you to your InMobi account
    • Account ID: A unique identifier for your account with InMobi. Select the drop down next to your username to view your account id.
    • Placement ID: A unique identifier for the placement unit you create on the InMobi platform. To find your app Placement Id: select Monetize from the top navigation header, then select the relevant app from your list. The placement Id will be available to you in a dialog box.
    • Payment ID: A unique ID generated at the account level after payment details are updated. To locate, select the drop down next to your user name.

    What should I do to activate my account?

    Welcome aboard, we strongly recommend the following checks for account activation:

    • The KYC and Payment details are mandatory. Ensure it is updated at the account level without which the account will not be activated resulting in failure of traffic.
    • Your app must be published in Google Play, iTunes or Kindle store with a valid URL to be approved. The sites will automatically be put on hold/rejected if a URL is missing.

    How long does it take for my account to be approved?

    The account takes 24-48 hours to be approved.


    How do I add users to my InMobi account?

    You may add up to 3 users per account. To add users:

    In the InMobi dashboard, select Account Settings > User Manage > Invite user > Set Permissions accordingly.


    How do I recover my account password?

    Please go to the account recovery page and enter your login credentials to reset your password.

    ko-help-articles | Creating Placements

    How do I set floor price for my placements?

    We will take care of this task for you! The floor prices are set by the Partner manager/support team for the placements created on InMobi dashboard. If you have questions regarding the same, please contact your dedicated partner manager or write to sales@inmobi.com.


    How do I start testing ads?

    The following steps will help you test ads at your end without any assistance. We would recommend that you pause for a moment and go through the same carefully.

    If you are integrating an ad unit for the first time: Set Test Mode to Global ON
    If you want to selectively turn on test traffic for a set of devices:

    If you already have a prior version of the SDK integrated for this particular ad unit, you should restrict your testing to only a few devices.

    Set Test Mode to Selective ON. Under the Device section:
    1. In the Device ID box, type the device ID
    2. In the Device Name box, set any name.
    3. Click Add Device to add the test device.

    NOTE: If you already have a device configured, select the device for the test mode to be enabled.

    IMPORTANT: Once you are done testing, please ensure that the TEST MODE is turned OFF so that you can start sending the ad requests to the network.

    I am still not able to test ads, what do I do?

    Please reach out to your InMobi partner manager or support at sales@inmobi.com. Kindly provide the following information if you choose to write to our support team:

    • Publisher Name
    • Publisher Account ID
    • Publisher Mail ID
    • Placement ID
    • Details of the issue

    What ad formats does InMobi support?

    InMobi’s SDK supports banners, graphical interstitials, video interstitials (skippable and non-skippable), rewarded ads and native ads as per the IAB guidelines.

    Still confused? No problem. Refer to our blog which has helped our publishers explore the magic with InMobi.

    ko-help-articles | Mediating InMobi

    This section takes you through questions on the mediation platforms we support. Using mediation, you can send ad requests to multiple ad sources including InMobi and ensure that you have the best available demand partners to fill the ad requests.


    Can I add InMobi to other mediation platforms?

    Oh yes, Absolutely! InMobi supports major mediation platforms like Google, Mopub, ironSource, Appodeal, Max, Fyber to name the major ones. For directions on integrating each mediation provider, please visit our integration guidelines page.


    What are the best practices for ad mediation?

    Here’s a quick guide on some of the best practices on ad mediation. You can learn more about InMobi’s mediation platform here. If you wish to know more about our mediation platform or wish to schedule a demo, please reach out to your dedicated partner manager or sign up here.


    Where can I download the InMobi SDK required to work with Google, MoPub or other mediation platforms?

    Visit the Download SDK page to get the latest iOS or Android SDK or learn more about third party ad mediation platforms supported by InMobi here.

    ko-help-articles | Reporting

    If you have integrated your apps with InMobi SDK (Yay, good going!!) and have started serving ads, the platform performance reports will give you key metrics that impact your earnings. These performance reports help you make calculated decisions to achieve monetization success.


    How do I download reports from the dashboard?

    On the dashboard Visit Reports > All Properties > Choose Measure to view metric filters in dropdown

    Use the filters below to deep dive into your app’s performance and better understand your ad activity.


    How do I generate the reporting API key?

    There are two ways to access the API key:

    1. The API key is automatically generated to the registered mail ID after an account is created with InMobi.
    2. Additionally, at the account level visit your Admin panel > Account Settings > 5th drop-down is API key > Generate API key.

    Note: You can also validate to check if the API key is correctly linked to your account as shown below:


    What is the time zone used for reporting?

    All InMobi reports are available in GMT timezone.


    What is the currency used for reporting publisher revenues?

    InMobi dashboard reports the publisher revenues in US dollars.


    How soon does the publisher revenues reflect in the dashboard?

    Reports are available for publishers within 24 hours. However, in cases of delay the standard ETA takes upto 48 hours for the system to reflect the publisher revenues. We would recommend that you contact your dedicated partner manager in case you need some help in such cases.


    Glossary for reporting metrics:

    Metric

    Definition

    Calculation

    eCPM

    Effective CPM: Effective cost per Mille

    Total earnings /

    (Total impressions *1000)

    CTR

    Click through rates is # of clicks your ad receives

    divided by # of times your ad is shown

    Total # of clicks /

    (Total # of ad impressions)

    Total ad requests

    Total # of ad requests received from publishers

    # of ad requests

    Ad impressions served

    Ad impressions served by InMobi

    # of ad impressions served

    Ad impressions rendered

    Ad impressions successfully viewed by the user

    # of ads rendered

    Fill Rate

    The percentage of ad served from ads requested

    % of successful impressions / (Total # of requests)

    Ad render rate

    The percentage of served ads rendered

    # of ads rendered /

    (# of ad impressions served)

    Publisher Revenue

    Total revenue to publisher

    ko-help-articles | Payment

    What is InMobi’s payment terms?

    InMobi’s publishers will be paid on Net 60 terms. The monthly earnings of a publisher against an account will be paid provided the account qualifies to be paid within 60 days of the end of that month
    Example: Publisher earnings in the month of January (January 1st- 31st) will be made in the month of April of the same year.


    What is InMobi’s payment frequency?

    InMobi follows monthly payment frequency for all publishers.


    How do I create a payment profile?

    Publishers are required to adhere to the following steps:

    • Create a PayPal profile
    • Create an Online Bank Transfer profile
    • Activate your Payment profile

    You can read more about the payment set up here.


    What are the modes of payment?

    Option 1: Electronic Fund Transfer to a system verified bank account

    InMobi can pay accrued publisher earnings, subject to qualification, by Electronic Funds Transfer. To do this, the details of your bank account where payment is to be received should be verified on the InMobi portal.

    • Note for Countries outside India: For bank accounts in countries other than India, to qualify for payments by electronic funds transfer, the accrued unpaid earning need to exceed USD 300.
    • Note for India: For electronic funds transfers to bank accounts in India, the accrued unpaid earning need to exceed USD 50 to qualify.

    Option 2: Paypal Transfer to verified Paypal accounts

    InMobi can pay accrued publisher earnings, subject to qualification, through PayPal. To do this, the PayPal profile where payment is to be received should verified on the InMobi portal.

    • Note for Countries outside India: To qualify for payments through PayPal, the accrued unpaid earning needs to exceed USD 50. The minimum threshold to make payments through PayPal is independent of the country in which the PayPal beneficiary resides, or where the profile was created.
    • Note for India: Publishers from India cannot be paid using PayPal.

    Note: All unpaid earnings will roll over to the next payment cycle and come up for qualification again, wherein the accrued earnings shall be compared against the minimum amount. For further queries, please write to payroll.


    Should publishers registered with InMobi in India generate an invoice?

    Note: This is applicable only for publishers registered in India.

    Publishers registered in India are required to raise an invoice in INR addressed to the InMobi Bangalore office using the fixed rate for the month along with a hard copy of the invoice addressed to your dedicated partner manager.

    Mailing Address:
    InMobi, 7th Floor, Delta Block, Embassy Tech Square, Varthur Hobli,
    Kadubeesanahalli, Bangalore - 560103


    How do I transfer my pending earnings if I have both publisher and advertiser accounts with InMobi?

    Please go through this document to read the step-by-step details.


    How do I view my earnings history?

    Please follow the below steps to view your earning history

    • Login to your account.
    • Click on the drop down next to your username.
    • Select Earnings.
    • Earnings History is available daily/weekly/monthly using Select Date Range feature
    • Download Transaction History to a CSV or Excel file by clicking the export icon.

    Note: The maximum amount you can enter here is the value of your current pending earnings.

    ko-help-articles | Compliance Guidelines

    Publishers who wish to participate in InMobi must comply with our online terms of service and privacy policies. This section gives you access to all the compliance documentation. We would highly recommend that you go through this in detail

    In case you do have any questions, please feel free to reach out to your dedicated InMobi partner manager.

    ko-help-articles | Download SDK

    The latest InMobi SDKs (iOS and Android) are available here for download.

    We would highly recommend that you always update to the latest version of our SDK so that you can take advantage of any new feature or performance fix that we might introduce.

    SDK Specifications (iOS)

    Platform InMobi SDK Supported Usecases .ipa Inflation SDK Links Change Logs
    iOS SDK 907 In-app Monetization with InMobi 629 KB Change Logs
    iOS SDK 907 InMobi Mediation & InMobi Audience Bidding 812 KB Change Logs

    SDK Specifications (Android)

    Platform InMobi SDK Supported Usecases .apk Inflation SDK Links Change Logs
    Android SDK 908 In-app Monetization with InMobi 329.8 KB Change Logs
    Android SDK 908 InMobi Mediation & InMobi Audience Bidding 418.2 KB Change Logs

    Additional Resources

    If you are looking at upgrading to SDK 9xx, we would suggest that you go through our migration guide.

    For information on the feature updates, please go through the iOS or Android change logs.

    ko-help-articles | Mopub1

    ko-help-articles | Integrating InMobi with Third Party Mediation

    This guide is intended for publishers who want to integrate InMobi as a demand source on third party mediation platforms like Mopub, Google, Ironsource, Max, etc. You can integrate Banner, Interstitial, Native and Video ad formats (supported by InMobi) on the below mediation platforms.

    If you instead wish to use the InMobi mediation platform, then we would recommend getting started here.

    Prerequisites

    Download InMobi SDK here and get started with an InMobi account here.

    Mediation Platforms Supported

    Mediation Platform Mediation SDK Version Supported InMobi SDK & Adapters Integration Documentation
    MoPub
    • iOS 5.13.1
    • Android 5.13.1

    InMobi SDK 9xx Download Adapter: iOS | Android

    Visit
    Google AdMob
    • iOS 7.50.0
    • Android 18.2.0

    InMobi SDK 9xx Download Adapter: iOS (Media View) |
    iOS (Image View) |
    Android (Media View)|
    Android (Image View)

    Visit
    ironSource
    • iOS 6.8.5.0
    • Android 4.3.1

    InMobi SDK 7.2.1: Download Adapter

    Visit
    Applovin/Max Contact Applovin

    Contact Applovin

    Visit
    Appodeal
    • iOS 2.5.10
    • Android 2.5.8

    InMobi SDK 7.2.7: Download Adapter

    Visit
    Fyber
    • iOS 8.21.0
    • Android 9.56.0

    InMobi SDK 7.1.1: Download Adapter

    Visit

    Note: You are required to use the MediaView asset instead of the ImageView asset if you want to include a main image asset in the layout for your native ad.

    We would highly recommend following the partner integration guidelines to know more about the specific mediation partner or adding InMobi as a demand source and setting up placements for mediation.

    ko-help-articles | Ads.txt for Apps

    App-ads.txt is a simple solution that gives you complete control of your inventory. By creating a depository of authorized sellers, you can let your buyers identify the programmatic firms that have legitimate access to the inventory.

    App-ads.txt will be a text file on the app publisher’s website that declares who is authorized to sell the publisher’s inventory.

    How to implement app-ads.txt?

    Perform these steps to implement app-ads.txt:

    Step 1: Provide developer website URL in the app store

    Publishing a website and providing its URL is mandatory for the app’s ad inventory to participate in the authorized seller scheme.

    Step 2: Create the app-ads.txt file

    Create a .txt file and name it app-ads.txt.

    Step 3: Add Entry

    Add an entry in the app-ads.txt concatenating the following information. Contact your partner manager for assistance.

    IAB Field Name Description Example Requirement Status
    Domain Name of the Advertising System The domain name of the system to which bidders connect. inmobi.com Mandatory
    Seller Account ID Please reach out to your InMobi partner manager for the Seller Account ID and TAG ID that needs to go with the InMobi entry. Do not use the Publisher GUID on the portal [Format: inmobi.com, seller account ID, relationship, InMobi TAG ID]. 74dcd2c4fa2d401cb74bbb9c124a268c Mandatory
    Type of Account/Relationship The type of account is, either:
    • DIRECT: The publisher directly controls the account in Field 2 on the system in Field 1.
    • RESELLER: The publisher has authorized another entity to control the account indicated in Field 2 and resell their ad space via the system in Field 1.

      Note: The IAB specifies that DSPs should treat this field as case insensitive when interpreting data. InMobi recommends that the value in this field be typed in all capital letters.

    Direct Mandatory
    Certification Authority ID An ID that uniquely identifies the system in Field 1 within a certification authority.

    Note: The TAG ID for all InMobi lines in the ads.txt file is 83e75a7ae333ca9d.

    83e75a7ae333ca9d Optional, but highly recommended

    Example: ‘inmobi.com,74dcd2c4fa2d401cb74bbb9c124a268c,DIRECT,83e75a7ae333ca9d’

    Step 4: Post

    Post the app-ads.txt file to the root directory of your domain server for the appropriate website. The file can be accessible via HTTP or HTTPS but must be located under a standard relative path: "app-ads.txt". The HTTP request header must contain "Content-Type: text/plain".

    Ads.txt checklist for apps

    Please go through this to mitigate mistakes in implementation:

    1. List your developer URL on all app stores distributing the app. For example: https://www.example.com where "example" is the host name.

    2. Ensure you implement app-ads.txt on the same developer URL (https://www.example.com) that is listed on the app store.

    3. If you have multiple developer URLs across apps, ensure app-ads.txt is implemented on all developer URLs and all your apps list the same developer URL on the app store.

    4. Ensure the app-ads.txt file is implemented in the root domain as shown below:

      https://example.com/app-ads.txt

      Please also refer the IAB specifications to know more about this.

    5. Be wary of mistakes in naming the .txt file. The file must be named app-ads.txt file.

    6. Ensure the format of the file is .txt. Buyers won’t be equipped to read data from any other format.

    7. Please reach out to your InMobi partner manager for the Seller Account ID and TAG ID that needs to go with the InMobi entry. Do not use the Publisher GUID on the portal [Format: inmobi.com, seller account ID, relationship, InMobi TAG ID].

    8. To mitigate any revenue loss, make sure you make entries for all InMobi Exchange partners as well. Please reach out to your InMobi partner manager for this information.

    Generating app-ads.txt string on InMobi’s user interface

    To ease implementation, we have introduced an app-ads.txt file generator on the InMobi user interface that will automatically build the strings you need to add to your app-ads.txt file in order to declare InMobi and its exchange partners as authorized sellers.

    Step 1: Log into your InMobi Account > Account > Account Settings

    Step 2: In Account Settings page, click Ads.txt option

    Step 3: In Ads.txt page, click Generate Ads.txt Entries button

    Following this, the UI will download a .txt file with the necessary strings. The four essential fields - inmobi.com, inventory source id, relationship, and tag ID - will be stitched together, ready to be added to the .txt file that you maintain. Please note that these ONLY include entries for InMobi accounts and Exchange partners.

    ko-help-articles | Segment Creation Tool

    There are two ways in which advertisers can create user segments:

    1. Using InMobi’s Advertiser Segment API
    2. Using InMobi’s Segment Creation Tool

    This article guides you on how to create user segments with our new GDPR-compliant Segment Creation Tool.

    Step 1: Navigate to Segment Creation tool

    Step 2: Enter segment details for the app being promoted

    On successful login, Segment Upload form is displayed with options as shown below:

    • PropertyId: - Enter the propertyId as registered with InMobi.
    • Segment Name: - Enter a name for the segment being created. Please make sure to enter a new name. If an existing segment name is entered, an error is shown on clicking Create Segment button.
    • Targeting Options: - Choose one of 3 options (Positive targeting / Suppression, Retargeting or Brand) from the dropdown menu, as per your requirement. See the image below:

    After filling in the details, click on Create Segment button.

    Step 3: Upload the segment

    On successful creation of the segment name, you are provided with the following options to upload the device ID list:

    • Device ID Type: - Select one from the following options:

    • Notification Email Ids: - Specify additional email addresses of people to be notified on the segment status.
    • Choose file: - Upload the file containing the device IDs (new line separated) in .csv format.

    After filling in the details, click on Upload button.

    On successful upload, a confirmation message is displayed as shown below:

    ko-help-articles | Reporting API

    ko-help-articles | GDPR Guide for Publishers

    If not already on GDPR compliant InMobi connection SDK 710 for Android, SDK 711 for iOS, mobile web or API, upgrade to the latest version: SDK, Mobile Web and API.

    The Context

    The General Data Protection Regulation (GDPR) went into effect on May 25, 2018 across the European Union. These new regulations create a framework to protect personal data about individuals in the EU and must be adhered to by all businesses who collect or process such data. Failure to comply with GDPR can result in strict penalties for non-compliant companies.

    As a trusted partner of leading brands across the globe, InMobi is committed to data protection and protecting consumer privacy while creating a safe and transparent marketplace for advertisers and generating value for our publisher partners.

    The Update

    With GDPR, InMobi is adopting a consent-based approach for the users in the EU in order to be compliant with GDPR regulatory requirements.

    Q. Is InMobi a Data controller, Joint Controller or Data Processor?

    InMobi is a Joint Controller with the Publisher.

    Q. How will InMobi collect the data?

    InMobi does not gather user consent directly and will rely on the publisher to obtain appropriate consent from data subjects and to pass that consent on to InMobi.

    Q. What will InMobi do in cases where the user consent is not present?

    InMobi will never collect or pass user data to either an advertiser or a publisher without user consent.

    Q. What will InMobi do in cases where the user consent is not present?

    InMobi will never collect or pass user data to either an advertiser or a publisher without user consent.

    Q. What happens if the user withdraws the consent?

    Publishers are required to notify InMobi where consent is withdrawn or revoked and, accordingly, InMobi will honor such data subject’s request.

    Q. What happens if I am not compliant with InMobi’s GDPR solution?

    All requests originating from users where they have not given consent, InMobi will serve non-targeted ads to these users.

    Complying with InMobi GDPR

    Note: All of the following steps are MANDATORY. Publishers failing to comply will not be considered as GDPR compliant.

    1. Log in to InMobi’s portal and accept InMobi’s new Terms Of Service (TOS). The new InMobi TOS have GDPR-related clauses.
    2. If you have traffic from the EU, select My partner/ I have users from the European Union. Otherwise, select GDPR compliance is not applicable for my account.
    3. Note: If you have already signed and shared Data Protection Rider with InMobi, then there is no action required here. Please proceed to Step 3.

      Confirmation page under “Account Settings.”

    4. If your app falls under the age gating requirements in GDPR, i.e. your app is targeting children < 16 years of age, please mark the age gating flag. If the app was already marked for COPPA, we will automatically flag the app as compliant - < 13 years for the US and < 16 years for the EU.
      • For creating new apps
      • For updating existing apps
    5. Upgrade your connection to the latest InMobi version: SDK, updated API, and Mobile Web specifications. Please reach out to your InMobi account manager for the latest API specifications.

    To comply with GDPR, upgrade your SDK today.

    You can read more about InMobi’s GDPR readiness here.

    For any queries or concerns, please reach out to either your account manager or email to gdprcompliance-group@inmobi.com

    ko-help-articles | GDPR Guide for Advertisers

    The General Data Protection Regulation (GDPR), which goes into effect on May 25, 2018, might have implications for your business. The new law creates a framework to protect personal data about individuals in the European Economic Area (EEA) and must be adhered to by all businesses who collect or process such data.

    As a trusted partner of leading brands across the globe, InMobi is committed to data protection and protecting consumer privacy while creating a safe and transparent marketplace for advertisers.

    Additionally, InMobi will be conducting tests of our GDPR compliance between now and May 25th, so your campaigns in the EEA may be impacted if you have not yet accepted the new Terms of Service (TOS) when our tests begin.

    In light of this, we would like to ensure you are aware of our updated terms; reference to ‘Media Company’ below shall mean InMobi:

    • GDPR: Without limiting the generality of the terms of the agreement, for Advertiser/Agency/Reseller who have users based in EEA, Advertiser/Agency/Reseller acknowledge and agree that your collection, use, sharing and/or treatment of any Personal Data (as such term is defined under the General Data Protection Regulation ("GDPR")) must be in compliance with the requirements of GDPR. If Advertiser/Agency/Reseller whether by itself or through its third parties provide or share with Media Company any Personal Data for users based in EEA, Advertiser/Agency/Reseller will as the Controller (as such term is defined under GDPR) remain responsible for obtaining appropriate user consent and execute a relevant data protection agreement for setting out the terms of Processing (as such term is defined under GDPR) by Media Company. Where you intend to share any EEA user Personal Data as defined under GDPR with Media Company, please share your data protection agreement with us for review. You agree not to share any EEA user Personal Data with Media Company except where such a data protection agreement has been executed.
    • If Advertiser/Agency/Reseller are a GDPR compliant demand partner with Media Company and where you or your third parties (at your behest) are receiving EEA user Personal Data as defined under GDPR from Media Company, you accept the terms of the Data Protection Rider as set out in www.inmobi.com/advertiser-data-protection-rider for the permitted scope of Processing of such Personal Data by you. If you have not accepted the said data protection agreement, Media Company as the Controller will not be in a position to share any such Personal Data with you or your third parties.
    • Where Advertiser/Agency/Reseller require any third party including its trackers on its behalf to either receive from Media Company or share with Media Company, any Personal Data, Advertiser/Agency/Reseller shall remain liable for the acts and omissions of its third parties to the same extent Advertiser/Agency/Reseller would be liable if it were either receiving/sharing such Personal Data from/with Media Company. Accordingly, Advertiser/Agency/Reseller agrees to execute appropriate data processing agreements with such third parties.

    We request that you review and accept the updated Terms of Service for each account and each mobile application you manage on InMobi’s Customer Interface (CI).


    Complying with InMobi GDPR

    Note: All of the following steps are MANDATORY. Advertisers failing to comply will not be considered as GDPR compliant.

    1. Sign in to your account(s) on InMobi and accept the new Terms of Service (TOS) if you haven’t already done so.
    2. If you are signing in for the first time after May 14, 2018, the GDPR Applicability flow will load automatically. If not, please navigate to Account → GDPR Applicability.
    3. Image 1: For advertisers logging in for the first time post May 14, 2018, the GDPR page will be loaded automatically.

      Image 2: Post May 14, 2018, a new tab ‘GDPR’ is available under the Account setting page. GDPR settings can be edited here.


      • If you service users in the EEA, please select “I have users from the European Union (EU)” option and respond to the questions that follow appropriately.
      • Image 3: Follow-up questions are loaded automatically based on the choice(s) selected. If you select “Yes,” for “Great! Are you GDPR compliant?”, an additional question, “Do you accept Inmobi’s Data Protection Rider?” is loaded.

        Image 4: Only if the “Yes” has been selected for both follow-up questions, the advertiser will be noted as GDPR compliant as indicated above.

        Images 5 and 6: Selecting GDPR compliance but not accepting InMobi’s Data Protection Rider would still mean you cannot target EEA users through our platform. You can change the compliance settings at anytime by clicking on the Edit button.

      • If you do not service users in the EEA, select the option “GDPR compliance does not apply to my account.”
      • Images 7 and 8: Advertiser selects “GDPR Compliance is not applicable for my account” along with resulting status.

    Note:

    1. Only if your app(s) are GDPR compliant and InMobi’s Data Protection Rider has been agreed to and signed will your campaigns run in EEA on the InMobi network.
    2. In all other cases, InMobi will be unable to facilitate campaigns targeted to EEA based users for those app(s).

    Learn more

    You can also learn more about GDPR and how InMobi is committed to safeguarding your data at inmobi.com/GDPR.

    ko-help-articles | Reporting API Guide

    Introduction

    This document contains information required to use the InMobi Advertiser Reporting APIs.

    The Advertiser Reporting API is an intuitive interface for premium advertisers to request for reports directly with REST APIs. The following sections describe the various aspects of the API and steps involved with successful integration.

    Target Audience

    The intended audience is InMobi's clients who use the Advertiser Reporting features.

    API Key

    An API key is required for all in-bound requests. The API key is a 32-character string generated by InMobi. This string is generated once the account is granted API access.

    The API key is sent in the request header, using the parameter secretKey, and is verified by the system on each request.

    API Versioning

    The API version should be provided in every API request. The API version is a part of the request URL.

    For example, the URL: https://api-sandbox.inmobi.com/v1.0/reporting/adve... contains the version v1.0.

    Going Live

    Execute the sample code provided in the following sections in the sandbox for testing. To go live, replace the sandbox URL with the URL provided for going live. For example, https://api.inmobi.com/v1.0/reporting/advertiser

    Rate Limits

    API usage is rate limited to protect InMobi from abuse. Clients are allowed to make limited calls in a given hour. The policy affects the APIs in the following ways.

    Note: Rate limit is not applicable to the beta program.

    Default Rate Limiting

    Every API request is authenticated. The default rate limit is applied on a combination of inbound IP and API Key to a maximum of 100 calls per hour. If the rate limit exceeds, the API will return an error response. For more information on the error, refer to the section Error Codes.

    Feature Rate Limiting

    Some API-based feature requests have additional feature limits in conjunction with the default rate limits. Requests to such features will count against both the feature and default rate limit. If either limit exceeds, the API will return an error response. For more information on the error, refer to the section Error Codes.

    Note: To avoid exceeding the rate limit, it is recommended that you store the frequently used responses on the local machine.

    Getting Started

    The following subsections provide information to get started with integrating the Advertiser Reporting APIs.

    API Formats and Naming Conventions

    The Advertiser Reporting APIs conform to the REST specifications. To get the response in a format of your choice, change the format extension for any request. JSON, XML, and CSV are the formats supported. The format is specified by appending a json/xml/csv extension at the end of the URL.

    Naming conventions for elements throughout the API will appear in camel-case. For example − groupBy, filterBy.

    Data Formats

    The following sections explain the formats used to represent data.

    Date and Time

    Any reference to date and time in the API request and response is defined in the following format: YYYY-MM-DD and hh:mm:ss.

    Note: All the time formats are returned in UTC. The API developer should set the time as required.

    Depending on the timeFrame and granularity, the dates are represented in the format as shown in the table below. For example, if the timeFrame in the request contains today’s date, the response contains data grouped by hour in the format YYYY-MM-DD hh:mm:ss.

    Time Frame

    Granularity

    Reporting Format

    Today

    Hourly

    YYYY-MM-DD hh:mm:ss

    Yesterday

    Hourly/Daily

    YYYY-MM-DD hh:mm:ss

    <= last 6 months

    Daily

    YYYY-MM-DD

    <= last 12 months

    Monthly

    YYYY-MM-DD (Starting date of the month)

    Currency

    Any reference to currency is represented as a string containing decimal values. No location specific format is applied to decimal values. For example, value 1554.67.

    Note: The only currency supported in the application is USD.

    Request Headers

    Following are the required headers for requesting a valid session.

    Request Headers

    Description

    userName

    Username of your InMobi account.

    password

    Password of your InMobi account.

    secretKey

    The API Key issued by InMobi.

    accountId

    The 32-character string, which is the unique identifier of your account.

    secretKey

    The API Key issued by InMobi.

    sessionId

    The valid session Id that is required to authenticate your request.

    Parameters Required to Generate Reports

    Reports are generated based on parameters including mode, metrics, groupBy, and timeFrame. The report data is filtered and sorted using filterBy, orderBy, and orderType parameters.

    mode

    The value of mode can either be "event" or "request". By default, the value is set to "request"

    For more information on Request Mode Reporting, see here.

    metrics

    Data is collected for metric parameters and aggregated in columns requested in groupBy.

    Parameter

    Description

    impressions

    Aggregate of all impressions served

    clicks

    Aggregate of all clicks recorded

    costPerClick

    The average bid across the campaign/ad group/ad.

    CTR

    Click through rate across the campaign/ad group/ad

    adSpend

    Aggregate spend for all clicks recorded.

    conversions

    Aggregate of all downloads recorded.

    costPerConversion

    Cost per download calculated for the downloads recorded.

    BilledClicks

    Aggregate of all billed clicks.

    Note: Metrics will be aggregated for every unique combination of groupBy parameters.

    groupBy

    The groupBy parameters define data columns in the requested report.

    Parameter

    Description

    date

    Date when the data is aggregated

    account

    Name and Id of the account

    campaign

    The name and ID of the campaign.

    adGroup

    Name, ID, Landing Page and App Id of the ad-group.

    ad

    Name and ID of the ad.

    country

    Target country

    manufacturer

    Target manufacturers

    platform

    Target platforms

    adFormat

    Type of ad.

    adFormatGroup

    The ad format group to which the ad belongs.

    deviceType

    Specifies if the ad is shown on a smartphone or a tablet.

    Site

    Reporting by blinded site id, only for site inclusion ad groups.

    Concept

    Reporting based on concept Ids. Only for appographic targeted adgroups.

    Note: The request can contain the maximum possible combination of date, campaign, adGroup, ad, country, and location/manufacturer/platform/carrier. However, reports cannot be generated with a request containing the combination of location/manufacturer/platform/carrier alone.

    timeFrame

    The timeFrame parameter defines the date range for which the report is requested.

    The format to be used when requesting a report for a specific number of days is YYYY-MM-DD : YYYY-MM-DD.

    Note: timeFrame is mandatory for every report requested. If the timeFrame is not specified or is entered in an invalid format, the API will return an error response. For more information on the error, refer to the section Error Codes.

    If date is requested in groupBy, the granularity is applied as shown in the following matrix.

    Time Frame/Granularity

    Hourly

    Daily

    Monthly

    Quarterly

    Today

    Yesterday

    Last 7 Days

    Last 30 Days

    MTD

    Last Month

    QTD

    Last 3 Months

    Last 6 Months

    YTD

    filterBy

    The filterBy parameter defines the filters to be applied to generate the report. The list of filters and its comparators is given in the table below.

    Parameter

    Comparators

    Value Type

    accountId

    IN

    String

    accountName

    LIKE

    String

    campaignId

    IN

    String

    campaignName

    LIKE

    String

    adGroupId

    IN

    String

    adGroupName

    LIKE

    String

    adId

    IN

    String

    adName

    LIKE

    String

    country

    IN

    String

    manufacturer

    IN

    String

    platform

    IN

    String

    impressions

    <, >, <=, >=, <>

    Numeric

    clicks

    <, >, <=, >=, <>

    Numeric

    costPerClick

    <, >, <=, >=, <>

    Numeric

    CTR

    <, >, <=, >=, <>

    Numeric

    adSpend

    <, >, <=, >=, <>

    Numeric

    conversions

    <, >, <=, >=, <>

    Numeric

    costPerConversion

    <, >, <=, >=, <>

    Numeric

    adFormatId

    IN

    String

    adFormatGroupId

    IN

    String

    billedClicks

    <, >, <=, >=, <>

    Numeric

    orderBy and orderType

    Data can be sorted across multiple metrics and groupBy . Set the orderBy and orderType in the API request to sort the data in an order.

    orderType

    Parameter

    Ascending

    asc

    Descending

    desc

    Note: If data requested is large, you can paginate the response using length and offset in your request. For this case, please ensure that the orderby is done by date.

    Data Policy

    The API interprets the granularity based on:

    • groupBy
    • timeFrame

    Granularity Based on groupBy Columns

    Granularity for the groupBy columns is as shown in the table below:

    groupBy/ Granularity

    Hourly

    Daily

    Monthly

    date

    account

    campaign

    adGroup

    ad

    adFormat

    adFormatGroup

    country

    manufacturer

    carrier

    platform

    concept

    site

    Note: If no data is available for the requested parameters timeFrame and groupBy, this API will send a blank response.

    Granularity Based on timeFrame

    Granularity for timeFrame is as shown in the table below:

    Note: This granularity is applicable only if the columns in groupBy include the date parameter.

    Timeframe

    Granularity

    Auto Correction

    Today

    Hourly

    Current Hour

    Yesterday

    Hourly/Daily

    N.A.

    <= last 6 months

    Daily

    Today

    <= last 12 months

    Monthly

    Current Month

    Note: If your request overlaps any of the schedules in timeFrame, then the API returns the greater of the granularity applicable. Depending on the granularity, the timeFrame is auto corrected in the response. For example, if the data requested spans to the previous 5 months, then the response will be consolidated on a monthly basis. In addition, the response will exclude the current week’s data and auto-corrects the timeFrame to the previous week.

    It is recommended that the timeFrame sent in the API requests follow the specifications defined in the parameters required to Generated Reports section, to obtain accurate data.

    Register for InMobi Account

    You must first create an InMobi Account to be able to use the Advertiser Reporting features. If you do not have an InMobi Account, click here to register.

    Register an API Key

    To get started, you need to request for an API Key. InMobi issues the API Key on discretion. If you are interested in associating with InMobi, send a request to helpdesk@inmobi.com.

    Request a Valid Session

    Supported Formats: JSON/XML

    Description: A valid session is required to authenticate any API request. A session is valid for 24-hours from the time of issue. An API Key can be used to generate up to 15 valid sessions. If the number of valid sessions exceeds 15, a response is generated with an error code.

    URL: https://api-sandbox.inmobi.com/v1.0/generatesessio...

    Response

    Sample JSON

    		<code>
    {
    "error": false,
    "respList": [
    {
    "@xsi.type": "sessionObject",
    "accountId": "4028####2b18####012b####e676####",
    "sessionId": "aef7####6aec####8f81####d5b####"
    }
    ]
    }
    		

    Sample XML

    		<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <response>
    <error>false</error>
    <respListxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="sessionObject">
    <accountId>4028####2b18####012b####e676####</accountId>
    <sessionId> aef7####6aec####8f81####d5b####</sessionId>
    </respList>
    </response>
    		

    Sample APIs

    The following sections provide information on the various advertiser reporting APIs along with sample code snippets.

    Requesting a Report

    URL: https://api-sandbox.inmobi.com/v1.0/reporting/adve...

    Supported Formats: JSON/XML

    Sample JAVA Code Snippet

    		<code>
    public static void getAdvReport() {
    PostMethod method = new PostMethod("https://api.inmobi.com/v1.0/reporting/advertiser.json");
    String getReportJson = "{\"reportRequest\": {\"timeFrame\":\"2012-08-08:2012-08-10\",\"groupBy\":[\"campaign\",\"date\"],\"orderBy\":[\"date\"]}}";
    try {
    StringRequestEntityreqEntity = new StringRequestEntity(getReportJson, "application/json", "UTF-8");
    method.setRequestEntity(reqEntity);
    method.setRequestHeader("Content-Type", "application/json");
    method.setRequestHeader("accountId", "4028******676001c");
    method.setRequestHeader("secretKey", "7736*****c7cda534");
    method.setRequestHeader("sessionId", "89f22******1842ff");
    HttpClient client = new HttpClient();
    client.executeMethod(method);
    String response = method.getResponseBodyAsString();
    System.out.println(response);
    } catch (Exception e) {
    e.printStackTrace();
    } 
    }
    		

    Note: The getReportJson changes based on the parameters passed.

    JSON Structure

    		<code>
    {
    "reportRequest": 
    {
    "metrics": [
    <list of metrics>
    ],
    "groupBy": [
    <list of groupBy>
    ],
    "timeFrame": <start date:end date>,
    "orderBy": [
    <list of orderBy>
    ],
    "orderType": <asc/desc>
    }
    }
    		

    Sample JSON

    Request

    		<code>
    {
    "reportRequest": {
    "metrics": [
    "clicks",
    "costPerClick",
    "impressions",
    "adSpend",
    "CTR"
    ],
    "groupBy": [
    "date",
    "country",
    "manufacturer"
    ],
    "timeFrame": "2011-07-02:2011-09-13",
    "orderBy": [
    "clicks"
    ],
    "orderType": "desc"
    }
    }
    		

    Response

    		<code>
    {
    "error": false,
    "respList": [
    {
    "@xsi.type": "advertiserReportResponse",
    "adSpend": 0.02,
    "CTR": 1.69,
    "clicks": 6,
    "conversions": 0,
    "costPerClick": "0.00",
    "costPerConversion": "0.00",
    "country": "USA",
    "date": "2011-07-04 00:00:00",
    "impressions": 355,
    "manufacturer": "Huawei"
    },
    {
    "@xsi.type": "advertiserReportResponse",
    "adSpend": 0.01,
    "CTR": 1.52,
    "clicks": 3,
    "conversions": 0,
    "costPerClick": "0.00",
    "costPerConversion": "0.00",
    "country": "USA",
    "date": "2011-07-04 00:00:00",
    "impressions": 198,
    "manufacturer": "LG"
    }
    ]
    }
    		

    Sample XML

    		<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <response>
    <error>false</error>
    <respListxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="advertiserReportResponse">
    <adSpend>0.02</adSpend>
    <CTR>1.69</CTR>
    <clicks>6</clicks>
    <conversions>0</conversions>
    <costPerClick>0.00</costPerClick>
    <costPerConversion>0.00</costPerConversion>
    <country>USA</country>
    <date>2011-07-04 00:00:00</date>
    <impressions>355</impressions>
    <manufacturer>Huawei</manufacturer>
    </respList>
    <respListxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="advertiserReportResponse">
    <adSpend>0.01</adSpend>
    <CTR>1.52</CTR>
    <clicks>3</clicks>
    <conversions>0</conversions>
    <costPerClick>0.00</costPerClick>
    <costPerConversion>0.00</costPerConversion>
    <country>USA</country>
    <date>2011-07-04 00:00:00</date>
    <impressions>198</impressions>
    <manufacturer>LG</manufacturer>
    </respList>
    </response>
    		

    Use Case: Requesting a Report for the Last Three Days

    The following sample JSON helps you to request a report for the last three days.

    Request

    		<code>
    {
    "reportRequest": {
    "timeFrame": "2012-08-08:2012-08-10",
    "groupBy": [
    "campaign",
    "date"
    ],
    "orderBy": [
    "date"
    ]
    }
    }
    		

    Reponse

    		<code>
    {
    "error": false,
    "respList": [
    {
    "adSpend": 1.033,
    "CTR": 6.25,
    "campaignId": "40c5933****************bea6da0",
    "campaignName": "campaign-1",
    "clicks": 1,
    "conversions": 0,
    "costPerClick": 0.03,
    "costPerConversion": "0.00",
    "date": "2012-08-08 00:00:00",
    "impressions": 16
    },
    {
    "adSpend": 0.033,
    "CTR": 6.25,
    "campaignId": "40c5933****************bea6da0",
    "campaignName": "campaign-1",
    "clicks": 1,
    "conversions": 0,
    "costPerClick": 0.03,
    "costPerConversion": "0.00",
    "date": " 2012-08-09 00:00:00",
    "impressions": 16
    },
    {
    "adSpend": 0.72,
    "CTR": 1.86,
    "campaignId": "40c5933****************bea6da0",
    "campaignName": "campaign-1",
    "clicks": 1,
    "conversions": 0,
    "costPerClick": 0.03,
    "costPerConversion": "0.00",
    "date": " 2012-08-10 00:00:00",
    "impressions": 215
    }
    ]
    }
    		

    Use Case: Requesting a Report for the Last Three Months

    The following sample JSON helps you to request a report for the last three months.

    Request

    		<code>
    {
    "reportRequest": {
    "timeFrame": "2012-05-01:2012-08-01",
    "groupBy": [
    "campaign",
    "date"
    ],
    "orderBy": [
    "date"
    ]
    }
    }
    		

    Response

    		<code>
    {
    "error": false,
    "respList": [
    {
    "adSpend": 1.033,
    "CTR": 6.25,
    "campaignId": "40c5933****************bea6da0",
    "campaignName": "campaign-1",
    "clicks": 1,
    "conversions": 0,
    "costPerClick": 0.03,
    "costPerConversion": "0.00",
    "date": "2012-05-01 00:00:00",
    "impressions": 16
    },
    {
    "adSpend": 0.033,
    "CTR": 6.25,
    "campaignId": "40c5933****************bea6da0",
    "campaignName": "campaign-1",
    "clicks": 1,
    "conversions": 0,
    "costPerClick": 0.03,
    "costPerConversion": "0.00",
    "date": " 2012-05-01 00:00:00",
    "impressions": 16
    },
    {
    "adSpend": 0.72,
    "CTR": 1.86,
    "campaignId": "40c5933****************bea6da0",
    "campaignName": "campaign-1",
    "clicks": 1,
    "conversions": 0,
    "costPerClick": 0.03,
    "costPerConversion": "0.00",
    "date": " 2012-05-01 00:00:00",
    "impressions": 215
    }
    ]
    }
    		

    Use Case: Requesting a Report with Filters

    The following sample JSON helps you to request a report using filters.

    Request

    		<code>
    {
    "reportRequest": {
    "metrics": [
    "clicks",
    "costPerClick",
    "impressions",
    "adSpend",
    "CTR"
    ],
    "groupBy": [
    "date",
    "country",
    "manufacturer"
    ],
    "timeFrame": "2011-02-02:2011-04-13",
    "orderBy": [
    "clicks"
    ],
    "filterBy": [
    {
    "filterName": "clicks",
    "comparator": ">",
    "filterValue": [
    25
    ]
    },
    {
    "filterName": "campaignName",
    "comparator": "in",
    "filterValue": [
    "campaign-1"
    ]
    }
    ],
    "orderType": "desc"
    }
    }
    		

    Response

    		<code>
    {
    "error": false,
    "respList": [
    {
    "adSpend": "0.840",
    "CTR": 6.21,
    "clicks": 28,
    "costPerClick": 0.03,
    "country": "Azerbaijan",
    "date": "2011-04-01 00:00:00",
    "impressions": 451,
    "manufacturer": "Nokia"
    }
    ]
    }
    		

    Error Handling

    Any error encountered while processing an API request will cause a failure of the entire operation. The API caller has to take the responsibility of parsing the content of the response to handle errors while receiving an HTTP status code of 200 (OK).

    Sample JSON

    		<code>
    {
    "error":true,
    "errorList":[
    {
    "code":1004,
    "field":"error",
    "message":"API Key is mandatory",
    "msgKey":"secret.required.key",
    "name":"AUTH_SECRETKEY_REQUIRED"
    }
    ]
    }
    		

    Note: Test your code using the API Console.

    Sample XML

    		<code>
    <?xmlversion=”1.0”encoding=”UTF-..8”?>
    <response>
    <error>true</error>
    <errorList>
    <code>1004</code>
    <message>API Key is mandatory</message>
    <msgKey>secret.required.key</msgKey>
    <name>AUTH_SECRETKEY_REQUIRED</name>
    </errorList>
    </response>
    		

    The following sample code shows an error message when the timeFrame format is invalid.

    Sample Request

    		<code>
    {
    "reportRequest": {
    "timeFrame": "2012-08-18:2012-08-10",
    "groupBy": [
    "campaign",
    "date"
    ],
    "orderBy": [
    "date"
    ]
    }
    }
    		

    Sample Response

    		<code>
    {
    "error": true,
    "errorList": [
    {
    "code": 1017,
    "message": "Invalid Time frame"
    }
    ]
    }
    		

    Error Codes

    A list of error codes and their descriptions are given in the table below.

    Error Codes

    Description

    1000

    Unexpected error in publisher report.

    1001

    Username is invalid.

    1002

    Password is invalid.

    1003

    Account ID is invalid.

    1004

    API Key is invalid.

    1005

    Session ID is invalid.

    1007

    The request is exceeding the maximum number of outstanding sessions allowed per API Key.

    1008

    Authentication failed. The userName/password/secretKey sent is invalid.

    1009

    User is not permitted to perform the action.

    1010

    Session expired. Please try again with a new 'sessionId'.

    1012

    Invalid client request. Please ensure that the client request is properly formed.

    1013

    The request contains an unsupported 'metric'.

    1014

    The request contains an unsupported 'groupBy'.

    1015

    The request contains an unsupported 'orderBy'.

    1017

    Invalid 'timeFrame'. Please ensure that the 'timeFrame' is set properly in the request. Ensure that the timeFrame is defined in the format: YYYY-MM-DD: YYYY-MM-DD

    1021

    The requested service is not available.

    1023

    The request contains an unsupported 'orderType'.

    1024

    Invalid 'accountId'. Please ensure that the ‘accountId’ is set properly in the request.

    1025

    The request contains an unsupported 'filterBy'.

    1026

    Invalid ‘orderBy’. Please ensure that the ‘orderBy’ is set properly in the request.

    1027

    The request contains an invalid 'filterBy' on impressions. Ensure that the filter uses the supported comparators and value type.

    1028

    The request contains an invalid 'filterBy' on clicks. Ensure that the filter uses the supported comparators and value type.

    1029

    The request contains an invalid 'filterBy' on adSpend. Ensure that the filter uses the supported comparators and value type.

    1030

    The request contains an invalid 'filterBy' on costPerConversion. Ensure that the filter uses the supported comparators and value type.

    1031

    The request contains an invalid 'filterBy' on conversions. Ensure that the filter uses the supported comparators and value type.

    1032

    The request contains an invalid 'filterBy' on costPerClick. Ensure that the filter uses the supported comparators and value type.

    1033

    The request contains an invalid 'filterBy' on CTR. Ensure that the filter uses the supported comparators and value type.

    1034

    ‘filterBy’ on impressions is not set properly

    1035

    ‘filterBy’ on click is not set properly.

    1036

    ‘filterBy’ on adSpend is not set properly.

    1037

    ‘filterBy’ on costPerConversion is not set properly.

    1038

    ‘filterBy’ on conversions is not set properly.

    1039

    ‘filterBy’ on costPerClick is not set properly.

    1040

    ‘filterBy’ on CTR is not set properly.

    1041

    The request contains an invalid 'filterBy'.

    3001

    Ensure that the country codes in the request are correct.

    3002

    Ensure that the locations in the request are correct.

    3003

    Ensure that the manufacturers in the request are correct.

    3004

    Ensure that the platforms in the request are correct.

    5001

    No results were found for the requested report.

    5002

    Invalid date format. Ensure that the date is defined in the format: YYYY-MM-DD

    ko-help-articles | Terminology

    This section explains the terms used across the document:

    1. Campaign - Entity where the budget for a particular group of creatives is stored.

    2. Adgroup - Entity where ad restrictions like duration (how long a group of creatives needs to burn), targeting, and pricing, needs to be set.

      Note : A campaign may contain multiple adgroups. You can split the budget across multiple targets. Just specify the upper limit of spend for each of them.

    3. Creative - The smallest entity in an adgroup where ad restrictions like duration (how long a group of creatives needs to burn), targeting, and pricing, needs to be set.

      Note : An adgroup may contain multiple creatives. You may want two different images for a creative and still want to target the same set of users. In this case, you can create two different creatives under the same adgroup.

    4. Asset - The image or video which needs to be added to a creative.

      Note : You need to create an asset before calling the ad API. The API needs the created assetId to identify the asset you are trying to add. This enables you to reuse an uploaded asset instead of uploading the asset again.

    5. Metadata - The general mapping data like Country Id-Name and Manufacturer.

      Note : All APIs which accept Ids, need to pass this information by calling the respective metadata APIs.

    ko-help-articles | Getting Started - Partners

    This section helps you to create a Partner account. It has the following topics:

    Workflow

    The account creation process is illustrated here:

    Creating a Partner Account

    Start by creating a partner account. Go to InMobi Portal and click Sign Up. Register an username and password for the partner account.

    Verifying Email

    You will receive a verification link on your registered email address. Click the link to complete the registration.

    Signing In

    Go to InMobi Portal and click Sign In. Provide the registered username-password combination.

    Creating a Sub-account

    Create a sub-account as an advertiser. The process is illustrated here:

    API Key

    After signing in, contact the InMobi Support team for the API key.

    ko-help-articles | Getting Started - Advertiser

    This section helps you to create a Advertiser account. It has the following topics:

    Workflow

    The account creation process is illustrated here:

    Creating an Advertiser Account

    Start by creating an advertiser account. Go to InMobi Portal and click Sign Up. Register an username and password for the advertiser account.

    Generating API Key

    You will receive a verification email in your registered email address. It will contain the API key in a password-protected pdf. Your registered username will be the password for opening the pdf.

    Signing In

    Go to InMobi Portal and click Sign In. Provide the registered username-password combination.

    ko-help-articles | Getting Started

    ko-help-articles | Reporting API

    ko-help-articles | Unity

    ko-help-articles | Mobile Web

    ko-help-articles | Using the API

    After you have received the API key, this section helps you to generate sessions and make API calls. It has the following topics:

    Workflow

    The API calling process is illustrated here:

    Points to Remember

    The following points are applicable for all API calls:

    1. Generating a Session Key – The session key is valid for 24 hours since the session generation call was made.
    2. Passing the General Headers – After generating the sessionId, every API call (except session generation call) needs to send the following information.
      Header Name Description Mandatory/Optional Example
      accountId Account id of the user for which the request is being made Mandatory 5a5f7a5b94e441a8b0eeef9b301eb7bd
      secretKey The API key you received from InMobi after account activation Mandatory d32ad3e3ff612342bfb5m28seecebf9a
      sessionId The session id you received after making the session generation call. Mandatory 79a30e4cab6549d7af9e7a34b93e6e97
    3. Sample Error Response Code

    Generating a Session

    This API is used to generate a sessionId.

    Remember the following:

    1. You need a valid sessionId to make API calls.
    2. Along with HTTP StatusCode 200, the error response code will also have a response body containing error. This happens only for this API.

    Sample Error Response Code

     {
          "respList": [],
          "error": true,
          "errorList": [
              {
                  "code": "1009",
                  "message": "User is not permitted to perform the action"
              }
          ]
         }
    			

    Making the API Call

    Use the following details to make the call:

    1. URL - https://api.inmobi.com/v1.0/generatesession/generate
    2. Headers
      Header Name Description Mandatory/Optional Example
      secretKey The API key you received from InMobi after account activation Mandatory d32ad3e3ff612342bfb5m28seecebf9a
      username The username you chose while signing up Mandatory kishore.bandi@inmobi.com
      password The password you chose while signing up Mandatory Test@Password1234
     {
        "respList": [
            {
                "sessionId": "79a30e4cab6549d7af9e7a34b93e6e97",
                "accountId": "5a5f7a5b94e441a8b0eeef9b301eb7bd",
                "subAccounts": null
            }
        ],
        "error": false,
        "errorList": []
    }
    				
     curl -X GET \
      https://api.inmobi.com/v1.0/generatesession/generate \
      -H 'password: Test@Password1234' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'username: kishore.bandi@inmobi.com'
    				

    Interpreting the Response

    Use the following scenarios to determine if the call was successful:

    Making Other API Calls

    The other API calls can be classified into the following types:

    App-based API Calls

    These API calls are made to promote an app. They can be classified in the following types:

    Account

    JSON schema for Account

    {
              "$schema": "http://json-schema.org/draft-06/schema",
              "type" : "object",
              "properties" : {
                "accountId" : {
                  "description" : "Account Id ",
                  "type" : "string"
                },
                "name" : {
                  "description" : "Name of the account",
                  "type" : "string"
                },
                "status" : {
                  "description" : "Status of the account",
                  "type" : "string",
                  "enum" : [ "ACTIVE", "BLOCKED", "ACTIVATION_PENDING" ]
                },
                "balance" : {
                  "description" : "Balance available in the account",
                  "type" : "number"
                }
              }
            }
    	

    Use the following APIs for account-related information:

    1. Get Account - This API is used to fetch details about the account.
    {
      "accountId": "5a5f7a5b94e441a8b0eeef9b301eb7bd",
      "name": "kishore.bandi@inmobi.com",
      "status": "ACTIVE",
      "balance": 1000
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/account \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    App

    JSON schema for App

    Use the following APIs for app-related information:

    1. DUMMY APP - DUMMY
    DUMMY
    			
    DUMMY
    			
    Campaign

    JSON schema for Campaign

    {
                 "$schema": "http://json-schema.org/draft-06/schema",
                 "title": "Campaign Object",
                 "type" : "object",
                 "properties" : {
                   "objective" : {
                     "type" : "string",
                     "enum" : [ "PROMOTE_CONTENT" ]
                   },
                   "name" : {
                     "type" : "string"
                   },
                   "startTime" : {
                     "type" : "string",
                     "description" : "The Start date String in ISO-8601 Standards",
                     "example" : "2017-06-06T00:00:00"
                   },
                   "endTime" : {
                     "type" : "string",
                     "description" : "The End date String in ISO-8601 Standards",
                     "example" : "2017-07-05T23:59:59"
                   },
                   "campaignBudget" : {
                     "type" : "object",
                     "properties" : {
                       "budgetType" : {
                         "type" : "string",
                         "description" : "Account - The campaign will start burning from account and the money will not be transfered/dedicated separately for the campaign. Campaign - The selected amount will be transfered from account to campaign and the burn for the campaign will happen from this amount.",
                         "enum" : [ "ACCOUNT", "CAMPAIGN" ]
                       },
                       "totalBudget" : {
                         "type" : "number",
                         "description" : "Amount in Dollars",
                         "minimum": 0,
                         "maximum": 10000000
                       },
                       "dailyLimit" : {
                         "type" : "number",
                         "description" : "Amount in Dollars",
                         "minimum": 0,
                         "maximum": 10000000
                       }
                     },
                     "required" : [ "budgetType" ]
                   },
                   "frequencyCaps" : {
                     "type" : "array",
                     "items" : {
                       "type" : "object",
                       "properties" : {
                         "type" : {
                           "type" : "string",
                           "enum" : [ "RENDER", "CLICK", "VIDEO_COMPLETE" ]
                         },
                         "limit" : {
                           "type" : "integer",
                           "description" : "The max. limit (number of times) to target a user",
                           "maximum": 129600
                         },
                         "duration" : {
                           "type" : "integer",
                           "description" : "The Duration in minutes",
                           "maximum": 100
                         }
                       },
                       "required" : [ "type" ]
                     }
                   },
                   "campaignId" : {
                     "type" : "string",
                     "description" : "Response Only Field - Will not be honored in Request"
                   },
                   "status" : {
                     "type" : "string",
                     "description" : "Response Only Field - Will not be honored in Request",
                     "enum" : [ "DRAFT", "ACTIVE", "PAUSED", "EXPIRED", "PENDING", "REJECTED", "ARCHIVED", "ON_HOLD" ]
                   },
                   "balance" : {
                     "type" : "number",
                     "description" : "Response Only Field - Will not be honored in Request"
                   },
                   "createdOn" : {
                     "type" : "string",
                     "description" : "Response Only Field - The Create date String in ISO-8601 Standards",
                     "example" : "2017-07-05T23:59:59"
                   },
                   "lastModifiedOn" : {
                     "type" : "string",
                     "description" : "Response Only Field - The Last Modified date String in ISO-8601 Standards",
                     "example" : "2017-07-05T23:59:59"
                   },
                   "lastModifiedBy" : {
                     "type" : "string",
                     "description" : "Response Only Field - The Last Modified user"
                   }
                 },
                 "required" : [ "objective", "name", "startTime", "endTime", "campaignBudget" ]
               }
    	

    Use the following APIs for campaign-related information:

    1. Create Campaign - This API is used to create a campaign.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "InMobiAPITest",
        "startTime": "2017-06-06T00:00:00",
        "endTime": "2017-07-05T23:59:59",
        "campaignBudget": {
            "budgetType": "CAMPAIGN",
            "totalBudget": 10000,
            "dailyLimit": 500
        },
        "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
        "status": "ACTIVE",
        "balance": 0,
        "createdOn": "2017-06-06T09:21:12",
        "lastModifiedOn": "2017-06-06T09:21:12",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/campaigns \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
      "objective": "PROMOTE_CONTENT",
      "name": "InMobiAPITest",
      "startTime": "2017-06-08T00:00:00",
      "endTime": "2017-07-05T23:59:59.999",
      "campaignBudget": {
        "budgetType": "CAMPAIGN",
        "totalBudget": 10000.0,
        "dailyLimit": 500.0
      }
    }
    			
    1. Fetch Campaign - This API is used to fetch the details of campaigns under an account.
    {
        "limit": 0,
        "offset": 0,
        "items": [
            {
                "objective": "PROMOTE_CONTENT",
                "name": "InMobiAPITest",
                "startTime": "2017-06-06T00:00:00",
                "endTime": "2017-07-05T23:59:59",
                "campaignBudget": {
                    "budgetType": "CAMPAIGN",
                    "totalBudget": 10000,
                    "dailyLimit": 500
                },
                "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
                "status": "ACTIVE",
                "balance": 0,
                "createdOn": "2017-06-06T09:21:12",
                "lastModifiedOn": "2017-06-06T09:21:12",
                "lastModifiedBy": "kishore.bandi@inmobi.com"
            }
        ]
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/campaigns \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d'
    			
    1. Update CampaignId - This API is used to update the details of campaigns under a specific campaignId and an accountId.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "InMobiAPITest",
        "startTime": "2017-06-06T00:00:00",
        "endTime": "2017-07-06T23:59:59",
        "campaignBudget": {
            "budgetType": "CAMPAIGN",
            "totalBudget": 100,
            "dailyLimit": 500
        },
        "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
        "status": "ACTIVE",
        "balance": 0,
        "createdOn": "2017-06-06T09:21:12",
        "lastModifiedOn": "2017-06-06T10:27:42",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/campaigns/ed0f7a5ae279435ea7f0c4f35147ad87 \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
              "objective": "PROMOTE_CONTENT",
              "name": "InMobiAPITest1",
              "startTime": "2017-06-08T00:00:00",
              "endTime": "2017-07-05T23:59:59",
              "campaignBudget": {
                  "budgetType": "CAMPAIGN",
                  "totalBudget": 10000,
                  "dailyLimit": 500
              }
          }'
    			
    1. Fetch CampaignId - This API is used to fetch the details of campaigns under a specific campaignId and an accountId.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "InMobiAPITest",
        "startTime": "2017-06-06T00:00:00",
        "endTime": "2017-07-06T23:59:59",
        "campaignBudget": {
            "budgetType": "CAMPAIGN",
            "totalBudget": 100,
            "dailyLimit": 500
        },
        "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
        "status": "ACTIVE",
        "balance": 0,
        "createdOn": "2017-06-06T09:21:12",
        "lastModifiedOn": "2017-06-06T10:27:42",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/campaigns/ed0f7a5ae279435ea7f0c4f35147ad87 \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d'
    			
    1. Fetch Adgroups under CampaignId - This API is used to fetch adgroups under a specific campaignId and an accountId
      • URL - https://api.inmobi.com/rso/campaigns/{campaignId}/adgroups
      • Headers - Refer to Passing the General Headers section.
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Example
        CampaignId The campaignId whose details needs to be updated Mandatory DUMMY
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Example
        pageNum The page number from where the list needs to be retrieved Optional 5
        maxRecords The maximum number of records to be retrieved from the selected page Optional 57
      • HTTP Method - GET
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "limit": 1,
        "offset": 1,
        "items": [
            {
                "name": "InMobiAPITestAdGroup1",
                "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
                "startTime": "2017-06-09T00:00:00",
                "endTime": "2017-07-05T23:59:59",
                "status": "PENDING",
                "clickDestination": "https://www.inmobi.com/",
                "adGroupId": "a59e83f1605d4c078347da495002d1c6",
                "clickAction": "URL",
                "objective": "PROMOTE_CONTENT",
                "targeting": {
                    "geoTargeting": {
                        "geoTargetingDetails": [
                            {
                                "countryId": 94
                            }
                        ]
                    },
                    "deviceTargeting": {
                        "deviceTypeList": [
                            "SMART_PHONE",
                            "TABLET"
                        ]
                    },
                    "scheduleTargeting": {
                        "schedules": [
                            {
                                "dayOfWeek": "SUNDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "MONDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "TUESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "WEDNESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "THURSDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "FRIDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "SATURDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            }
                        ]
                    }
                },
                "pricing": {
                    "priceType": "CPC",
                    "bidValue": 1.45,
                    "dailySpendLimit": 1000
                },
                "createdOn": "2017-06-09T08:43:08",
                "lastModifiedOn": "2017-06-09T08:45:09",
                "lastModifiedBy": "M10N"
            }
        ]
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/campaigns/ed0f7a5ae279435ea7f0c4f35147ad87/adgroups \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Fetch Creatives under CampaignId - This API is used to fetch creatives under a specific campaignId and an accountId
      • URL - https://api.inmobi.com/rso/campaigns/{campaignId}/ads
      • Headers - Refer to Passing the General Headers section.
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Example
        CampaignId The campaignId whose details needs to be updated Mandatory DUMMY
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Example
        pageNum The page number from where the list needs to be retrieved Optional 5
        maxRecords The maximum number of records to be retrieved from the selected page Optional 57
      • HTTP Method - GET
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "limit": 1,
        "offset": 1,
        "items": [
            {
                "name": "InMobiAPITestBannerAd1",
                "adGroupId": "a59e83f1605d4c078347da495002d1c6",
                "adId": "225e28ad52a845dea7d8b08ce7d6b819",
                "status": "PENDING",
                "adFormat": "BANNER",
                "trackingCodes": [],
                "landingUrl": "https://www.inmobi.com/rso",
                "imageAsset": {
                    "url": "http://i.l.inmobicdn.net/banners/FileData/36ca3863a6a24a6f8d9a92016c796c68.jpeg",
                    "assetId": 2320981
                },
                "lastModifiedOn": "2017-06-12T12:11:13"
            }
        ]
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/campaigns/ed0f7a5ae279435ea7f0c4f35147ad87/ads \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Archive CampaignId - This API is used to archive (soft delete) the details of campaigns under a specific campaignId and an accountId.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "Test1",
        "startTime": "2017-06-12T00:00:00",
        "endTime": "2017-07-05T23:59:59",
        "campaignBudget": {
            "budgetType": "ACCOUNT",
            "totalBudget": 0,
            "dailyLimit": 500
        },
        "campaignId": "dcb989192e8347888917c8babf704df3",
        "status": "ARCHIVED",
        "balance": 0,
        "createdOn": "2017-06-12T10:03:08",
        "lastModifiedOn": "2017-06-12T10:03:52",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X DELETE \
      https://api.inmobi.com/rso/campaigns/dcb989192e8347888917c8babf704df3 \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Reactivate Campaign - This API is used to reactivate a campaign after it has expired.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "InMobiAPITest",
        "startTime": "2017-06-06T00:00:00",
        "endTime": "2017-07-11T23:59:59",
        "campaignBudget": {
            "budgetType": "CAMPAIGN",
            "totalBudget": 100,
            "dailyLimit": 500
        },
        "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
        "status": "ARCHIVED",
        "balance": 0,
        "createdOn": "2017-06-06T09:21:12",
        "lastModifiedOn": "2017-06-06T10:27:42",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
    https://api.inmobi.com/rso/campaigns/ed0f7a5ae279435ea7f0c4f35147ad87/reactivate \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
            "endDate" : "2017-07-11T23:59:59"
          }'
    			
    1. Deallocate Campaign - This API is used to transfer the money allocated to this campaign back to the account. The budget type should be Campaign.
    {
      "Valid" : "true"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/campaigns/dcb989192e8347888917c8babf704df3/deallocate \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Change Campaign Status - This API is used to change the status of a campaign. It can be used to pause a running campaign, activate a paused campaign, and archive a campaign, among others.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "InMobiAPITest",
        "startTime": "2017-06-06T00:00:00",
        "endTime": "2017-07-06T23:59:59",
        "campaignBudget": {
            "budgetType": "CAMPAIGN",
            "totalBudget": 100,
            "dailyLimit": 500
        },
        "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
        "status": "PAUSED",
        "balance": 0,
        "createdOn": "2017-06-06T09:21:12",
        "lastModifiedOn": "2017-06-06T10:27:42",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/campaigns/status \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
          	"entityId" : "ed0f7a5ae279435ea7f0c4f35147ad87",
          	"newStatus" : "PAUSED"
          }'
    			
    Adgroup

    JSON schema for Adgroup

    {
                    "$schema": "http://json-schema.org/draft-06/schema",
                    "type": "object",
                    "properties": {
                    "name": {
                    	"type": "string",
                    	"description": "Name of the Ad Group"
                    },
                    "campaignId": {
                    	"type": "string",
                    	"description": "Campaign Id under which this Ad Group needs to be created"
                    },
                    "startTime": {
                    	"type": "string",
                    	"description": "Date in string using ISO-8601 Standard"
                    },
                    "endTime": {
                    	"type": "string",
                    	"description": "Date in string using ISO-8601 Standard"
                    },
                    "status": {
                    	"type": "string",
                    	"description": "Response Only Field - Date in string using ISO-8601 Standard",
                    	"enum": [
                    		"DRAFT",
                    		"ACTIVE",
                    		"PAUSED",
                    		"EXPIRED",
                    		"PENDING",
                    		"REJECTED",
                    		"ARCHIVED",
                    		"ON_HOLD"
                    	]
                    },
                    "clickDestination": {
                    	"type": "string",
                    	"description": "The Final Page which needs to be displayed when user clicks on the Ad"
                    },
                    "adGroupId": {
                    	"type": "string",
                    	"description": "Response Only Field"
                    },
                    "clickAction": {
                    	"type": "string",
                    	"enum": [
                    		"URL"
                    	]
                    },
                    "objective": {
                    	"type": "string",
                    	"description": "Response Only Field - Derived from Campaign",
                    	"enum": [
                    		"PROMOTE_CONTENT"
                    	]
                    },
                    "targeting": {
                    	"type": "object",
                    	"description": "Targeting Information of the corresponding AdGroup",
                    	"properties": {
                    		"geoTargeting": {
                    			"type": "object",
                    			"properties": {
                    				"geoTargetingDetails": {
                    					"type": "array",
                    					"items": {
                    						"type": "object",
                    						"description": "Geo Targeting Information of the corresponding AdGroup",
                    						"properties": {
                    							"countryId": {
                    								"type": "integer",
                    								"description": "Country Id which needs to be Targeted"
                    							},
                    							"stateIds": {
                    								"type": "array",
                    								"items": {
                    									"type": "integer"
                    								},
                    								"description": "State Id which needs to be Targeted"
                    							},
                    							"cityIds": {
                    								"type": "array",
                    								"items": {
                    									"type": "integer"
                    								},
                    								"description": "City Id which needs to be Targeted"
                    							},
                    							"zipIds": {
                    								"type": "array",
                    								"description": "Zips Id which needs to be Targeted",
                    								"items": {
                    									"type": "integer"
                    								}
                    							},
                    							"carrierIds": {
                    								"type": "array",
                    								"description": "Carrier Id which needs to be Targeted",
                    								"items": {
                    									"type": "integer"
                    								}
                    							},
                    							"latLongList": {
                    								"type": "array",
                    								"items": {
                    									"type": "object",
                    									"description": "Lat-Long based targeting",
                    									"properties": {
                    										"name": {
                    											"type": "string"
                    										},
                    										"latitude": {
                    											"type": "number",
                    											"minimum": -90,
                    											"maximum": 90
                    										},
                    										"longitude": {
                    											"type": "number",
                    											"minimum": -180,
                    											"maximum": 180
                    										},
                    										"radius": {
                    											"type": "number",
                    											"minimum": 0
                    										}
                    									},
                    									"required": ["name", "latitude", "longitude", "radius"]
                    								}
                    							},
                    							"required": ["countryId"]
                    						}
                    					}
                    				}
                    			},
                    			"deviceTargeting": {
                    				"type": "object",
                    				"properties": {
                    					"handsetTargetingList": {
                    						"type": "array",
                    						"items": {
                    							"type": "object",
                    							"properties": {
                    								"manufacturerId": {
                    									"type": "integer",
                    									"description": "The ManufacturerId that needs to be included/excluded"
                    								},
                    								"handsetIdList": {
                    									"type": "array",
                    									"description": "List of Handset Ids that needs to be included/excluded",
                    									"items": {
                    										"type": "integer"
                    									}
                    								},
                    								"exclude": {
                    									"type": "boolean",
                    									"description": "Indicates if the selected targeting needs to be included or excluded. Default - false"
                    								}
                    							},
                    							"required": ["manufacturerId"]
                    						}
                    					},
                    					"deviceTypeList": {
                    						"type": "array",
                    						"description": "What type of devices needs to be selected for Targeting. Default - ALL",
                    						"items": {
                    							"type": "string",
                    							"enum": [
                    								"SMART_PHONE",
                    								"TABLET"
                    							]
                    						}
                    					},
                    					"ostargetingList": {
                    						"type": "array",
                    						"description": "Target based on User's Operating System",
                    						"items": {
                    							"type": "object",
                    							"properties": {
                    								"osId": {
                    									"type": "integer",
                    									"description": "OS Id that needs to be included"
                    								},
                    								"minVersion": {
                    									"type": "number",
                    									"description": "Minimum version of the OS that needs to be targeted"
                    								},
                    								"maxVersion": {
                    									"type": "number",
                    									"description": "Maximum version of the OS that needs to be targeted"
                    								},
                    								"exclude": {
                    									"type": "boolean",
                    									"description": "Indicates if the selected targeting needs to be included or excluded. Default - false"
                    								}
                    							},
                    							"required": ["osId"]
                    						}
                    					}
                    				}
                    			},
                    			"userTargeting": {
                    				"type": "object",
                    				"description": "The Segments retrieved must be set in this list of lists using CNF form.
                                                          Note : The more segments residing inside AND notation in CNF notation, the lesser would be the reach of Users.
                                                          Example : If we want to target all users who are either Shopping Enthusiasts or Business Professional or Technology Enthusiasts but definetely have to be a Cab Riders then the input would be [["Shopping","Business","Technology"],["Cab Riders"]]
                                                          (Of Course, the values here need to be segment Ids)",
                    				"properties": {
                    					"segmentIds": {
                    						"type": "array",
                    						"example": "",
                    						"items": {
                    							"type": "array",
                    							"items": {
                    								"type": "integer"
                    							}
                    						}
                    					}
                    				},
                    				"required": ["segmentIds"]
                    			},
                    			"scheduleTargeting": {
                    				"type": "object",
                    				"description": "Target based on Time",
                    				"properties": {
                    					"schedules": {
                    						"type": "array",
                    						"items": {
                    							"type": "object",
                    							"properties": {
                    								"dayOfWeek": {
                    									"type": "string",
                    									"enum": [
                    										"MONDAY",
                    										"TUESDAY",
                    										"WEDNESDAY",
                    										"THURSDAY",
                    										"FRIDAY",
                    										"SATURDAY",
                    										"SUNDAY"
                    									]
                    								},
                    								"ranges": {
                    									"type": "array",
                    									"items": {
                    										"type": "object",
                    										"properties": {
                    											"start": {
                    												"type": "integer",
                    												"description": "Start hour from when the AdGroup Should be selected for targeting in a day",
                    												"minimum": 0,
                    												"maximum": 23
                    											},
                    											"end": {
                    												"type": "integer",
                    												"description": "End hour till when the AdGroup Should be selected for targeting in a day",
                    												"minimum": 0,
                    												"maximum": 23
                    											}
                    										},
                    										"required": ["start", "end"]
                    									}
                    								}
                    							},
                    							"required": ["dayOfWeek", "ranges"]
                    						},
                    						"maxRecords": "7"
                    					}
                    				}
                    			}
                    		}
                    	},
                    	"pricing": {
                    		"type": "object",
                    		"description": "Pricing related information of an Ad Group",
                    		"properties": {
                    			"priceType": {
                    				"type": "string",
                    				"enum": [
                    					"CPC",
                    					"CPM",
                    					"VCPM"
                    				]
                    			},
                    			"bidValue": {
                    				"type": "number",
                    				"minimum": 0
                    			},
                    			"dailySpendLimit": {
                    				"type": "number"
                    			}
                    		},
                    		"required": ["priceType", "bidValue"]
                    	},
                    	"frequencyCaps": {
                    		"type": "array",
                    		"items": {
                    			"type": "object",
                    			"properties": {
                    				"type": {
                    					"type": "string",
                    					"enum": [
                    						"RENDER",
                    						"CLICK",
                    						"VIDEO_COMPLETE"
                    					]
                    				},
                    				"limit": {
                    					"type": "integer",
                    					"description": "The max. limit (number of times) to target a user",
                    					"maximum": 129600
                    				},
                    				"duration": {
                    					"type": "integer",
                    					"description": "The Duration in minutes",
                    					"maximum": 100
                    				}
                    			},
                    			"required": ["type"]
                    		}
                    	},
                    	"createdOn": {
                    		"type": "string",
                    		"description": "Response Only Field - The Create date String in ISO-8601 Standards",
                    		"example": "2017-07-05T23:59:59"
                    	},
                    	"lastModifiedOn": {
                    		"type": "string",
                    		"description": "Response Only Field - The Create date String in ISO-8601 Standards",
                    		"example": "2017-07-05T23:59:59"
                    	},
                    	"lastModifiedBy": {
                    		"type": "string",
                    		"description": "Response Only Field - The Last Modified user"
                    	}
                    },
                    "required": ["name", "campaignId", "startTime", "clickDestination", "pricing"]
                    }
                    }
    	

    Use the following APIs for adgroup-related information:

    1. Create Adgroup - This API is used to create an adgroup
    {
      "name": "InMobiAPITestAdGroup1",
      "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
      "startTime": "2017-06-09T00:00:00",
      "endTime": "2017-07-05T23:59:59",
      "status": "PENDING",
      "clickDestination": "https://www.inmobi.com/",
      "adGroupId": "a59e83f1605d4c078347da495002d1c6",
      "clickAction": "URL",
      "objective": "PROMOTE_CONTENT",
      "targeting": {
        "geoTargeting": {
          "geoTargetingDetails": [
            {
              "countryId": 94
            }
          ]
        },
        "deviceTargeting": {
          "deviceTypeList": [
            "SMART_PHONE",
            "TABLET"
          ]
        },
        "scheduleTargeting": {
          "schedules": [
            {
              "dayOfWeek": "SUNDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "MONDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "TUESDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "WEDNESDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "THURSDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "FRIDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "SATURDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            }
          ]
        }
      },
      "pricing": {
        "priceType": "CPC",
        "bidValue": 1.45,
        "dailySpendLimit": 1000
      },
      "createdOn": "2017-06-09T08:43:08",
      "lastModifiedOn": "2017-06-09T08:43:08",
      "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/adgroups \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
      "name": "InMobiAPITestAdGroup1",
      "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
      "startTime": "2017-06-09T00:00:00",
      "clickDestination": "https://www.inmobi.com/",
      "clickAction": "URL",
      "targeting": {
        "geoTargeting": {
          "geoTargetingDetails": [
            {
              "countryId": 94
            }
          ]
        },
        "deviceTargeting": {
          "deviceTypeList": [
            "SMART_PHONE",
            "TABLET"
          ]
        }
      },
      "pricing": {
        "priceType": "CPC",
        "bidValue": 1.45,
        "dailySpendLimit": 1000.0
      }
    }'
    			
    1. Get Adgroup - This API is used to get details of an adgroup
    {
        "limit": 1,
        "offset": 1,
        "items": [
            {
                "name": "InMobiAPITestAdGroup1",
                "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
                "startTime": "2017-06-09T00:00:00",
                "endTime": "2017-07-05T23:59:59",
                "status": "PENDING",
                "clickDestination": "https://www.inmobi.com/",
                "adGroupId": "a59e83f1605d4c078347da495002d1c6",
                "clickAction": "URL",
                "objective": "PROMOTE_CONTENT",
                "targeting": {
                    "geoTargeting": {
                        "geoTargetingDetails": [
                            {
                                "countryId": 94
                            }
                        ]
                    },
                    "deviceTargeting": {
                        "deviceTypeList": [
                            "SMART_PHONE",
                            "TABLET"
                        ]
                    },
                    "scheduleTargeting": {
                        "schedules": [
                            {
                                "dayOfWeek": "SUNDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "MONDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "TUESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "WEDNESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "THURSDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "FRIDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "SATURDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            }
                        ]
                    }
                },
                "pricing": {
                    "priceType": "CPC",
                    "bidValue": 1.45,
                    "dailySpendLimit": 1000
                },
                "createdOn": "2017-06-09T08:43:08",
                "lastModifiedOn": "2017-06-09T08:45:09",
                "lastModifiedBy": "M10N"
            }
        ]
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/adgroups \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d'
    			
    1. Get Adgroup - This API is used to get details of an adgroup
      • URL - https://api.inmobi.com/rso/adgroups
      • Headers - Refer to Passing the General Headers section.
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Example
        AdgroupId The adgroupId whose details needs to be updated Mandatory DUMMY
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Example
        pageNum The page number from where the list needs to be retrieved Optional 5
        maxRecords The maximum number of records to be retrieved from the selected page Optional 57
      • HTTP Method - POST
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "name": "InMobiAPITestAdGroup1",
        "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
        "startTime": "2017-06-09T00:00:00",
        "endTime": "2017-07-04T23:59:59",
        "status": "PENDING",
        "clickDestination": "https://www.inmobi.com/",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "geoTargeting": {
                "geoTargetingDetails": [
                    {
                        "countryId": 94
                    }
                ]
            },
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 1.45,
            "dailySpendLimit": 1000
        },
        "createdOn": "2017-06-09T08:43:08",
        "lastModifiedOn": "2017-06-11T18:33:46",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/adgroups/a59e83f1605d4c078347da495002d1c6/ \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -d '{
                "name": "InMobiAPITestAdGroup1",
                "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
                "startTime": "2017-06-09T00:00:00",
                "endTime": "2017-07-04T23:59:59",
                "status": "PENDING",
                "clickDestination": "https://www.inmobi.com/",
                "adGroupId": "a59e83f1605d4c078347da495002d1c6",
                "clickAction": "URL",
                "objective": "PROMOTE_CONTENT",
                "targeting": {
                    "geoTargeting": {
                        "geoTargetingDetails": [
                            {
                                "countryId": 94
                            }
                        ]
                    },
                    "deviceTargeting": {
                        "deviceTypeList": [
                            "SMART_PHONE",
                            "TABLET"
                        ]
                    },
                    "scheduleTargeting": {
                        "schedules": [
                            {
                                "dayOfWeek": "SUNDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "MONDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "TUESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "WEDNESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "THURSDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "FRIDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "SATURDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            }
                        ]
                    }
                },
                "pricing": {
                    "priceType": "CPC",
                    "bidValue": 1.45,
                    "dailySpendLimit": 1000
                },
                "createdOn": "2017-06-09T08:43:08",
                "lastModifiedOn": "2017-06-09T08:45:09",
                "lastModifiedBy": "M10N"
            }'
    			
    1. Fetch AdgroupId - This API is used to fetch details of an adgroup under a specific adgroupId and a campaignId
    {
        "name": "InMobiAPITestAdGroup1",
        "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
        "startTime": "2017-06-09T00:00:00",
        "endTime": "2017-07-04T23:59:59",
        "status": "PENDING",
        "clickDestination": "https://www.inmobi.com/",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "geoTargeting": {
                "geoTargetingDetails": [
                    {
                        "countryId": 94
                    }
                ]
            },
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 1.45,
            "dailySpendLimit": 1000
        },
        "createdOn": "2017-06-09T08:43:08",
        "lastModifiedOn": "2017-06-11T18:33:46",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/adgroups/a59e83f1605d4c078347da495002d1c6 \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d'
    			
    1. Archive AdgroupId - This API is used to archive (soft delete) details of an adgroup under a specific adgroupId.
    {
        "name": "InMobiAPITestAdGroup1",
        "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
        "startTime": "2017-06-09T00:00:00",
        "endTime": "2017-07-04T23:59:59",
        "status": "ARCHIVED",
        "clickDestination": "https://www.inmobi.com/",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "geoTargeting": {
                "geoTargetingDetails": [
                    {
                        "countryId": 94
                    }
                ]
            },
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 1.45,
            "dailySpendLimit": 1000
        },
        "createdOn": "2017-06-09T08:43:08",
        "lastModifiedOn": "2017-06-11T18:33:46",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X DELETE \
      https://api.inmobi.com/rso/adgroups/a59e83f1605d4c078347da495002d1c6/ \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Fetch Creatives from an AdgroupId - This API is used to fetch a collection of creatives under a specific adgroupId and an accountId.
      • URL - https://api.inmobi.com/rso/adgroups/{adgroupId}/ads
      • Headers - Refer to Passing the General Headers section.
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Example
        AdgroupId The adgroupId whose details needs to be updated Mandatory DUMMY
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Example
        pageNum The page number from where the list needs to be retrieved Optional 5
        maxRecords The maximum number of records to be retrieved from the selected page Optional 57
      • HTTP Method - GET
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "limit": 1,
        "offset": 1,
        "items": [
            {
                "name": "InMobiAPITestBannerAd1",
                "adGroupId": "a59e83f1605d4c078347da495002d1c6",
                "adId": "225e28ad52a845dea7d8b08ce7d6b819",
                "status": "PENDING",
                "adFormat": "BANNER",
                "trackingCodes": [],
                "landingUrl": "https://www.inmobi.com/rso",
                "imageAsset": {
                    "url": "http://i.l.inmobicdn.net/banners/FileData/36ca3863a6a24a6f8d9a92016c796c68.jpeg",
                    "assetId": 2320981
                },
                "lastModifiedOn": "2017-06-12T12:11:13"
            }
        ]
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/adgroups/ed0f7a5ae279435ea7f0c4f35147ad87/ads \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Reactivate an AdgroupId - This API is used to reactivate an adgroup following its expiry.
    {
        "name": "61408876-0d7b-484a-8615-a658ad0de0fc",
        "campaignId": "37e03eeb7f2443fcbb61c2017135591e",
        "startTime": "2017-07-08T07:20:34",
        "endTime": "2017-07-09T06:30:05",
        "status": "ACTIVE",
        "clickDestination": "http://www.inmobi.com",
        "adGroupId": "cfdeb113c987486ca98bbaaea3ac7302",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 5,
            "dailySpendLimit": 200
        },
        "createdOn": "2017-07-06T12:45:30",
        "lastModifiedOn": "2017-07-07T18:32:44",
        "lastModifiedBy": "ankit"
    }
    			
    curl -X POST \
    https://api.inmobi.com/rso/adgroups/ed0f7a5ae279435ea7f0c4f35147ad87/reactivate \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
            "endDate" : "2017-07-11T23:59:59"
          }'
    			
    1. Change Adgroup Status - This API is used to change the status of an adgroup. It can be used to pause a running adgroup, activate a paused adgroup, and archive an adgroup, among others.
    {
        "name": "InMobiAPITestAdGroup1",
        "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
        "startTime": "2017-06-09T00:00:00",
        "endTime": "2017-07-04T23:59:59",
        "status": "PAUSED",
        "clickDestination": "https://www.inmobi.com/",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "geoTargeting": {
                "geoTargetingDetails": [
                    {
                        "countryId": 94
                    }
                ]
            },
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 1.45,
            "dailySpendLimit": 1000
        },
        "createdOn": "2017-06-09T08:43:08",
        "lastModifiedOn": "2017-06-11T18:33:46",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/adgroups/status/ \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -d '{
          	"entityId" : "a59e83f1605d4c078347da495002d1c6",
          	"newStatus" : "PAUSED"
          }'
    			
    Creative

    JSON schema for Creative

    {
            	"$schema": "http://json-schema.org/draft-06/schema",
            	"type" : "object",
            	"properties" : {
            	  "name" : {
            		"type" : "string",
            		"description" : "Name of the Ad"
            	  },
            	  "adGroupId" : {
            		"type" : "string",
            		"description" : "AdGroup under which this Ad needs to be created"
            	  },
            	  "adId" : {
            		"type" : "string",
            		"description" : "Response Only Field - The Ad Id that has been created/updated"
            	  },
            	  "status" : {
            		"type" : "string",
            		"enum" : [ "DRAFT", "ACTIVE", "PAUSED", "EXPIRED", "PENDING", "REJECTED", "ARCHIVED", "ON_HOLD" ],
            		"description" : "Response Only Field - The Status of the Ad"
            	  },
            	  "adFormat" : {
            		"type" : "string",
            		"enum" : [ "BANNER", "INTERSTITIAL", "RICHMEDIA" ],
            		"description" : "Format of the Ad that is being created"
            	  },
            	  "trackingCodes" : {
            		"type" : "array",
            		"description" : "List of tracker that needs to be attached for the Ad",
            		"items" : {
            		  "type" : "object",
            		  "properties" : {
            			"value" : {
            			  "type" : "string",
            			  "description" : "The URL/Script of the tracker for the Ad"
            			},
            			"mode" : {
            			  "type" : "string",
            			  "enum" : [ "URL", "SCRIPT" ],
            			  "description" : "The type against which tracker value can be validated"
            			},
            			"eventType" : {
            			  "type" : "string",
            			  "enum" : [ "CLICK", "IMPRESSION" ],
            			  "description" : "The type of tracker"
            			}
            		  },
            		  "required" : [ "value", "mode", "eventType" ]
            		}
            	  },
            	  "landingUrl" : {
            		"type" : "string",
            		"description" : "The Final page that needs to be displayed to user on clicking the Ad",
            		"maxSize" : 2048
            	  },
            	  "imageAsset" : {
            		"type" : "object",
            		"description" : "Image Asset Details of an Ad - Should be present in Create Ad call alone. Once created, asset of an Ad cannot be updated.",
            		"properties" : {
            		  "assetId" : {
            			"type" : "integer",
            			"description" : "The Asset Id obtained by calling upload asset."
            		  },
            		  "url" : {
            			"type" : "string",
            			"description" : "Response Only Field - The url of the asset where its uploaded."
            		  }
            		},
            		"required" : [ "assetId" ]
            	  },
            	  "richMediaAsset" : {
            		  "type" : "object",
            		  "description" : "Rich Media Details of an Ad - Should be present in Create Ad call alone. Once created, asset of an Ad cannot be updated.",
            		  "properties" : {
            			"content" : {
            			  "type" : "string",
            			  "description" : "Content/Script of Rich Media Ad"
            			},
            			"dimension" : {
            			  "type" : "object",
            			  "description" : "Dimension's of Ad - Required Parameter for non-sprout Ads",
            			  "properties" : {
            				"height" : {
            				  "type" : "integer",
            				  "description" : "The Height of an Ad."
            				},
            				"width" : {
            				  "type" : "integer",
            				  "description" : "The Width of an Ad."
            				}
            			  }
            			},
            			"creativeType" : {
            			  "type" : "string",
            			  "description" : "Type of the Ad - Required Parameter for non-sprout Ads",
            			  "enum" : [ "EXPANDABLE", "INTERSTITIAL", "RICH_BANNER" ]
            			},
            			"contentProvider" : {
            			  "type" : "string",
            			  "description" : "Content Provider of the RM Script - Required Parameter for non-sprout Ads",
            			  "enum" : [ "SPROUT", "SELF", "OTHERS", "ADDROID", "CELTRA", "CRISP", "DOUBLECLICK", "FLASHTALKING", "FLITE", "MEDIALETS", "MEDIAMIND", "SIMPLYTICS", "VOXEL", "AARKI", "ADFORM", "ADMOTION", "ADOBE", "BLUESTREAK", "BONZAI", "EYEBLASTER", "EYEWONDER", "FIKSU", "GOLDSPOT", "GREYSSTIPE", "INNOVID", "JUSTAD", "MEDIABRIX", "NUANCE", "PHLUANT", "POINTROLL", "QUANTCAST", "RHYTHM", "SPARKFLOW", "SPONGECELL", "TELEMETRY", "TRUST_METRICS", "VDOPIA", "VINDICO" ]
            			},
            			"demandCapabilities" : {
            			  "type" : "array",
            			  "description" : "Capabilities Ad supports - Required Parameter for non-sprout Ads",
            			  "items" : {
            				"type" : "string",
            				"enum" : [ "AUDIO", "VIDEO", "ORIENTATION", "HTML5", "JS", "AUDIO_AUTOPLAY", "VIDEO_AUTOPLAY", "PLAYABLE", "MOAT", "NATIVE_VAST_V3" ]
            			  }
            			},
            			"altText" : {
            			  "type" : "string",
            			  "description" : "Alternate Text if the Ad is not available"
            			}
            		}
            	  },
            	  "lastModifiedOn" : {
            		"type" : "string",
            		"description" : "Response Only Field - The Last Modified date String in ISO-8601 Standards",
            		"example" : "2017-07-05T23:59:59"
            	  }
            	},
            	"required" : [ "name", "adGroupId", "adFormat" ]
            }
    	

    Use the following APIs for creative-related information:

    1. Create Creative - This API is used to create a collection of creatives under a specific accountId.
      • URL - https://api.inmobi.com/rso/ads
      • Headers - Refer to Passing the General Headers section.
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Example
        pageNum The page number from where the list needs to be retrieved Optional 5
        maxRecords The maximum number of records to be retrieved from the selected page Optional 57
      • HTTP Method - POST
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "name": "InMobiAPITestBannerAd1",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "adId": "225e28ad52a845dea7d8b08ce7d6b819",
        "status": "PENDING",
        "adFormat": "BANNER",
        "trackingCodes": [],
        "landingUrl": "https://www.inmobi.com/",
        "imageAsset": {
            "url": "http://i.l.inmobicdn.net/banners/FileData/36ca3863a6a24a6f8d9a92016c796c68.jpeg",
            "assetId": 2320981
        },
        "lastModifiedOn": "2017-06-12T11:11:25"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/ads \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -d '{
      "name": "InMobiAPITestBannerAd1",
      "adGroupId": "a59e83f1605d4c078347da495002d1c6",
      "adFormat": "BANNER",
      "landingUrl": "https://www.inmobi.com/",
      "imageAsset": {
        "assetId": 2320981
        }
      }
    }'
    			
    1. Fetch AdId - This API is used to fetch the creative corresponding to a specific adId.
    {
        "name": "InMobiAPITestBannerAd1",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "adId": "225e28ad52a845dea7d8b08ce7d6b819",
        "status": "ON_HOLD",
        "adFormat": "BANNER",
        "trackingCodes": [],
        "landingUrl": "https://www.inmobi.com/",
        "imageAsset": {
            "assetId": 2320981,
            "url" : "http://i.l.inmobicdn.net/banners/FileData/36ca3863a6a24a6f8d9a92016c796c68.jpeg"
        },
        "lastModifiedOn": "2017-06-12T11:23:03"
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/ads/225e28ad52a845dea7d8b08ce7d6b819 \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Archive AdId - This API is used to archive (soft delete) the creative corresponding to a specific adId.
    {
        "name": "InMobiAPITestAdGroup1",
        "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
        "startTime": "2017-06-09T00:00:00",
        "endTime": "2017-07-04T23:59:59",
        "status": "ARCHIVED",
        "clickDestination": "https://www.inmobi.com/",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "geoTargeting": {
                "geoTargetingDetails": [
                    {
                        "countryId": 94
                    }
                ]
            },
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 1.45,
            "dailySpendLimit": 1000
        },
        "createdOn": "2017-06-09T08:43:08",
        "lastModifiedOn": "2017-06-11T18:33:46",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X DELETE \
      https://api.inmobi.com/rso/adgroups/a59e83f1605d4c078347da495002d1c6/ \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Fetch Creative Basic Entity - This API is used to fetch the basic entity of the creative corresponding to a specific adId and an accountId.
      • URL - https://api.inmobi.com/rso/ads/{adId}/basic
      • Headers - Refer to Passing the General Headers section.
      • JSON Schema for Creative Basic Entity
        {
                    "$schema": "http://json-schema.org/draft-06/schema",
                    "type" : "object",
                    "properties" : {
                      "name" : {
                        "type" : "string",
                        "description" : "Name of the Ad"
                      },
                      "adGroupId" : {
                        "type" : "string",
                        "description" : "Response Only Field - AdGroup under which this Ad needs to be created"
                      },
                      "adId" : {
                        "type" : "string",
                        "description" : "Response Only Field - The Ad Id that has been created/updated"
                      },
                      "status" : {
                        "type" : "string",
                        "enum" : [ "DRAFT", "ACTIVE", "PAUSED", "EXPIRED", "PENDING", "REJECTED", "ARCHIVED", "ON_HOLD" ],
                        "description" : "Response Only Field - The Status of the Ad"
                      },
                      "adFormat" : {
                        "type" : "string",
                        "enum" : [ "BANNER", "INTERSTITIAL", "RICHMEDIA" ],
                        "description" : "Response Only Field - Format of the Ad that is being created"
                      },
                      "trackingCodes" : {
                        "type" : "array",
                        "description" : "List of tracker that needs to be attached for the Ad",
                        "items" : {
                          "type" : "object",
                          "properties" : {
                            "value" : {
                              "type" : "string",
                              "description" : "The URL/Script of the tracker for the Ad"
                            },
                            "mode" : {
                              "type" : "string",
                              "enum" : [ "URL", "SCRIPT" ],
                              "description" : "The type against which tracker value can be validated"
                            },
                            "eventType" : {
                              "type" : "string",
                              "enum" : [ "CLICK", "IMPRESSION" ],
                              "description" : "The type of tracker"
                            }
                          },
                          "required" : [ "value", "mode", "eventType" ]
                        }
                      },
                      "landingUrl" : {
                        "type" : "string",
                        "description" : "The Final page that needs to be displayed to user on clicking the Ad",
                        "maxSize" : 2048
                      },
                      "lastModifiedOn" : {
                        "type" : "string",
                        "description" : "Response Only Field - The Last Modified date String in ISO-8601 Standards",
                        "example" : "2017-07-05T23:59:59"
                      }
                    },
                    "required" : [ "name", "adGroupId", "adFormat" ]
                  }
        			
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Example
        AdId The adId whose details needs to be updated Mandatory DUMMY
      • HTTP Method - GET
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "name": "InMobiAPITestBannerAd1",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "adId": "225e28ad52a845dea7d8b08ce7d6b819",
        "status": "ON_HOLD",
        "adFormat": "BANNER",
        "trackingCodes": [],
        "landingUrl": "https://www.inmobi.com/",
        "lastModifiedOn": "2017-06-12T11:23:03"
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/ads/225e28ad52a845dea7d8b08ce7d6b819/basic \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Update Creative Basic Entity - This API is used to update the details of the basic entity of a creative under a specific adId and an accountId.
    {
        "name": "InMobiAPITestBannerAd1",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "adId": "225e28ad52a845dea7d8b08ce7d6b819",
        "status": "PENDING",
        "adFormat": "BANNER",
        "trackingCodes": [],
        "landingUrl": "https://www.inmobi.com/rso",
        "lastModifiedOn": "2017-06-12T12:10:07"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/ads/225e28ad52a845dea7d8b08ce7d6b819/basic \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -d '{
      "name": "InMobiAPITestBannerAd1",
      "adGroupId": "a59e83f1605d4c078347da495002d1c6",
      "adFormat": "BANNER",
      "landingUrl": "https://www.inmobi.com/rso"
    }'
    			
    1. Change Creative Status - This API is used to change the status of a creative. It can be used to pause a running creative, activate a paused creative, and archive a creative, among others.
    {
        "name": "InMobiAPITestBannerAd1",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "adId": "225e28ad52a845dea7d8b08ce7d6b819",
        "status": "PAUSED",
        "adFormat": "BANNER",
        "trackingCodes": [],
        "landingUrl": "https://www.inmobi.com/",
        "imageAsset": {
            "assetId": 2320981
        },
        "lastModifiedOn": "2017-06-12T11:23:03"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/ads/status \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -d '{
      "entityId":"225e28ad52a845dea7d8b08ce7d6b819",
      "newStatus":"PAUSED"
    }'
    			
    Asset

    Use the following APIs for asset-related information:

    1. Upload Images - This API is used to upload images with content-type "multipart/form-data". The image is present under formDataParam_name as "file".
    {
        "assetId": 2320981,
        "name": "320x50.jpg",
        "assetType": "IMAGE",
        "assetUrl": "http://i.l.inmobicdn.net/banners/FileData/36ca3863a6a24a6f8d9a92016c796c68.jpeg",
        "dimension": {
            "height": 50,
            "width": 320
        },
        "sizeInBytes": 8866
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/assets/images \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -H 'userid: kishore.bandi@inmobi.com' \
      -F file=@320x50.jpg
    			
    Brand-based API Calls

    These API calls are made to promote brands

    Account

    JSON schema for Account

    {
              "$schema": "http://json-schema.org/draft-06/schema",
              "type" : "object",
              "properties" : {
                "accountId" : {
                  "description" : "Account Id ",
                  "type" : "string"
                },
                "name" : {
                  "description" : "Name of the account",
                  "type" : "string"
                },
                "status" : {
                  "description" : "Status of the account",
                  "type" : "string",
                  "enum" : [ "ACTIVE", "BLOCKED", "ACTIVATION_PENDING" ]
                },
                "balance" : {
                  "description" : "Balance available in the account",
                  "type" : "number"
                }
              }
            }
    	

    Use the following APIs for account-related information:

    1. Get Account - This API is used to fetch details about the account.
    {
      "accountId": "5a5f7a5b94e441a8b0eeef9b301eb7bd",
      "name": "kishore.bandi@inmobi.com",
      "status": "ACTIVE",
      "balance": 1000
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/account \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    Campaign

    JSON schema for Campaign

    {
                 "$schema": "http://json-schema.org/draft-06/schema",
                 "title": "Campaign Object",
                 "type" : "object",
                 "properties" : {
                   "objective" : {
                     "type" : "string",
                     "enum" : [ "PROMOTE_CONTENT" ]
                   },
                   "name" : {
                     "type" : "string"
                   },
                   "startTime" : {
                     "type" : "string",
                     "description" : "The Start date String in ISO-8601 Standards",
                     "example" : "2017-06-06T00:00:00"
                   },
                   "endTime" : {
                     "type" : "string",
                     "description" : "The End date String in ISO-8601 Standards",
                     "example" : "2017-07-05T23:59:59"
                   },
                   "campaignBudget" : {
                     "type" : "object",
                     "properties" : {
                       "budgetType" : {
                         "type" : "string",
                         "description" : "Account - The campaign will start burning from account and the money will not be transfered/dedicated separately for the campaign. Campaign - The selected amount will be transfered from account to campaign and the burn for the campaign will happen from this amount.",
                         "enum" : [ "ACCOUNT", "CAMPAIGN" ]
                       },
                       "totalBudget" : {
                         "type" : "number",
                         "description" : "Amount in Dollars",
                         "minimum": 0,
                         "maximum": 10000000
                       },
                       "dailyLimit" : {
                         "type" : "number",
                         "description" : "Amount in Dollars",
                         "minimum": 0,
                         "maximum": 10000000
                       }
                     },
                     "required" : [ "budgetType" ]
                   },
                   "frequencyCaps" : {
                     "type" : "array",
                     "items" : {
                       "type" : "object",
                       "properties" : {
                         "type" : {
                           "type" : "string",
                           "enum" : [ "RENDER", "CLICK", "VIDEO_COMPLETE" ]
                         },
                         "limit" : {
                           "type" : "integer",
                           "description" : "The max. limit (number of times) to target a user",
                           "maximum": 129600
                         },
                         "duration" : {
                           "type" : "integer",
                           "description" : "The Duration in minutes",
                           "maximum": 100
                         }
                       },
                       "required" : [ "type" ]
                     }
                   },
                   "campaignId" : {
                     "type" : "string",
                     "description" : "Response Only Field - Will not be honored in Request"
                   },
                   "status" : {
                     "type" : "string",
                     "description" : "Response Only Field - Will not be honored in Request",
                     "enum" : [ "DRAFT", "ACTIVE", "PAUSED", "EXPIRED", "PENDING", "REJECTED", "ARCHIVED", "ON_HOLD" ]
                   },
                   "balance" : {
                     "type" : "number",
                     "description" : "Response Only Field - Will not be honored in Request"
                   },
                   "createdOn" : {
                     "type" : "string",
                     "description" : "Response Only Field - The Create date String in ISO-8601 Standards",
                     "example" : "2017-07-05T23:59:59"
                   },
                   "lastModifiedOn" : {
                     "type" : "string",
                     "description" : "Response Only Field - The Last Modified date String in ISO-8601 Standards",
                     "example" : "2017-07-05T23:59:59"
                   },
                   "lastModifiedBy" : {
                     "type" : "string",
                     "description" : "Response Only Field - The Last Modified user"
                   }
                 },
                 "required" : [ "objective", "name", "startTime", "endTime", "campaignBudget" ]
               }
    	

    Use the following APIs for campaign-related information:

    1. Create Campaign - This API is used to create a campaign.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "InMobiAPITest",
        "startTime": "2017-06-06T00:00:00",
        "endTime": "2017-07-05T23:59:59",
        "campaignBudget": {
            "budgetType": "CAMPAIGN",
            "totalBudget": 10000,
            "dailyLimit": 500
        },
        "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
        "status": "ACTIVE",
        "balance": 0,
        "createdOn": "2017-06-06T09:21:12",
        "lastModifiedOn": "2017-06-06T09:21:12",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/campaigns \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
      "objective": "PROMOTE_CONTENT",
      "name": "InMobiAPITest",
      "startTime": "2017-06-08T00:00:00",
      "endTime": "2017-07-05T23:59:59.999",
      "campaignBudget": {
        "budgetType": "CAMPAIGN",
        "totalBudget": 10000.0,
        "dailyLimit": 500.0
      }
    }
    			
    1. Fetch Campaign - This API is used to fetch the details of campaigns under an account.
    {
        "limit": 0,
        "offset": 0,
        "items": [
            {
                "objective": "PROMOTE_CONTENT",
                "name": "InMobiAPITest",
                "startTime": "2017-06-06T00:00:00",
                "endTime": "2017-07-05T23:59:59",
                "campaignBudget": {
                    "budgetType": "CAMPAIGN",
                    "totalBudget": 10000,
                    "dailyLimit": 500
                },
                "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
                "status": "ACTIVE",
                "balance": 0,
                "createdOn": "2017-06-06T09:21:12",
                "lastModifiedOn": "2017-06-06T09:21:12",
                "lastModifiedBy": "kishore.bandi@inmobi.com"
            }
        ]
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/campaigns \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d'
    			
    1. Update CampaignId - This API is used to update the details of campaigns under a specific campaignId and an accountId.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "InMobiAPITest",
        "startTime": "2017-06-06T00:00:00",
        "endTime": "2017-07-06T23:59:59",
        "campaignBudget": {
            "budgetType": "CAMPAIGN",
            "totalBudget": 100,
            "dailyLimit": 500
        },
        "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
        "status": "ACTIVE",
        "balance": 0,
        "createdOn": "2017-06-06T09:21:12",
        "lastModifiedOn": "2017-06-06T10:27:42",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/campaigns/ed0f7a5ae279435ea7f0c4f35147ad87 \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
              "objective": "PROMOTE_CONTENT",
              "name": "InMobiAPITest1",
              "startTime": "2017-06-08T00:00:00",
              "endTime": "2017-07-05T23:59:59",
              "campaignBudget": {
                  "budgetType": "CAMPAIGN",
                  "totalBudget": 10000,
                  "dailyLimit": 500
              }
          }'
    			
    1. Fetch CampaignId - This API is used to fetch the details of campaigns under a specific campaignId and an accountId.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "InMobiAPITest",
        "startTime": "2017-06-06T00:00:00",
        "endTime": "2017-07-06T23:59:59",
        "campaignBudget": {
            "budgetType": "CAMPAIGN",
            "totalBudget": 100,
            "dailyLimit": 500
        },
        "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
        "status": "ACTIVE",
        "balance": 0,
        "createdOn": "2017-06-06T09:21:12",
        "lastModifiedOn": "2017-06-06T10:27:42",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/campaigns/ed0f7a5ae279435ea7f0c4f35147ad87 \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d'
    			
    1. Fetch Adgroups under CampaignId - This API is used to fetch adgroups under a specific campaignId and an accountId
      • URL - https://api.inmobi.com/rso/campaigns/{campaignId}/adgroups
      • Headers - Refer to Passing the General Headers section.
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Example
        CampaignId The campaignId whose details needs to be updated Mandatory DUMMY
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Example
        pageNum The page number from where the list needs to be retrieved Optional 5
        maxRecords The maximum number of records to be retrieved from the selected page Optional 57
      • HTTP Method - GET
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "limit": 1,
        "offset": 1,
        "items": [
            {
                "name": "InMobiAPITestAdGroup1",
                "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
                "startTime": "2017-06-09T00:00:00",
                "endTime": "2017-07-05T23:59:59",
                "status": "PENDING",
                "clickDestination": "https://www.inmobi.com/",
                "adGroupId": "a59e83f1605d4c078347da495002d1c6",
                "clickAction": "URL",
                "objective": "PROMOTE_CONTENT",
                "targeting": {
                    "geoTargeting": {
                        "geoTargetingDetails": [
                            {
                                "countryId": 94
                            }
                        ]
                    },
                    "deviceTargeting": {
                        "deviceTypeList": [
                            "SMART_PHONE",
                            "TABLET"
                        ]
                    },
                    "scheduleTargeting": {
                        "schedules": [
                            {
                                "dayOfWeek": "SUNDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "MONDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "TUESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "WEDNESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "THURSDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "FRIDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "SATURDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            }
                        ]
                    }
                },
                "pricing": {
                    "priceType": "CPC",
                    "bidValue": 1.45,
                    "dailySpendLimit": 1000
                },
                "createdOn": "2017-06-09T08:43:08",
                "lastModifiedOn": "2017-06-09T08:45:09",
                "lastModifiedBy": "M10N"
            }
        ]
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/campaigns/ed0f7a5ae279435ea7f0c4f35147ad87/adgroups \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Fetch Creatives under CampaignId - This API is used to fetch creatives under a specific campaignId and an accountId
      • URL - https://api.inmobi.com/rso/campaigns/{campaignId}/ads
      • Headers - Refer to Passing the General Headers section.
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Example
        CampaignId The campaignId whose details needs to be updated Mandatory DUMMY
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Example
        pageNum The page number from where the list needs to be retrieved Optional 5
        maxRecords The maximum number of records to be retrieved from the selected page Optional 57
      • HTTP Method - GET
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "limit": 1,
        "offset": 1,
        "items": [
            {
                "name": "InMobiAPITestBannerAd1",
                "adGroupId": "a59e83f1605d4c078347da495002d1c6",
                "adId": "225e28ad52a845dea7d8b08ce7d6b819",
                "status": "PENDING",
                "adFormat": "BANNER",
                "trackingCodes": [],
                "landingUrl": "https://www.inmobi.com/rso",
                "imageAsset": {
                    "url": "http://i.l.inmobicdn.net/banners/FileData/36ca3863a6a24a6f8d9a92016c796c68.jpeg",
                    "assetId": 2320981
                },
                "lastModifiedOn": "2017-06-12T12:11:13"
            }
        ]
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/campaigns/ed0f7a5ae279435ea7f0c4f35147ad87/ads \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Archive CampaignId - This API is used to archive (soft delete) the details of campaigns under a specific campaignId and an accountId.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "Test1",
        "startTime": "2017-06-12T00:00:00",
        "endTime": "2017-07-05T23:59:59",
        "campaignBudget": {
            "budgetType": "ACCOUNT",
            "totalBudget": 0,
            "dailyLimit": 500
        },
        "campaignId": "dcb989192e8347888917c8babf704df3",
        "status": "ARCHIVED",
        "balance": 0,
        "createdOn": "2017-06-12T10:03:08",
        "lastModifiedOn": "2017-06-12T10:03:52",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X DELETE \
      https://api.inmobi.com/rso/campaigns/dcb989192e8347888917c8babf704df3 \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Reactivate Campaign - This API is used to reactivate a campaign after it has expired.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "InMobiAPITest",
        "startTime": "2017-06-06T00:00:00",
        "endTime": "2017-07-11T23:59:59",
        "campaignBudget": {
            "budgetType": "CAMPAIGN",
            "totalBudget": 100,
            "dailyLimit": 500
        },
        "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
        "status": "ARCHIVED",
        "balance": 0,
        "createdOn": "2017-06-06T09:21:12",
        "lastModifiedOn": "2017-06-06T10:27:42",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
    https://api.inmobi.com/rso/campaigns/ed0f7a5ae279435ea7f0c4f35147ad87/reactivate \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
            "endDate" : "2017-07-11T23:59:59"
          }'
    			
    1. Deallocate Campaign - This API is used to transfer the money allocated to this campaign back to the account. The budget type should be Campaign.
    {
      "Valid" : "true"
    }
    		
    curl -X POST \
      https://api.inmobi.com/rso/campaigns/dcb989192e8347888917c8babf704df3/deallocate \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    	
    1. Change Campaign Status - This API is used to change the status of a campaign. It can be used to pause a running campaign, activate a paused campaign, and archive a campaign, among others.
    {
        "objective": "PROMOTE_CONTENT",
        "name": "InMobiAPITest",
        "startTime": "2017-06-06T00:00:00",
        "endTime": "2017-07-06T23:59:59",
        "campaignBudget": {
            "budgetType": "CAMPAIGN",
            "totalBudget": 100,
            "dailyLimit": 500
        },
        "campaignId": "b0afb8ce8cab41bd83ca2d5de5d9ffc5",
        "status": "PAUSED",
        "balance": 0,
        "createdOn": "2017-06-06T09:21:12",
        "lastModifiedOn": "2017-06-06T10:27:42",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/campaigns/status \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
          	"entityId" : "ed0f7a5ae279435ea7f0c4f35147ad87",
          	"newStatus" : "PAUSED"
          }'
    			
    Adgroup

    JSON schema for Adgroup

    {
                    "$schema": "http://json-schema.org/draft-06/schema",
                    "type": "object",
                    "properties": {
                    "name": {
                    	"type": "string",
                    	"description": "Name of the Ad Group"
                    },
                    "campaignId": {
                    	"type": "string",
                    	"description": "Campaign Id under which this Ad Group needs to be created"
                    },
                    "startTime": {
                    	"type": "string",
                    	"description": "Date in string using ISO-8601 Standard"
                    },
                    "endTime": {
                    	"type": "string",
                    	"description": "Date in string using ISO-8601 Standard"
                    },
                    "status": {
                    	"type": "string",
                    	"description": "Response Only Field - Date in string using ISO-8601 Standard",
                    	"enum": [
                    		"DRAFT",
                    		"ACTIVE",
                    		"PAUSED",
                    		"EXPIRED",
                    		"PENDING",
                    		"REJECTED",
                    		"ARCHIVED",
                    		"ON_HOLD"
                    	]
                    },
                    "clickDestination": {
                    	"type": "string",
                    	"description": "The Final Page which needs to be displayed when user clicks on the Ad"
                    },
                    "adGroupId": {
                    	"type": "string",
                    	"description": "Response Only Field"
                    },
                    "clickAction": {
                    	"type": "string",
                    	"enum": [
                    		"URL"
                    	]
                    },
                    "objective": {
                    	"type": "string",
                    	"description": "Response Only Field - Derived from Campaign",
                    	"enum": [
                    		"PROMOTE_CONTENT"
                    	]
                    },
                    "targeting": {
                    	"type": "object",
                    	"description": "Targeting Information of the corresponding AdGroup",
                    	"properties": {
                    		"geoTargeting": {
                    			"type": "object",
                    			"properties": {
                    				"geoTargetingDetails": {
                    					"type": "array",
                    					"items": {
                    						"type": "object",
                    						"description": "Geo Targeting Information of the corresponding AdGroup",
                    						"properties": {
                    							"countryId": {
                    								"type": "integer",
                    								"description": "Country Id which needs to be Targeted"
                    							},
                    							"stateIds": {
                    								"type": "array",
                    								"items": {
                    									"type": "integer"
                    								},
                    								"description": "State Id which needs to be Targeted"
                    							},
                    							"cityIds": {
                    								"type": "array",
                    								"items": {
                    									"type": "integer"
                    								},
                    								"description": "City Id which needs to be Targeted"
                    							},
                    							"zipIds": {
                    								"type": "array",
                    								"description": "Zips Id which needs to be Targeted",
                    								"items": {
                    									"type": "integer"
                    								}
                    							},
                    							"carrierIds": {
                    								"type": "array",
                    								"description": "Carrier Id which needs to be Targeted",
                    								"items": {
                    									"type": "integer"
                    								}
                    							},
                    							"latLongList": {
                    								"type": "array",
                    								"items": {
                    									"type": "object",
                    									"description": "Lat-Long based targeting",
                    									"properties": {
                    										"name": {
                    											"type": "string"
                    										},
                    										"latitude": {
                    											"type": "number",
                    											"minimum": -90,
                    											"maximum": 90
                    										},
                    										"longitude": {
                    											"type": "number",
                    											"minimum": -180,
                    											"maximum": 180
                    										},
                    										"radius": {
                    											"type": "number",
                    											"minimum": 0
                    										}
                    									},
                    									"required": ["name", "latitude", "longitude", "radius"]
                    								}
                    							},
                    							"required": ["countryId"]
                    						}
                    					}
                    				}
                    			},
                    			"deviceTargeting": {
                    				"type": "object",
                    				"properties": {
                    					"handsetTargetingList": {
                    						"type": "array",
                    						"items": {
                    							"type": "object",
                    							"properties": {
                    								"manufacturerId": {
                    									"type": "integer",
                    									"description": "The ManufacturerId that needs to be included/excluded"
                    								},
                    								"handsetIdList": {
                    									"type": "array",
                    									"description": "List of Handset Ids that needs to be included/excluded",
                    									"items": {
                    										"type": "integer"
                    									}
                    								},
                    								"exclude": {
                    									"type": "boolean",
                    									"description": "Indicates if the selected targeting needs to be included or excluded. Default - false"
                    								}
                    							},
                    							"required": ["manufacturerId"]
                    						}
                    					},
                    					"deviceTypeList": {
                    						"type": "array",
                    						"description": "What type of devices needs to be selected for Targeting. Default - ALL",
                    						"items": {
                    							"type": "string",
                    							"enum": [
                    								"SMART_PHONE",
                    								"TABLET"
                    							]
                    						}
                    					},
                    					"ostargetingList": {
                    						"type": "array",
                    						"description": "Target based on User's Operating System",
                    						"items": {
                    							"type": "object",
                    							"properties": {
                    								"osId": {
                    									"type": "integer",
                    									"description": "OS Id that needs to be included"
                    								},
                    								"minVersion": {
                    									"type": "number",
                    									"description": "Minimum version of the OS that needs to be targeted"
                    								},
                    								"maxVersion": {
                    									"type": "number",
                    									"description": "Maximum version of the OS that needs to be targeted"
                    								},
                    								"exclude": {
                    									"type": "boolean",
                    									"description": "Indicates if the selected targeting needs to be included or excluded. Default - false"
                    								}
                    							},
                    							"required": ["osId"]
                    						}
                    					}
                    				}
                    			},
                    			"userTargeting": {
                    				"type": "object",
                    				"description": "The Segments retrieved must be set in this list of lists using CNF form.
                                                          Note : The more segments residing inside AND notation in CNF notation, the lesser would be the reach of Users.
                                                          Example : If we want to target all users who are either Shopping Enthusiasts or Business Professional or Technology Enthusiasts but definetely have to be a Cab Riders then the input would be [["Shopping","Business","Technology"],["Cab Riders"]]
                                                          (Of Course, the values here need to be segment Ids)",
                    				"properties": {
                    					"segmentIds": {
                    						"type": "array",
                    						"example": "",
                    						"items": {
                    							"type": "array",
                    							"items": {
                    								"type": "integer"
                    							}
                    						}
                    					}
                    				},
                    				"required": ["segmentIds"]
                    			},
                    			"scheduleTargeting": {
                    				"type": "object",
                    				"description": "Target based on Time",
                    				"properties": {
                    					"schedules": {
                    						"type": "array",
                    						"items": {
                    							"type": "object",
                    							"properties": {
                    								"dayOfWeek": {
                    									"type": "string",
                    									"enum": [
                    										"MONDAY",
                    										"TUESDAY",
                    										"WEDNESDAY",
                    										"THURSDAY",
                    										"FRIDAY",
                    										"SATURDAY",
                    										"SUNDAY"
                    									]
                    								},
                    								"ranges": {
                    									"type": "array",
                    									"items": {
                    										"type": "object",
                    										"properties": {
                    											"start": {
                    												"type": "integer",
                    												"description": "Start hour from when the AdGroup Should be selected for targeting in a day",
                    												"minimum": 0,
                    												"maximum": 23
                    											},
                    											"end": {
                    												"type": "integer",
                    												"description": "End hour till when the AdGroup Should be selected for targeting in a day",
                    												"minimum": 0,
                    												"maximum": 23
                    											}
                    										},
                    										"required": ["start", "end"]
                    									}
                    								}
                    							},
                    							"required": ["dayOfWeek", "ranges"]
                    						},
                    						"maxRecords": "7"
                    					}
                    				}
                    			}
                    		}
                    	},
                    	"pricing": {
                    		"type": "object",
                    		"description": "Pricing related information of an Ad Group",
                    		"properties": {
                    			"priceType": {
                    				"type": "string",
                    				"enum": [
                    					"CPC",
                    					"CPM",
                    					"VCPM"
                    				]
                    			},
                    			"bidValue": {
                    				"type": "number",
                    				"minimum": 0
                    			},
                    			"dailySpendLimit": {
                    				"type": "number"
                    			}
                    		},
                    		"required": ["priceType", "bidValue"]
                    	},
                    	"frequencyCaps": {
                    		"type": "array",
                    		"items": {
                    			"type": "object",
                    			"properties": {
                    				"type": {
                    					"type": "string",
                    					"enum": [
                    						"RENDER",
                    						"CLICK",
                    						"VIDEO_COMPLETE"
                    					]
                    				},
                    				"limit": {
                    					"type": "integer",
                    					"description": "The max. limit (number of times) to target a user",
                    					"maximum": 129600
                    				},
                    				"duration": {
                    					"type": "integer",
                    					"description": "The Duration in minutes",
                    					"maximum": 100
                    				}
                    			},
                    			"required": ["type"]
                    		}
                    	},
                    	"createdOn": {
                    		"type": "string",
                    		"description": "Response Only Field - The Create date String in ISO-8601 Standards",
                    		"example": "2017-07-05T23:59:59"
                    	},
                    	"lastModifiedOn": {
                    		"type": "string",
                    		"description": "Response Only Field - The Create date String in ISO-8601 Standards",
                    		"example": "2017-07-05T23:59:59"
                    	},
                    	"lastModifiedBy": {
                    		"type": "string",
                    		"description": "Response Only Field - The Last Modified user"
                    	}
                    },
                    "required": ["name", "campaignId", "startTime", "clickDestination", "pricing"]
                    }
                    }
    	

    Use the following APIs for adgroup-related information:

    1. Create Adgroup - This API is used to create an adgroup
    {
      "name": "InMobiAPITestAdGroup1",
      "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
      "startTime": "2017-06-09T00:00:00",
      "endTime": "2017-07-05T23:59:59",
      "status": "PENDING",
      "clickDestination": "https://www.inmobi.com/",
      "adGroupId": "a59e83f1605d4c078347da495002d1c6",
      "clickAction": "URL",
      "objective": "PROMOTE_CONTENT",
      "targeting": {
        "geoTargeting": {
          "geoTargetingDetails": [
            {
              "countryId": 94
            }
          ]
        },
        "deviceTargeting": {
          "deviceTypeList": [
            "SMART_PHONE",
            "TABLET"
          ]
        },
        "scheduleTargeting": {
          "schedules": [
            {
              "dayOfWeek": "SUNDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "MONDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "TUESDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "WEDNESDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "THURSDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "FRIDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            },
            {
              "dayOfWeek": "SATURDAY",
              "ranges": [
                {
                  "start": 0,
                  "end": 23
                }
              ]
            }
          ]
        }
      },
      "pricing": {
        "priceType": "CPC",
        "bidValue": 1.45,
        "dailySpendLimit": 1000
      },
      "createdOn": "2017-06-09T08:43:08",
      "lastModifiedOn": "2017-06-09T08:43:08",
      "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/adgroups \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
      "name": "InMobiAPITestAdGroup1",
      "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
      "startTime": "2017-06-09T00:00:00",
      "clickDestination": "https://www.inmobi.com/",
      "clickAction": "URL",
      "targeting": {
        "geoTargeting": {
          "geoTargetingDetails": [
            {
              "countryId": 94
            }
          ]
        },
        "deviceTargeting": {
          "deviceTypeList": [
            "SMART_PHONE",
            "TABLET"
          ]
        }
      },
      "pricing": {
        "priceType": "CPC",
        "bidValue": 1.45,
        "dailySpendLimit": 1000.0
      }
    }'
    			
    1. Get Adgroup - This API is used to get details of an adgroup
    {
        "limit": 1,
        "offset": 1,
        "items": [
            {
                "name": "InMobiAPITestAdGroup1",
                "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
                "startTime": "2017-06-09T00:00:00",
                "endTime": "2017-07-05T23:59:59",
                "status": "PENDING",
                "clickDestination": "https://www.inmobi.com/",
                "adGroupId": "a59e83f1605d4c078347da495002d1c6",
                "clickAction": "URL",
                "objective": "PROMOTE_CONTENT",
                "targeting": {
                    "geoTargeting": {
                        "geoTargetingDetails": [
                            {
                                "countryId": 94
                            }
                        ]
                    },
                    "deviceTargeting": {
                        "deviceTypeList": [
                            "SMART_PHONE",
                            "TABLET"
                        ]
                    },
                    "scheduleTargeting": {
                        "schedules": [
                            {
                                "dayOfWeek": "SUNDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "MONDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "TUESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "WEDNESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "THURSDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "FRIDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "SATURDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            }
                        ]
                    }
                },
                "pricing": {
                    "priceType": "CPC",
                    "bidValue": 1.45,
                    "dailySpendLimit": 1000
                },
                "createdOn": "2017-06-09T08:43:08",
                "lastModifiedOn": "2017-06-09T08:45:09",
                "lastModifiedBy": "M10N"
            }
        ]
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/adgroups \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d'
    			
    1. Get Adgroup - This API is used to get details of an adgroup
      • URL - https://api.inmobi.com/rso/adgroups
      • Headers - Refer to Passing the General Headers section.
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Example
        AdgroupId The adgroupId whose details needs to be updated Mandatory DUMMY
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Example
        pageNum The page number from where the list needs to be retrieved Optional 5
        maxRecords The maximum number of records to be retrieved from the selected page Optional 57
      • HTTP Method - POST
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "name": "InMobiAPITestAdGroup1",
        "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
        "startTime": "2017-06-09T00:00:00",
        "endTime": "2017-07-04T23:59:59",
        "status": "PENDING",
        "clickDestination": "https://www.inmobi.com/",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "geoTargeting": {
                "geoTargetingDetails": [
                    {
                        "countryId": 94
                    }
                ]
            },
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 1.45,
            "dailySpendLimit": 1000
        },
        "createdOn": "2017-06-09T08:43:08",
        "lastModifiedOn": "2017-06-11T18:33:46",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/adgroups/a59e83f1605d4c078347da495002d1c6/ \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -d '{
                "name": "InMobiAPITestAdGroup1",
                "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
                "startTime": "2017-06-09T00:00:00",
                "endTime": "2017-07-04T23:59:59",
                "status": "PENDING",
                "clickDestination": "https://www.inmobi.com/",
                "adGroupId": "a59e83f1605d4c078347da495002d1c6",
                "clickAction": "URL",
                "objective": "PROMOTE_CONTENT",
                "targeting": {
                    "geoTargeting": {
                        "geoTargetingDetails": [
                            {
                                "countryId": 94
                            }
                        ]
                    },
                    "deviceTargeting": {
                        "deviceTypeList": [
                            "SMART_PHONE",
                            "TABLET"
                        ]
                    },
                    "scheduleTargeting": {
                        "schedules": [
                            {
                                "dayOfWeek": "SUNDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "MONDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "TUESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "WEDNESDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "THURSDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "FRIDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            },
                            {
                                "dayOfWeek": "SATURDAY",
                                "ranges": [
                                    {
                                        "start": 0,
                                        "end": 23
                                    }
                                ]
                            }
                        ]
                    }
                },
                "pricing": {
                    "priceType": "CPC",
                    "bidValue": 1.45,
                    "dailySpendLimit": 1000
                },
                "createdOn": "2017-06-09T08:43:08",
                "lastModifiedOn": "2017-06-09T08:45:09",
                "lastModifiedBy": "M10N"
            }'
    			
    1. Fetch AdgroupId - This API is used to fetch details of an adgroup under a specific adgroupId and a campaignId
    {
        "name": "InMobiAPITestAdGroup1",
        "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
        "startTime": "2017-06-09T00:00:00",
        "endTime": "2017-07-04T23:59:59",
        "status": "PENDING",
        "clickDestination": "https://www.inmobi.com/",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "geoTargeting": {
                "geoTargetingDetails": [
                    {
                        "countryId": 94
                    }
                ]
            },
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 1.45,
            "dailySpendLimit": 1000
        },
        "createdOn": "2017-06-09T08:43:08",
        "lastModifiedOn": "2017-06-11T18:33:46",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/adgroups/a59e83f1605d4c078347da495002d1c6 \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d'
    			
    1. Archive AdgroupId - This API is used to archive (soft delete) details of an adgroup under a specific adgroupId.
    {
        "name": "InMobiAPITestAdGroup1",
        "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
        "startTime": "2017-06-09T00:00:00",
        "endTime": "2017-07-04T23:59:59",
        "status": "ARCHIVED",
        "clickDestination": "https://www.inmobi.com/",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "geoTargeting": {
                "geoTargetingDetails": [
                    {
                        "countryId": 94
                    }
                ]
            },
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 1.45,
            "dailySpendLimit": 1000
        },
        "createdOn": "2017-06-09T08:43:08",
        "lastModifiedOn": "2017-06-11T18:33:46",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X DELETE \
      https://api.inmobi.com/rso/adgroups/a59e83f1605d4c078347da495002d1c6/ \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Fetch Creatives from an AdgroupId - This API is used to fetch a collection of creatives under a specific adgroupId and an accountId.
      • URL - https://api.inmobi.com/rso/adgroups/{adgroupId}/ads
      • Headers - Refer to Passing the General Headers section.
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Example
        AdgroupId The adgroupId whose details needs to be updated Mandatory DUMMY
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Example
        pageNum The page number from where the list needs to be retrieved Optional 5
        maxRecords The maximum number of records to be retrieved from the selected page Optional 57
      • HTTP Method - GET
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "limit": 1,
        "offset": 1,
        "items": [
            {
                "name": "InMobiAPITestBannerAd1",
                "adGroupId": "a59e83f1605d4c078347da495002d1c6",
                "adId": "225e28ad52a845dea7d8b08ce7d6b819",
                "status": "PENDING",
                "adFormat": "BANNER",
                "trackingCodes": [],
                "landingUrl": "https://www.inmobi.com/rso",
                "imageAsset": {
                    "url": "http://i.l.inmobicdn.net/banners/FileData/36ca3863a6a24a6f8d9a92016c796c68.jpeg",
                    "assetId": 2320981
                },
                "lastModifiedOn": "2017-06-12T12:11:13"
            }
        ]
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/adgroups/ed0f7a5ae279435ea7f0c4f35147ad87/ads \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Reactivate an AdgroupId - This API is used to reactivate an adgroup following its expiry.
    {
        "name": "61408876-0d7b-484a-8615-a658ad0de0fc",
        "campaignId": "37e03eeb7f2443fcbb61c2017135591e",
        "startTime": "2017-07-08T07:20:34",
        "endTime": "2017-07-09T06:30:05",
        "status": "ACTIVE",
        "clickDestination": "http://www.inmobi.com",
        "adGroupId": "cfdeb113c987486ca98bbaaea3ac7302",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 5,
            "dailySpendLimit": 200
        },
        "createdOn": "2017-07-06T12:45:30",
        "lastModifiedOn": "2017-07-07T18:32:44",
        "lastModifiedBy": "ankit"
    }
    			
    curl -X POST \
    https://api.inmobi.com/rso/adgroups/ed0f7a5ae279435ea7f0c4f35147ad87/reactivate \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a \
      -H 'sessionId: 3eff064e143a4fe1a326c7a13117c35d' \
      -d '{
            "endDate" : "2017-07-11T23:59:59"
          }'
    			
    1. Change Adgroup Status - This API is used to change the status of an adgroup. It can be used to pause a running adgroup, activate a paused adgroup, and archive an adgroup, among others.
    {
        "name": "InMobiAPITestAdGroup1",
        "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
        "startTime": "2017-06-09T00:00:00",
        "endTime": "2017-07-04T23:59:59",
        "status": "PAUSED",
        "clickDestination": "https://www.inmobi.com/",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "geoTargeting": {
                "geoTargetingDetails": [
                    {
                        "countryId": 94
                    }
                ]
            },
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 1.45,
            "dailySpendLimit": 1000
        },
        "createdOn": "2017-06-09T08:43:08",
        "lastModifiedOn": "2017-06-11T18:33:46",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/adgroups/status/ \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -d '{
          	"entityId" : "a59e83f1605d4c078347da495002d1c6",
          	"newStatus" : "PAUSED"
          }'
    			
    Creative

    JSON schema for Creative

    {
            	"$schema": "http://json-schema.org/draft-06/schema",
            	"type" : "object",
            	"properties" : {
            	  "name" : {
            		"type" : "string",
            		"description" : "Name of the Ad"
            	  },
            	  "adGroupId" : {
            		"type" : "string",
            		"description" : "AdGroup under which this Ad needs to be created"
            	  },
            	  "adId" : {
            		"type" : "string",
            		"description" : "Response Only Field - The Ad Id that has been created/updated"
            	  },
            	  "status" : {
            		"type" : "string",
            		"enum" : [ "DRAFT", "ACTIVE", "PAUSED", "EXPIRED", "PENDING", "REJECTED", "ARCHIVED", "ON_HOLD" ],
            		"description" : "Response Only Field - The Status of the Ad"
            	  },
            	  "adFormat" : {
            		"type" : "string",
            		"enum" : [ "BANNER", "INTERSTITIAL", "RICHMEDIA" ],
            		"description" : "Format of the Ad that is being created"
            	  },
            	  "trackingCodes" : {
            		"type" : "array",
            		"description" : "List of tracker that needs to be attached for the Ad",
            		"items" : {
            		  "type" : "object",
            		  "properties" : {
            			"value" : {
            			  "type" : "string",
            			  "description" : "The URL/Script of the tracker for the Ad"
            			},
            			"mode" : {
            			  "type" : "string",
            			  "enum" : [ "URL", "SCRIPT" ],
            			  "description" : "The type against which tracker value can be validated"
            			},
            			"eventType" : {
            			  "type" : "string",
            			  "enum" : [ "CLICK", "IMPRESSION" ],
            			  "description" : "The type of tracker"
            			}
            		  },
            		  "required" : [ "value", "mode", "eventType" ]
            		}
            	  },
            	  "landingUrl" : {
            		"type" : "string",
            		"description" : "The Final page that needs to be displayed to user on clicking the Ad",
            		"maxSize" : 2048
            	  },
            	  "imageAsset" : {
            		"type" : "object",
            		"description" : "Image Asset Details of an Ad - Should be present in Create Ad call alone. Once created, asset of an Ad cannot be updated.",
            		"properties" : {
            		  "assetId" : {
            			"type" : "integer",
            			"description" : "The Asset Id obtained by calling upload asset."
            		  },
            		  "url" : {
            			"type" : "string",
            			"description" : "Response Only Field - The url of the asset where its uploaded."
            		  }
            		},
            		"required" : [ "assetId" ]
            	  },
            	  "richMediaAsset" : {
            		  "type" : "object",
            		  "description" : "Rich Media Details of an Ad - Should be present in Create Ad call alone. Once created, asset of an Ad cannot be updated.",
            		  "properties" : {
            			"content" : {
            			  "type" : "string",
            			  "description" : "Content/Script of Rich Media Ad"
            			},
            			"dimension" : {
            			  "type" : "object",
            			  "description" : "Dimension's of Ad - Required Parameter for non-sprout Ads",
            			  "properties" : {
            				"height" : {
            				  "type" : "integer",
            				  "description" : "The Height of an Ad."
            				},
            				"width" : {
            				  "type" : "integer",
            				  "description" : "The Width of an Ad."
            				}
            			  }
            			},
            			"creativeType" : {
            			  "type" : "string",
            			  "description" : "Type of the Ad - Required Parameter for non-sprout Ads",
            			  "enum" : [ "EXPANDABLE", "INTERSTITIAL", "RICH_BANNER" ]
            			},
            			"contentProvider" : {
            			  "type" : "string",
            			  "description" : "Content Provider of the RM Script - Required Parameter for non-sprout Ads",
            			  "enum" : [ "SPROUT", "SELF", "OTHERS", "ADDROID", "CELTRA", "CRISP", "DOUBLECLICK", "FLASHTALKING", "FLITE", "MEDIALETS", "MEDIAMIND", "SIMPLYTICS", "VOXEL", "AARKI", "ADFORM", "ADMOTION", "ADOBE", "BLUESTREAK", "BONZAI", "EYEBLASTER", "EYEWONDER", "FIKSU", "GOLDSPOT", "GREYSSTIPE", "INNOVID", "JUSTAD", "MEDIABRIX", "NUANCE", "PHLUANT", "POINTROLL", "QUANTCAST", "RHYTHM", "SPARKFLOW", "SPONGECELL", "TELEMETRY", "TRUST_METRICS", "VDOPIA", "VINDICO" ]
            			},
            			"demandCapabilities" : {
            			  "type" : "array",
            			  "description" : "Capabilities Ad supports - Required Parameter for non-sprout Ads",
            			  "items" : {
            				"type" : "string",
            				"enum" : [ "AUDIO", "VIDEO", "ORIENTATION", "HTML5", "JS", "AUDIO_AUTOPLAY", "VIDEO_AUTOPLAY", "PLAYABLE", "MOAT", "NATIVE_VAST_V3" ]
            			  }
            			},
            			"altText" : {
            			  "type" : "string",
            			  "description" : "Alternate Text if the Ad is not available"
            			}
            		}
            	  },
            	  "lastModifiedOn" : {
            		"type" : "string",
            		"description" : "Response Only Field - The Last Modified date String in ISO-8601 Standards",
            		"example" : "2017-07-05T23:59:59"
            	  }
            	},
            	"required" : [ "name", "adGroupId", "adFormat" ]
            }
    	

    Use the following APIs for creative-related information:

    1. Create Creative - This API is used to create a collection of creatives under a specific accountId.
      • URL - https://api.inmobi.com/rso/ads
      • Headers - Refer to Passing the General Headers section.
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Example
        pageNum The page number from where the list needs to be retrieved Optional 5
        maxRecords The maximum number of records to be retrieved from the selected page Optional 57
      • HTTP Method - POST
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "name": "InMobiAPITestBannerAd1",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "adId": "225e28ad52a845dea7d8b08ce7d6b819",
        "status": "PENDING",
        "adFormat": "BANNER",
        "trackingCodes": [],
        "landingUrl": "https://www.inmobi.com/",
        "imageAsset": {
            "url": "http://i.l.inmobicdn.net/banners/FileData/36ca3863a6a24a6f8d9a92016c796c68.jpeg",
            "assetId": 2320981
        },
        "lastModifiedOn": "2017-06-12T11:11:25"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/ads \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -d '{
      "name": "InMobiAPITestBannerAd1",
      "adGroupId": "a59e83f1605d4c078347da495002d1c6",
      "adFormat": "BANNER",
      "landingUrl": "https://www.inmobi.com/",
      "imageAsset": {
        "assetId": 2320981
        }
      }
    }'
    			
    1. Fetch AdId - This API is used to fetch the creative corresponding to a specific adId.
    {
        "name": "InMobiAPITestBannerAd1",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "adId": "225e28ad52a845dea7d8b08ce7d6b819",
        "status": "ON_HOLD",
        "adFormat": "BANNER",
        "trackingCodes": [],
        "landingUrl": "https://www.inmobi.com/",
        "imageAsset": {
            "assetId": 2320981,
            "url" : "http://i.l.inmobicdn.net/banners/FileData/36ca3863a6a24a6f8d9a92016c796c68.jpeg"
        },
        "lastModifiedOn": "2017-06-12T11:23:03"
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/ads/225e28ad52a845dea7d8b08ce7d6b819 \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Archive AdId - This API is used to archive (soft delete) the creative corresponding to a specific adId.
    {
        "name": "InMobiAPITestAdGroup1",
        "campaignId": "ed0f7a5ae279435ea7f0c4f35147ad87",
        "startTime": "2017-06-09T00:00:00",
        "endTime": "2017-07-04T23:59:59",
        "status": "ARCHIVED",
        "clickDestination": "https://www.inmobi.com/",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "clickAction": "URL",
        "objective": "PROMOTE_CONTENT",
        "targeting": {
            "geoTargeting": {
                "geoTargetingDetails": [
                    {
                        "countryId": 94
                    }
                ]
            },
            "deviceTargeting": {
                "deviceTypeList": [
                    "SMART_PHONE",
                    "TABLET"
                ]
            },
            "scheduleTargeting": {
                "schedules": [
                    {
                        "dayOfWeek": "SUNDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "MONDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "TUESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "WEDNESDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "THURSDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "FRIDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    },
                    {
                        "dayOfWeek": "SATURDAY",
                        "ranges": [
                            {
                                "start": 0,
                                "end": 23
                            }
                        ]
                    }
                ]
            }
        },
        "pricing": {
            "priceType": "CPC",
            "bidValue": 1.45,
            "dailySpendLimit": 1000
        },
        "createdOn": "2017-06-09T08:43:08",
        "lastModifiedOn": "2017-06-11T18:33:46",
        "lastModifiedBy": "kishore.bandi@inmobi.com"
    }
    			
    curl -X DELETE \
      https://api.inmobi.com/rso/adgroups/a59e83f1605d4c078347da495002d1c6/ \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Fetch Creative Basic Entity - This API is used to fetch the basic entity of the creative corresponding to a specific adId and an accountId.
      • URL - https://api.inmobi.com/rso/ads/{adId}/basic
      • Headers - Refer to Passing the General Headers section.
      • JSON Schema for Creative Basic Entity
        {
                    "$schema": "http://json-schema.org/draft-06/schema",
                    "type" : "object",
                    "properties" : {
                      "name" : {
                        "type" : "string",
                        "description" : "Name of the Ad"
                      },
                      "adGroupId" : {
                        "type" : "string",
                        "description" : "Response Only Field - AdGroup under which this Ad needs to be created"
                      },
                      "adId" : {
                        "type" : "string",
                        "description" : "Response Only Field - The Ad Id that has been created/updated"
                      },
                      "status" : {
                        "type" : "string",
                        "enum" : [ "DRAFT", "ACTIVE", "PAUSED", "EXPIRED", "PENDING", "REJECTED", "ARCHIVED", "ON_HOLD" ],
                        "description" : "Response Only Field - The Status of the Ad"
                      },
                      "adFormat" : {
                        "type" : "string",
                        "enum" : [ "BANNER", "INTERSTITIAL", "RICHMEDIA" ],
                        "description" : "Response Only Field - Format of the Ad that is being created"
                      },
                      "trackingCodes" : {
                        "type" : "array",
                        "description" : "List of tracker that needs to be attached for the Ad",
                        "items" : {
                          "type" : "object",
                          "properties" : {
                            "value" : {
                              "type" : "string",
                              "description" : "The URL/Script of the tracker for the Ad"
                            },
                            "mode" : {
                              "type" : "string",
                              "enum" : [ "URL", "SCRIPT" ],
                              "description" : "The type against which tracker value can be validated"
                            },
                            "eventType" : {
                              "type" : "string",
                              "enum" : [ "CLICK", "IMPRESSION" ],
                              "description" : "The type of tracker"
                            }
                          },
                          "required" : [ "value", "mode", "eventType" ]
                        }
                      },
                      "landingUrl" : {
                        "type" : "string",
                        "description" : "The Final page that needs to be displayed to user on clicking the Ad",
                        "maxSize" : 2048
                      },
                      "lastModifiedOn" : {
                        "type" : "string",
                        "description" : "Response Only Field - The Last Modified date String in ISO-8601 Standards",
                        "example" : "2017-07-05T23:59:59"
                      }
                    },
                    "required" : [ "name", "adGroupId", "adFormat" ]
                  }
        			
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Example
        AdId The adId whose details needs to be updated Mandatory DUMMY
      • HTTP Method - GET
      • Failure Scenario - Refer to Sample Error Response Code section.
    {
        "name": "InMobiAPITestBannerAd1",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "adId": "225e28ad52a845dea7d8b08ce7d6b819",
        "status": "ON_HOLD",
        "adFormat": "BANNER",
        "trackingCodes": [],
        "landingUrl": "https://www.inmobi.com/",
        "lastModifiedOn": "2017-06-12T11:23:03"
    }
    			
    curl -X GET \
      https://api.inmobi.com/rso/ads/225e28ad52a845dea7d8b08ce7d6b819/basic \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    			
    1. Update Creative Basic Entity - This API is used to update the details of the basic entity of a creative under a specific adId and an accountId.
    {
        "name": "InMobiAPITestBannerAd1",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "adId": "225e28ad52a845dea7d8b08ce7d6b819",
        "status": "PENDING",
        "adFormat": "BANNER",
        "trackingCodes": [],
        "landingUrl": "https://www.inmobi.com/rso",
        "lastModifiedOn": "2017-06-12T12:10:07"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/ads/225e28ad52a845dea7d8b08ce7d6b819/basic \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -d '{
      "name": "InMobiAPITestBannerAd1",
      "adGroupId": "a59e83f1605d4c078347da495002d1c6",
      "adFormat": "BANNER",
      "landingUrl": "https://www.inmobi.com/rso"
    }'
    			
    1. Change Creative Status - This API is used to change the status of a creative. It can be used to pause a running creative, activate a paused creative, and archive a creative, among others.
    {
        "name": "InMobiAPITestBannerAd1",
        "adGroupId": "a59e83f1605d4c078347da495002d1c6",
        "adId": "225e28ad52a845dea7d8b08ce7d6b819",
        "status": "PAUSED",
        "adFormat": "BANNER",
        "trackingCodes": [],
        "landingUrl": "https://www.inmobi.com/",
        "imageAsset": {
            "assetId": 2320981
        },
        "lastModifiedOn": "2017-06-12T11:23:03"
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/ads/status \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: application/json' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -d '{
      "entityId":"225e28ad52a845dea7d8b08ce7d6b819",
      "newStatus":"PAUSED"
    }'
    			
    Asset

    Use the following APIs for asset-related information:

    1. Upload Images - This API is used to upload images with content-type "multipart/form-data". The image is present under formDataParam_name as "file".
    {
        "assetId": 2320981,
        "name": "320x50.jpg",
        "assetType": "IMAGE",
        "assetUrl": "http://i.l.inmobicdn.net/banners/FileData/36ca3863a6a24a6f8d9a92016c796c68.jpeg",
        "dimension": {
            "height": 50,
            "width": 320
        },
        "sizeInBytes": 8866
    }
    			
    curl -X POST \
      https://api.inmobi.com/rso/assets/images \
      -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \
      -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
      -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \
      -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97' \
      -H 'userid: kishore.bandi@inmobi.com' \
      -F file=@320x50.jpg
    			
    Metadata API Calls

    These API calls are made to fetch metadata information.

    Note:

    1. Almost all metadata endpoints return a Id-Name pair as result
    2. Most of the endpoints support a name Query Parameter to filter specific values

    JSON Schema for Handset Entity

    {
            "type" : "object",
            "$schema": "http://json-schema.org/draft-06/schema",
            "properties" : {
              "handsetId" : {
                "type" : "integer",
                "description" : "The handset Id which InMobi needs in AdGroup Request"
              },
              "handsetName" : {
                "type" : "string",
                "description" : "The Name of the Handset"
              },
              "handsetModelNumber" : {
                "type" : "string",
                "description" : "The Model number of the Handset against which name search can be performed"
              },
              "handsetManufacturer" : {
                "type" : "string",
                "description" : "The Manufacturer of the Handset"
              }
            }
          }
    	

    JSON Schema for City Entity

    {
                    "type" : "object",
                    "$schema": "http://json-schema.org/draft-06/schema",
                    "properties" : {
                      "id" : {
                        "type" : "integer",
                        "description" : "The City Id which InMobi needs in AdGroup Request"
                      },
                      "name" : {
                        "type" : "string",
                        "description" : "The name of the City"
                      },
                      "stateId" : {
                        "type" : "integer",
                        "description" : "The state Id to which this city belongs to"
                      }
                    }
                  }
    	

    JSON Schema for Operating System Entity

    {
                          "type" : "object",
                          "$schema": "http://json-schema.org/draft-06/schema",
                          "properties" : {
                            "osId" : {
                              "type" : "integer",
                              "description" : "The Operating System Id which InMobi needs in AdGroup Request"
                            },
                            "osName" : {
                              "type" : "string",
                              "description" : "The Operating System Name"
                            },
                            "osVersions" : {
                              "type" : "array",
                              "items" : {
                                "type" : "string",
                                "description" : "All the supported versions of this Operating System"
                              }
                            }
                          }
                        }
    	

    Metadata API calls are classified in following types:

    APIs for App and Brand
    1. Fetch Metadata List - This API is used to fetch the list of supported metadata calls.

      Note: This is a relative path. These endpoints should be appended after the parent path.

      { "items": [ "/manufacturers", "/manufacturers/{manufacturerId}", "/manufacturers/{manufacturerId}/handsets", "/handsets", "/handsets/{handsetId}", "/os", "/os/{osId}", "/segments/behavioural", "/segments/demog", "/countries", "/countries/{countryId}/states", "/states/{stateId}/cities", "/countries/{countryId}/cities", "/countries/{countryId}/carriers" ] }
      curl -X GET \ https://api.inmobi.com/rso/metadata \ -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \ -H 'content-type: application/json' \ -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \ -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    2. Fetch Supported Manufacturers - This API is used to fetch the list of supported manufacturers.

      Note: If a specific manufacturer name is provided in the queryParam, only the data matching with that name would be retrieved.

      { "items": [ { "id": 7, "name": "Samsung" } ] }
      curl -X GET \ https://api.inmobi.com/rso/metadata/manufacturers?name=samsung \ -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \ -H 'content-type: application/json' \ -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \ -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    3. Fetch ManufacturerId - This API is used to fetch the name of the manufacturer, from a manufacturerId.
      { "id": 7, "name": "Samsung" }
      curl -X GET \ https://api.inmobi.com/rso/metadata/manufacturers/7 \ -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \ -H 'content-type: application/json' \ -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \ -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    4. Fetch Handset Models from ManufacturerId - This API is used to fetch the list of handset models, from a manufacturerId.

      Note: If a specific handset model is provided in the queryParam, only the data matching with that model under the given manufacturerId would be retrieved.

      • URL - https://api.inmobi.com/rso/metadata/manufacturers/{manufacturerId}/handsets
      • URI Parameters - DUMMY
        Parameter Name Description Mandatory/Optional Type
        ManufacturerId The manufacturerId whose details need to be searched, for the handset model Mandatory String
      • HTTP Method - GET
      • Query Parameters - DUMMY
        Query Name Description Mandatory/Optional Type Example
        name The model number with which the handsets need to be searched Optional String SM-G930A
      • Failure Scenario - Refer to Sample Error Response Code section.
      { "items": [ { "handsetId": 60295, "handsetName": "Galaxy S7", "handsetModelNumber": "SM-G930A", "handsetManufacturer": "Samsung" }, { "handsetId": 57560, "handsetName": "Galaxy S6 Edge Plus", "handsetModelNumber": "SM-G928P", "handsetManufacturer": "Samsung" }, { "handsetId": 57324, "handsetName": "Galaxy Core Prime", "handsetModelNumber": "SM-G360V", "handsetManufacturer": "Samsung" }, { "handsetId": 49133, "handsetName": "Galaxy Tab Pro 8.4", "handsetModelNumber": "SM-T320", "handsetManufacturer": "Samsung" }, { "handsetId": 57335, "handsetName": "Gakaxt S Duos 3", "handsetModelNumber": "SM-G316ML", "handsetManufacturer": "Samsung" }, { "handsetId": 57341, "handsetName": "Galaxy Ace Style", "handsetModelNumber": "SM-G310HN", "handsetManufacturer": "Samsung" } ] }
      curl -X GET \ https://api.inmobi.com/rso/metadata/manufacturers/7/handsets \ -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \ -H 'content-type: application/json' \ -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \ -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    5. Fetch Handset List of Manufacturer - This API is used to fetch the list of all handsets of a manufacturer, from a handset model.

      Note: If a handset model is provided in the queryParam, list of all handsets from the same manufacturer matching would be retrieved.

      { "items": [ { "handsetId": 60295, "handsetName": "Galaxy S7", "handsetModelNumber": "SM-G930A", "handsetManufacturer": "Samsung" }, { "handsetId": 57560, "handsetName": "Galaxy S6 Edge Plus", "handsetModelNumber": "SM-G928P", "handsetManufacturer": "Samsung" }, { "handsetId": 57324, "handsetName": "Galaxy Core Prime", "handsetModelNumber": "SM-G360V", "handsetManufacturer": "Samsung" }, { "handsetId": 49133, "handsetName": "Galaxy Tab Pro 8.4", "handsetModelNumber": "SM-T320", "handsetManufacturer": "Samsung" }, { "handsetId": 57335, "handsetName": "Gakaxt S Duos 3", "handsetModelNumber": "SM-G316ML", "handsetManufacturer": "Samsung" }, { "handsetId": 57341, "handsetName": "Galaxy Ace Style", "handsetModelNumber": "SM-G310HN", "handsetManufacturer": "Samsung" } ] }
      curl -X GET \ https://api.inmobi.com/rso/metadata/handsets \ -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \ -H 'content-type: application/json' \ -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \ -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    6. Fetch Handset Details from HandsetId - This API is used to fetch the details of a handset model from a handsetId.
      { "handsetId": 60295, "handsetName": "Galaxy S7", "handsetModelNumber": "SM-G930A", "handsetManufacturer": "Samsung" }
      curl -X GET \ https://api.inmobi.com/rso/metadata/handsets/60295 \ -H 'accountId: 5a5f7a5b94e441a8b0eeef9b301eb7bd' \ -H 'content-type: application/json' \ -H 'secretKey: d32ad3e3ff612342bfb5m28seecebf9a' \ -H 'sessionId: 79a30e4cab6549d7af9e7a34b93e6e97'
    7. Fetch Cou