Viewing Sample Actuals (Advertiser Details) Request & Response

Here, we present some example API requests and responses using the /publisher/stats/ controller and the StatAdvertiser data model. You can use these as a starting point when assembling reports similar to the Advertiser Overview Report.

Servicing TUNE Partners API Requests and Responses

Count Records: /publisher/stats/count.json

partners_api_action_count

URL Request

https://api.mobileapptracking.com/v2/publisher/stats/count.json?
&start_date=02/07/2015
&end_date=02/07/2015
&response_timezone=America/Los_Angeles
&filter=(advertiser_id=####)
&session_token=[Session Token from API Key]

JSON Response

{  
   status_code:200,
   response_size:"50",
   data:24
}

Stream Report: /publisher/stats/find.json

partners_api_action_find

URL Request

https://api.mobileapptracking.com/v2/publisher/stats/find.json?
api_key=[API KEY]
&fields=timestamp,ad_impressions,ad_impressions_unique,ad_clicks,
  ad_clicks_unique,installs,ir,paid_installs_assists,
  paid_installs_total,assist_rate,contribution_rate,site_id,
  site.name
&group=timestamp,site_id
&filter=(advertiser_id=####)
&response_timezone=America/Los_Angeles
&start_date=2015-02-02
&end_date=2015-02-02
&timestamp=date
&page=1
&sort[timestamp]=asc
&limit=20

JSON Response

{  
   status_code:200,
   response_size:"1140",
   data:[  
      {  
         site_id:69080,
         advertiser_id:3080,
         timestamp:"2015-02-02",
         ad_impressions:"0",
         ad_impressions_unique:"0",
         ad_clicks:"29",
         ad_clicks_unique:"27",
         installs:"2",
         ir:"7.4074",
         paid_installs_assists:"0",
         paid_installs_total:"2",
         assist_rate:"0.00",
         contribution_rate:"7.41",
         date_hour:"2015-02-02 00:00:00",
         site:{  
            name:"Goal One - DFB - iOS"
         }
      },
      {  
         site_id:58930,
         advertiser_id:3080,
         timestamp:"2015-02-02",
         ad_impressions:"0",
         ad_impressions_unique:"0",
         ad_clicks:"11",
         ad_clicks_unique:"11",
         installs:"2",
         ir:"18.1818",
         paid_installs_assists:"1",
         paid_installs_total:"3",
         assist_rate:"9.09",
         contribution_rate:"27.27",
         date_hour:"2015-02-02 00:00:00",
         site:{  
            name:"Goal One - DFB - Android"
         }
      },
      {  
         site_id:67916,
         advertiser_id:3080,
         timestamp:"2015-02-02",
         ad_impressions:"0",
         ad_impressions_unique:"0",
         ad_clicks:"3",
         ad_clicks_unique:"3",
         installs:"0",
         ir:"0.0000",
         paid_installs_assists:"0",
         paid_installs_total:"0",
         assist_rate:"0.00",
         contribution_rate:"0.00",
         date_hour:"2015-02-02 05:00:00",
         site:{  
            name:"BAM! Battles and Monsters - iOS"
         }
      }
   ]
}

Export Report to Queue: /publisher/stats/export.json

partners_api_action_find_export_queue

URL Request

https://api.mobileapptracking.com/v2/publisher/stats/export.json?
fields=timestamp,ad_impressions,ad_impressions_unique,
  ad_clicks,ad_clicks_unique,installs,ir,paid_installs_assists,
  paid_installs_total,assist_rate,
  contribution_rate,site_id,site.name
&group=timestamp,site_id
&filter=(advertiser_id=####)
&response_timezone=America/Los_Angeles
&start_date=02/07/2015
&end_date=02/07/2015
&timestamp=date
&sort[timestamp]=asc
&session_token=[Session Token from API Key]

JSON Response

{  
   status_code:200,
   response_size:"83",
   data:"dummy7276eaca536db9929d1c1fdummy"  << Job ID of Report on Export Queue
}

Report Export Status and Download from Queue: /publisher/stats/status.json

partner_api_export_action_download

URL Request

https://api.mobileapptracking.com/v2/publisher/stats/status.json?
job_id=dummy7276eaca536db9929d1c1fdummy          << Job ID of Report on Export Queue
&session_token=[Session Token from API Key]

JSON Response

{  
   status_code:200,
   response_size:"408",
   data:{  
      status:"complete",
      percent_complete:100,
      data:{  
         format:"csv",
           << Report Download URL from AWS S3
         url:"https://s3.amazonaws.com/hasfiles/tmp/########-########-########.csv?response-content-disposition=attachment%3B%20filename%3D%22tmp%2F########-########-########.csv%22&AWSAccessKeyId=########&Expires=########&Signature=########%2F########%2F########%3D"
      }
   }
}
Have a Question? Please contact support@tune.com for technical support.