Libring Reporting API v2

 

Warning
The version 1 of API is deprecated and it will be discontinued at the end of March.

Libring Reporting API allows you to collect all your normalized and organized reporting data from Libring Edge solution via REST API.

Request

https://api.libring.com/v2/reporting/get

Method

GET

Required Authorization

NameExample
token‘Authorization’=>”Token TOKEN_CODE”

Optional Parameters

ParameterTypeDescriptionExample
periodStringOptions allowed:

  • yesterday (default)
  • last_week
  • last_month
  • custom_date

By default, it will be yesterday.

“yesterday”
start_dateStringWhen you select “custom_date” you must inform this value. Format YYYY-MM-DD.“2016-04-10”
end_dateStringWhen you select “custom_date” you must inform this value. Format YYYY-MM-DD. Must be higher than Start Date“2016-04-12”
group_byStringSegment your data by:

  • date (default)
  • connection
  • app
  • platform
  • ad_type
  • ad_format
  • custom_1
  • custom_2
  • custom_3
  • custom_4
  • campaign
  • ad
  • ctm
  • country

Separate group_by parameters with comma. The reporting data will always be grouped at least by date.

“connection,country”
data_typeStringOptions allowed:

  • all (default)
  • acquisition
  • adnetwork
  • usage
  • appstore

Separate data_type parameters with comma.

“acquisition”
filterStringDefault required:
name:value;name;value

Allowed names:

  • connection
  • app
  • platform
  • ad_type
  • ad_format
  • custom_1
  • custom_2
  • custom_3
  • custom_4
  • campaign
  • ad
  • ctm
  • country

You may use wildcard character “%” to search for parts of words. If you use more than one expression, the API will search for both values (AND concatenation), for example, “app AND platform” and not “app OR platform”.

PS: If you need to use space, use the symbol %20 and not only %, example: filter[]=platform:Apple%20Search

“filter[]=platform:Android”
“filter[]=platform:And%”
“filter[]=app:MyApp&filter[]=platform:iOS”

Metrics (Response)

FieldTypeSourceDescription
impressionsIntegerAdnetworkTotal number of impressions.
clicksIntegerAdnetworkTotal number of clicks.
requestsIntegerAdnetworkTotal number of requests.
conversionsIntegerAdnetworkTotal number of conversions.
completionsIntegerAdnetworkTotal number of conversions.
ad_revenueDecimalAdnetworkTotal adnetworks revenue.
ad_gross_revenueDecimalAdnetworkTotal of adnetworks gross revenue.
fill_rateDecimalAdnetworkCalculated Fill Rate (Impressions/Requests).
ad_cpmDecimalAdnetworkCalculated CPM (Revenue/(Impressions/1000)).
ctrDecimalAdnetworkCalculated CTR (Clicks/Impressions).
iap_revenueDecimalAppstoreTotal IAP revenue.
iap_revenue_grossDecimalAppstoreTotal IAP revenue gross.
downloadsIntegerAppstoreTotal number of downloads.
returnsIntegerAppstoreTotal number of returns.
updatesIntegerAppstoreTotal number of updates.
hitsIntegerUsageTotal number of hits.
user_sessionsIntegerUsageTotal number of user sessions.
new_usersIntegerUsageTotal number of unique new users.
dauIntegerUsageTotal number of dau.
mauIntegerUsageTotal number of mau.
spentDecimalAcquisitionTotal number of spent.
acq_impressionsIntegerAcquisitionTotal number of impressions.
acq_clicksIntegerAcquisitionTotal number of clicks.
acq_requestsIntegerAcquisitionTotal number of requests.
acq_installsIntegerAcquisitionTotal number of installs.
acq_completionsIntegerAcquisitionTotal number of conversions.

Pagination

If your response has more than 1000 rows the API will return the data in multiple pages following the structure detailed below:

First page:

https://api.libring.com/v2/reporting/get
{
  "data": {
    "request_time": "2016-04-10 20:30:10",
    "total_rows": 1800,
    "current_rows": 1000,
    "total_pages": 2,
    "current_page": 1,
    "next_page_url": "https://api.libring.com/v2/reporting/get?page=2",
    "connections": [
      { ... }
    ]
  }
}

Second page:

https://api.libring.com/v2/reporting/get?page=2
{
  "data": {
    "request_time": "2016-04-10 20:30:10",
    "total_rows": 800,
    "current_page_rows": 300,
    "total_pages": 2,
    "current_page": 2,
    "next_page_url": "",
    "connections": [
      { ... }
    ]
  }
}

Request Example

https://api.libring.com/v2/reporting/get?period=custom_date&start_date=2016-04-10&end_date=2016-04-15&data_type=adnetwork,acquisition&group_by=date,connection

Response Examples

Responses will be in JSON format.

No data found

{
  "data": {
    "request_time": "2016-04-10 20:30:10",
    "total_rows": 0,
    "current_page_rows": 0,
    "total_pages": 1,
    "current_page": 1,
    "next_page_url": "",
    "connections": []
  }
}

Data found

{
  "data": {
    "request_time": "2016-04-10 20:30:10",
    "total_rows": 1,
    "current_page_rows": 3,
    "total_pages": 1,
    "current_page": 1,
    "next_page_url": "",
    "connections": [
      {
        "date": "2016-04-16",
        "segment": "adnetwork",
        "connection": "AdMob",
        "app": "My Game 1",
        "platform": "iOS",
        "ad_type": "Banner",
        "ad_format": "500x500",
        "country": "Brazil",
        "ad": "",
        "campaign:" "",
        "impressions": 100,
        "clicks": 34,
        "requests": 300,
        "conversions": 2,
        "ad_revenue": 10.56,
        "ad_revenue_gross": 12.56,
        "completions": 34,
        "conversions": 300,
        "fill_rate": 1,
        "ctr": 1,
        "ad_cpm": 1,
        "downloads": 0,
        "updates": 0,
        "returns": 0,
        "iap_revenue": 0,
        "iap_revenue_gross": 0,
        "hits": 0,
        "user_sessions": 0,
        "new_users": 0,
        "spent": 0,
        "acq_requests": 0,
        "acq_clicks": 0,
        "acq_impressions": 0,
        "acq_conversions": 0,
        "acq_completions": 0
      }
    ]
  }
}

Response

HTTP Status
200 OKPositive response, all fine
400 Bad RequestError – If required parameter not provide
401 UnauthorizedError – When the api_token is not valid

Examples

require “net/https”
require “uri”

uri = URI.parse(“https://api.libring.com/v2/reporting/get”)

https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true

req = Net::HTTP::Get.new(uri.request_uri, initheader = {‘Content-Type’ =>’application/json’, ‘Authorization’ => ‘Token 1043tL2eZvKYlo2CSU3Tbnci’})

resp = https.request(req)

$access_token = “VqQGAfdeTNAKYgwOFiaoqGkgCrrI”;

$headers = array(‘Authorization: Token ‘ . $access_token);

$ch_subs = curl_init();
curl_setopt($ch_subs, CURLOPT_URL, ‘https://api.libring.com/v2/reporting/get’);
curl_setopt($ch_subs, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch_subs, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch_subs, CURLOPT_POST, 0);
curl_setopt($ch_subs, CURLOPT_HTTPHEADER, $headers);

echo curl_exec($ch_subs);

curl_close($ch_subs);

import requests

r = requests.get(“https://api.libring.com/v2/reporting/get?&period=custom_date&start_date=2016-10-10&end_date=2016-10-11&group_by=date,connection,app,platform,country”, headers={“Authorization”:”Token feasvJ3gLU5cfx7UuzzfEVmhmvRfC”, “content-type”: “application/json”});

r.text

Insert Your Information:

×
mautic is open source marketing automation