Reporting API Guide for Partners (old)

281 views 2018-02-12 Ofer Garnett 0

1. Objective

This document provides directions on how to access YouAppi’s reporting API for publishers.

2. API Request

2.1 Request URL Format

Access to the YouAppi reporting API is via HTTP GET, using the following base URL:

https://prt.youappi.com/partner/report/{accesstoken}?

{accesstoken} is a unique access token that will be provided to the publisher by YouAppi and will look similar to this: ab1c2de3-456f-78e9-h60d-2350f5fc722a. The publisher must replace the {accesstoken} placeholder in the above URL with the token provided.

2.2 Request Frequency

Please note that time between requests should not be less than 10 minutes.

Excessive requests will be rejected.

2.3 Request Parameters

The table below contains the parameters that may be included in the API request.

Parameter Name Description Mandatory Value Type Example
start

The start date of the data in the report. Please note:

· If the time of the request is between 00:00-12:00 UTC, then the earliest date available is the day before yesterday.

· If the time of the request is between 12:00-00:00 UTC, then the earliest date available is yesterday.

· Allowed format is: ‘YYYY-MM-DD’.

Yes String 2016-10-01
end

The end date of the data in the report. Please note:

· If the time of the request is between 00:00-12:00 UTC, then the earliest date available is the day before yesterday.

· If the time of the request is between 12:00-00:00 UTC, then the earliest date available is yesterday.

· This date cannot be further back than30 days.

· Allowed format is: ‘YYYY-MM-DD’.

Yes String 2016-10-01
groupBy The fields according to which the report should be broken down. Supports multiple values (case-sensitive!), separated by commas. The report will be sorted by the first “groupBy” attribute. (see example in section 2.4) No String

date

app

platform

country

publisher

2.4 Sample Request

The following is an example of the format of the request:

https://prt.youappi.com/partner/report/ab1c2de3-456f-78e9-h60d-2350f5fc722a?start=2016-10-01&end=2016-10-07&groupBy=date,country,app,platform

3. API Response

3.1 Response Format

The response of the API is in JSON format. YouAppi’s response looks like this:

{
      "status":200,
      "statusMessage":"OK ",
      "data":[
       {
         "date":"2016-10-01",
                  "country":"us",
                  "app":"com.ddi",
                  "platform":"android",
                  "impressions":10000,
                  "clicks":300,
                  "installs":25,
                  "revenue":57.5
       },
       {
                   "date":"2016-10-01",
                   "country":"us",
                   "app":"com.jellybtn.cashkingmobile",
                   "platform":"android",
                    "impressions":20000,
                    "clicks":600,
                    "installs":55,
                    "revenue":130
              }
    ],
        "warning":false,
        "errorJsonString":"{\"status\": 200, \"statusMessage\":\"OK \"}"
}

3.2 Available Attributes

The table below contains information about the parameters that are available in the response.

Field Name Description Mandatory Value Type Example
date The date of the data. Allowed format is: ‘YYYY-MM-DD’. No String 2016-12-03
country Two-letter country code No String us
app Package name or native app ID No String com.jellybtn.cashkingmobile
platform The relevant platform of the campaign. No String

android

iphone

ipad

impressions The number of impressions Yes Integer
clicks The number of clicks Yes Integer
installs The number of installs Yes Interger
revenue The partner’s spend in USD. Yes Integer

3.3 Error messages

Please note that the HTTP response code will always be 200. However, if you encountered an error, the value of the “status” field in the response will be 400.

There are few error messages that YouAppi can respond with:

  • Partner is not authorized
  • Reporting API is not enabled for this partner
  • Too frequent calls. Wait 10 minutes
  • Invalid groupBy attribute
  • Invalid Request. Missing Start/End date.
  • Invalid Request. End date must be greater than start date.
  • Processing more than 30 days is not allowed
  • Date format should be YYYY-MM-DD

 

The error will look like this:

{
    "status":400,
    "statusMessage":"ERROR Advertiser not authorized",
    "warning":false,
    "errorJsonString":"{\"status\": 400, \"statusMessage\":\"ERROR Advertiser not authorized\"}"
}

YouAppi can also respond with a Warning message rather than an error, in case the data returned exceeds the limit. In this case, we will respond with partial data and the following message:

{
    "code":12009,
    "description":"Partial data. Please narrow down the the data scope.",
    "severity":"WARNING"
}

For additional information and support please contact support@youappi.com.