Advertiser Reporting API Guide

You can use this advertiser reporting API to get performance spend data in .CSV format. The following structure illustrates the data model being followed by InMobi.

Request Format

Send the report requests via HTTP GET requests, to the following base URL: http://api.inmobi.com/reporting/performance

Authentication

Before querying the API, valid session_id is required. Below are the steps to obtain session_id:

  1. Generate and copy API key from Account Settings section in InMobi Portal

    Note: To generate session_id, you need to send a HTTP GET request with API Key as secretkey and InMobi Portal username (email id) as parameter to this base URL: http://api.inmobi.com/v1.0/generatesession/generate

curl -X GET http://api.inmobi.com/v1.0/generatesession/generate \
-H 'secretkey: abcdef3187tyghji88352abcdefw0548' \
-H 'username: sample.name@domain.com' \
-H 'subAccountTypeId: -1'
			
{
  "respList": [
    {
      "sessionId": "123418a55c3845111234150c3f4b1234",
      "accountId": "1234cb8b2b1234cb012b184211b21234",
      "subAccounts": [
        {
          "subAccountId": "12346301ce4b4b123440677c136e1234",
          "subAccountType": "AGENCY"
        }
      ]
    }
  ],
  "error": false,
  "errorList": []
}
			
  1. A session is valid for 24 hours from the time of issue.

Mandatory Parameters

  • session_id - The session_id generated in the previous step while authentication.
  • start - The start date of the report in 'YYYY-MM-DD' format. The date must not be earlier than 90 days from the date of query.
  • end - The end date of the report in ‘YYYY-MM-DD’ format. The date must not be later than 1 day before the date of query, with a delay of 6 hours (UTC).
  • columns - It is a comma-separated list of columns for the report. For example - day, campaign_name, adgroup_name.

    Scroll to Allowed Columns section for the list of columns that are queryable.

Optional Parameters

  • filter_(column_name) - Reports can be filtered by any string data type column mentioned in the Allowed Columns list below.

    To filter by a string column, add the following url parameter: filter_<column_name>=first_filter,second_filter,third_filter</column_name>. For example : If user wants data only for Android operating system, url parameter will be: "filter_operating_system=Android".

Allowed Columns

Column Name Definition Data Type
day Date of the event in UTC (Coordinated Universal Time) Date
advertiser_account Name of the advertiser account String
advertiser_app_id The bundle_id of the advertiser's app in the Play Store, which is being promoted String
campaign Name of the campaign String
campaign_id Id of the campaign String
ad_group name of the adgroup String
ad_group_id Id of the adgroup String
ad_creative Name of the creative String
ad_creative_id Id of the creative String
landing_page_url The Play Store URL to which the creative will redirect, after you click on the ad String
country Country in which the ad was shown String
operating_system Operating system of the device on which the ad was shown String
os_version Operating system version of the device on which the ad was shown String
ad_format Format of the ad shown (BANNER, NATIVE, RICH_MEDIA_INTERSTITIAL, STATIC_INTERSTITIAL, VIDEO) String
supply_app Name of the publisher app on which the ad was shown String
supply_app_id Play Store bundle id of the publisher app on which the ad was shown String
supply_app_url Play Store URL of the publisher app on which the ad was shown String
supply_app_site_id Hashed id of the site (term used to refer to a page in the supply app) String
impressions Number of impressions Numeric
clicks Number of clicks Numeric
downloads Number of advertiser app installs Numeric
spend Advertiser spend (in US dollars) Numeric
ctr Percentage of (number of clicks / number of impressions) Numeric

Example

Data can be obtained from API in following three steps:

  1. Querying data - Job id will be returned in response
curl -X GET 'http://api.inmobi.com/reporting/performance?start=2018-01-26&end=2018-01-27&columns=day,advertiser_account,advertiser_app_id,campaign,campaign_id,clicks,spend' \
 -H 'accountid: 1234cb8b2b1234cb012b184211b21234' \
 -H 'secretkey: abcdef3187tyghji88352abcdefw0548' \
 -H 'sessionid: 123418a55c3845111234150c3f4b1234'
			
{
  "data": {
    "resource_info": [
      {
        "job_id": 123470
      }
    ]
  }
}
			
  1. Checking the status of the job using job id - Started, Queued, Completed or Failed
curl -X GET \
  'http://api.inmobi.com/reporting/performance/job_info?job_id=123470' \
  -H 'accountid: 1234cb8b2b1234cb012b184211b21234' \
  -H 'secretkey: abcdef3187tyghji88352abcdefw0548' \
  -H 'sessionid: 123418a55c3845111234150c3f4b1234'
			
{
  "data": {
    "completed_on": "2018-01-30 09:53:48",
    "final_job_status": {
      "status": "Completed",
      "status_description": "Done"
    },
    "id": 123470,
    "submitted_by": "sample.name@domain.com",
    "submitted_on": "2018-01-30T09:53:41"
  }
}
			
  1. Downloading the data - When the status of the job becomes completed, the data can be downloaded with following request
curl -X GET \
  'http://api.inmobi.com/reporting/performance/download?job_id=123470' \
  -H 'accountid: 1234cb8b2b1234cb012b184211b21234' \
  -H 'secretkey: abcdef3187tyghji88352abcdefw0548' \
  -H 'sessionid: 123418a55c3845111234150c3f4b1234' \
  -o /preferred_location/folder/file_name.zip
	
  1. Extracting the CSV from the downloaded zip file:
tar -xvzf /preferred_location/folder/file_name.zip
	

Migrating from Older Version

If you are migrating from the InMobi advertiser reporting API 1.1, please refer to documentation here

このページは役に立ちましたか?

このページ

最終更新日: 03 Nov, 2023