Follow

Reporting API

Reporting API
Contents
[hide]

1 Overview
2 URI Structure
3 Response Format
4 API Method To Retrieve Authentication Token
4.1 get-token
5 API Methods To Retrieve Publisher Statistics
5.1 get-publisher-hourly-stats
5.2 get-publisher-daily-stats
5.3 get-publisher-monthly-stats
5.4 get-publisher-year-stats
6 API Methods To Retrieve Advertiser Statistics
6.1 get-advertiser-hourly-stats
6.2 get-advertiser-daily-stats
6.3 get-advertiser-monthly-stats
6.4 get-advertiser-year-stats

Overview

TapIt provides third party developers with the ability to request reporting metrics from the platform through a single REST API.

Each method request will return specific data, choose the method you need from the list, and generate a request according to the method description below.
URI Structure

In all cases, the HTTP method used is GET. The general URI structure for all of the Reporting API methods is as follows:

http://reporting.tapit.com/report/api_method_name&param1=param_value&param2=param_value&param3=param_value
api_method_name the name of the API method called. The detailed description of all API methods is given below.
param1, param2, param3 method parameters each preceded by the '&' symbol. The number of parameters depends on a certain method and may vary. You can specify values for available parameters but DO NOT forget to specify those that are required. The list of all the required and available parameters for each method is provided in a method description.
Response Format

All the Reporting API methods return HTTP responses in JSON. You can find samples of both successful and failure responses in a description for each method.
API Method To Retrieve Authentication Token

A User Authentication token is required in each request to the API.
get-token

This function returns a single-session token required to use in other API methods

Parameters:
Parameter Type Description Required?
email string E-Mail address registered with the account. required
password string Password for account. required
API Methods To Retrieve Publisher Statistics

A wide range of publisher statistics can be obtained by using API functions described below.
get-publisher-hourly-stats

This method returns statistics information for sites or zones for a user for the current day broken down by hour.

Parameters:
Parameter Type Description Required?
token string Token string returned from get-token method. required
zone_id integer The ID of the zone to get the data for; if not specified, the statistics for all the zones of a certain user will be returned. optional
site_id integer The ID of the site to get the data for; if not specified, the statistics for all the sites of a certain user will be returned. optional
date string The day for which to return stats. Format: YYYY-MM-DD, defaults to current day. optional
get-publisher-daily-stats

This method returns statistics information for sites or zones for a user for the current day broken down by hour.
get-publisher-monthly-stats

This method returns statistics information for sites or zones for a user for the current month broken down by day.
get-publisher-year-stats

This method returns statistics information for sites or zones for a user for the current year broken down by month.

Parameters:
Parameter Type Description Required?
token string Token string returned from get-token method. required
zone_id integer The ID of the zone to get the data for; if not specified, the statistics for all the zones of a certain user will be returned. optional
site_id integer The ID of the site to get the data for; if not specified, the statistics for all the sites of a certain user will be returned. optional
start_date string The start date for which to return stats. Format: YYYY-MM-DD, defaults to current day. optional*
end_date string The end date for which to return stats. Format: YYYY-MM-DD, defaults to current day. optional*
*NOTE: If using start_date or end_date in the request, BOTH parameters are required required

Request Sample:

Here is an example of HTTP request below. Replace 'token' with your token value returned from get-token.

Optionally, you can specify a certain site or zone to get a report for. Otherwise, you will get statistics for all the sites and zones of the specified user.

http://reporting.tapit.com/report/get-publisher-daily-stats/?token=12345ABCDE67890FGHIJ

Successful Response:

{"report":[{"zone_id":12345,"site_id":1120,"impressions":"1077","clicks":"0","requests":"10822","earnings":"2.34","date":"2011-09-07"}]}

The successful response contains the following elements:

Report:

• date - (string) the date string of the returned set of statistics
• site_id - (integer) the ID of the site to get the data for.
• zone_id - (integer) the ID of the zone to get the data for.
• impressions - (integer) the total number of impressions regarding a certain site/zone delivered for the specified date range.
• requests - (integer) the total number of requests regarding a certain site/zone made for the specified date range.
• clicks - (integer) the total number of clicks regarding a certain site/zone delivered for the specified date range.
• earnings - (float) the total number of revenue regarding a certain site/zone received from the campaign delivery for the specified date range.

API Methods To Retrieve Advertiser Statistics

A wide range of advertiser statistics can be obtained by using API functions described below.
get-advertiser-hourly-stats

This method returns statistics information for campaigns or creatives for a user for the current day broken down by hour.

Parameters:
Parameter Type Description Required?
token string Token string returned from get-token method. required
creative_id integer The ID of the zone to get the data for; if not specified, the statistics for all the creatives of a certain user will be returned. optional
campaign_id integer The ID of the campaign to get the data for; if not specified, the statistics for all the campaigns of a certain user will be returned. optional
date string The day for which to return stats. Format: YYYY-MM-DD, defaults to current day. optional
get-advertiser-daily-stats

This method returns statistics information for campaigns or creatives for a user for the current day broken down by hour.
get-advertiser-monthly-stats

This method returns statistics information for campaigns or creatives for a user for the current month broken down by day.
get-advertiser-year-stats

This method returns statistics information for campaigns or creatives for a user for the current year broken down by month.

Parameters:
Parameter Type Description Required?
token string Token string returned from get-token method. required
creative_id integer The ID of the zone to get the data for; if not specified, the statistics for all the creatives of a certain user will be returned. optional
campaign_id integer The ID of the campaign to get the data for; if not specified, the statistics for all the campaigns of a certain user will be returned. optional
start_date string The start date for which to return stats. Format: YYYY-MM-DD, defaults to current day. optional
end_date string The end date for which to return stats. Format: YYYY-MM-DD, defaults to current day. optional
*NOTE: If using start_date or end_date in the request, BOTH parameters are required required

Request Sample:

Here is an example of HTTP request below. Replace 'token' with your token value returned from get-token.

Optionally, you can specify a certain campaign or creative to get a report for. Otherwise, you will get statistics for all the campaigns and creatives of the specified user.

http://reporting.tapit.com/report/get-advertiser-daily-stats/?token=12345ABCDE67890FGHIJ

Successful Response:

{"report":[{"creative_id":12345,"campaign_id":1120,"impressions":"1077","clicks":"0","cost":"2.34","date":"2011-09-07"}]}

The successful response contains the following elements:

Report:

• date - (string) the date string of the returned set of statistics
• campaign_id - (integer) the ID of the campaign to get the data for.
• creative_id - (integer) the ID of the creative to get the data for.
• impressions - (integer) the total number of impressions regarding a certain campaign/creative delivered for the specified date range.
• clicks - (integer) the total number of clicks regarding a certain campaign/creative delivered for the specified date range.
• cost - (float) the total cost for clicks for a certain campaign/creative for the specified date range.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk