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.
Send the report requests via HTTP GET requests, to the following base URL: http://api.inmobi.com/reporting/performance
Before querying the API, valid session_id is required. Below are the steps to obtain session_id:
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": []
}
session_id
generated in the previous step while authentication.Scroll to Allowed Columns section for the list of columns that are queryable.
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".
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 |
Data can be obtained from API in following three steps:
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
}
]
}
}
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"
}
}
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
tar -xvzf /preferred_location/folder/file_name.zip
If you are migrating from the InMobi advertiser reporting API 1.1, please refer to documentation here