Reporting API old

From POKKT DOCUMENTATION
Jump to: navigation, search

POKKT Reporting APIs Guide

REST APIs for Publisher and Advertiser Reports

Last Update: June 04, 2015 16:45

Download Latest Version Here Reporting APIs.


Overview

POKKT supports a reporting API over REST, which allows publishers to gain insights into several metrics pertaining to their respective apps. The API is secured using an encryption scheme based on a publisher's private API key, which prevents unauthorized users from accessing sensitive revenue/impressions data.


API EndPoints

All API requests are made relative to a Base URL

For the current API version, the Base URL is:http://report.pokkt.com

It is advised to URL encode all query parameter values, so that they are not accidentally misinterpreted.

Publishers

GET /reports/videoReport

The following query parameters must be present:

Query Parameter Type Possible Values / Example
appId Numeric 1000064
startDateTime SQL Timestamp 2015-05-17 00:00:00
endDateTime SQL Timestamp 2015-05-17 23:59:59
campaignFormType String video,interstitial,banner

The following request headers must be present:

Request Header Type Expected/Example Value
Content-Type String application/json
Security-Timestamp Date String EEE, dd MMM yyyy HH:mm:ss zzz (Tue, 26 May 2015 11:52:12 GMT)
Security-Token URL checksum Encrypted checksum using API key
User-Email Email Registered Email

Example

GET http://report.pokkt.com/reports/videoReport? appID=1000064&startDateTime=2015-05-17+00%3A00%3A00&endDateTime=2015-05-17+23%3A59%3A59&campaignFormType=Video

Request Headers:

Content-Type: application/json

Security-Timestamp: Tue, 26 May 2015 11:52:12 GMT

Security-Token: K22kDb8SK/2HPEwVV3gjHSrKvR2ebLIf7WKLOWFAW54=

User-Email: email@example.com

Publishers country wise report

GET /reports/countryVideoReport

The following query parameters must be present:

Query Parameter Type Possible Values / Example
appId Numeric 1000064
startDateTime SQL Timestamp 2015-05-17 00:00:00
endDateTime SQL Timestamp 2015-05-17 23:59:59
campaignFormType String video,interstitial,banner

The following request headers must be present:

Request Header Type Expected/Example Value
Content-Type String application/json
Security-Timestamp Date String EEE, dd MMM yyyy HH:mm:ss zzz (Tue, 26 May 2015 11:52:12 GMT)
Security-Token URL checksum Encrypted checksum using API key
User-Email Email Registered Email

Example

GET http://report.pokkt.com/reports/videoReport? appID=1000064&startDateTime=2015-05-17+00%3A00%3A00&endDateTime=2015-05-17+23%3A59%3A59&campaignFormType=Video

Request Headers:

Content-Type: application/json

Security-Timestamp: Tue, 26 May 2015 11:52:12 GMT

Security-Token: K22kDb8SK/2HPEwVV3gjHSrKvR2ebLIf7WKLOWFAW54=

User-Email: email@example.com

Advertisers

GET /reports/videoBackendReport

The following query parameters must be present:

Query Parameter Type Possible Values / Example
startDateTime SQL Timestamp 2015-05-17 00:00:00
endDateTime SQL Timestamp 2015-05-17 23:59:59
campaignFormType String video,interstitial,banner

The following request headers must be present:

Request Header Type Expected/Example Value
Content-Type String application/json
Security-Timestamp Date String EEE, dd MMM yyyy HH:mm:ss zzz (Tue, 26 May 2015 11:52:12 GMT)
Security-Token URL checksum Encrypted checksum using API key
User-Email Email Registered Email

Example

GET http://report.pokkt.com/reports/videoBackendReport?startDateTime=2015-05-17+00%3A00%3A00&endDateTime=2015-05-17+23%3A59%3A59&campaignFormType=Video

Request Headers:

Content-Type: application/json

Security-Timestamp: Tue, 26 May 2015 11:52:12 GMT

Security-Token: K22kDb8SK/2HPEwVV3gjHSrKvR2ebLIf7WKLOWFAW54=

User-Email: email@example.com

GET /reports/offerWallReport

The following query parameters must be present:

Query Parameter Type Example
startDateTime SQL Timestamp 2015-05-17 00:00:00
endDateTime SQL Timestamp 2015-05-17 23:59:59

The following request headers must be present:

Request Header Type Expected/Example Value
Content-Type String application/json
Security-Timestamp Date String EEE, dd MMM yyyy HH:mm:ss zzz (Tue, 26 May 2015 11:52:12 GMT)
Security-Token URL checksum Encrypted checksum using API key
User-Email Email Registered Email

Example

GET http://report.pokkt.com/reports/offerWallReport?startDateTime=2015-05-17+00%3A00%3A00&endDateTime=2015-05-17+23%3A59%3A59

Request Headers:

Content-Type: application/json

Security-Timestamp: Tue, 26 May 2015 11:52:12 GMT

Security-Token: K22kDb8SK/2HPEwVV3gjHSrKvR2ebLIf7WKLOWFAW54=

User-Email: email@example.com


Integration Guide

POKKT has provided integration libraries in Java and PHP, which developers can use in their projects for easily fetching report data from our API servers. These libraries will take care of encryption and token generation for all requests.

Java Guide

Unzip the provided rest_client_jar.zip and add rest-client.jar to your project's (JDK 1.6+) classpath (the other jar files must also be present in the same folder, but they need not be explicitly declared in your classpath). The library is used as follows:

Publishers

import com.fasterxml.jackson.databind.JsonNode;
import com.pokkt.pokktfeed.POKKTPublisherReport;
POKKTPublisherReport report= new POKKTPublisherReport("your api key", "your registered email");
JsonNode result = report.getVideoReport(L, "2015-05-17 00:00:00", "2015-05-17 23:59:59");

System.out.println(result.toString());

Output:

{"status":1,"message":"OK","response":
{"revenue":"266.856740669813","success":"43926","impressions":"53199","requests":"177943","users":"26938"}}

Advertisers

import com.fasterxml.jackson.databind.JsonNode;
import com.pokkt.pokktfeed.POKKTAdvertiserReport;
POKKTAdvertiserReport report= new POKKTAdvertiserReport("your api key", "your registered email");
JsonNode result = report.getVideoBackendReport("2015-05-17 00:00:00", "2015-05-17 23:59:59");

System.out.println(result.toString());

Output:

{"status":1,"message":"OK","response":
{"cost":"637.2418","success":"311450","impressions":"699874","conversion":"44.5009"}}
JsonNode result = report.getOfferWallReport("2015-05-17 00:00:00", "2015-05-17 23:59:59");

System.out.println(result.toString());

Output:

{"status":1,"message":"OK","response":
{"cost":"846.46102","clicks":"34895","transactions":"9146","conversion":"26.2101"}}

PHP Guide

Unzip the provided rest-client.zip and add the rest-client folder to your project. The library is used as follows:

Publishers

<?php
require_once 'PublisherReportREST.php';
$publisher_report = new PublisherReportREST('your api key', 'your registered email');
print_r($publisher_report->getVideoReport(, '2015-05-17 00:00:00','2015-05-17 23:59:59'));

Output:

Array
(
   [status] => 1
   [message] => OK
   [response] => Array
      (
         [revenue] => 266.856740669813
         [success] => 43926
         [impressions] => 53199
         [requests] => 177943
         [users] => 26938
      )
)

Advertisers

<?php
require_once 'AdvertiserReportREST.php';
$advertiser_report = new AdvertiserReportREST('your api key', 'your registered email');
print_r($advertiser_report->getVideoBackendReport('2015-05-17 00:00:00', '2015-05-17 23:59:59'));

Output:

Array
(
   [status] => 1
   [message] => OK
   [response] => Array
      (
         [cost] => 637.2418
         [success] => 311450
         [impressions] => 699874
         [conversion] => 44.5009
      )
)

print_r($advertiser_report->getOfferWallReport('2015-05-17 00:00:00', '2015-05-17 23:59:59'));

Output:

Array
(
   [status] => 1
   [message] => OK
   [response] => Array
      (
         [cost] => 846.46102
         [clicks] => 34895
         [transactions] => 9146
         [conversion] => 26.2101
      )
)