Protocol objects

class adpay.iface.proto.BannerObject[source]

Bases: jsonobject.api.JsonObject

BannerObject
Object Properties:
 
  • banner_id (string) – Unique banner identifier
  • banner_size (string) – Banner size, eg. 100x400
  • keywords (JSONObject) – Key-value map of keywords
JSON Example
{
    "keywords": "{JSONObject object}", 
    "banner_id": "mLTLONDVRhTcnnCowgPU", 
    "banner_size": "100x400"
}
banner_id

Main banner identifier (String).

banner_size

Banner size, in pixels, width x height (String).

keywords

Keywords (Dictionary of Strings).

class adpay.iface.proto.CampaignObject[source]

Bases: jsonobject.api.JsonObject

CampaignObject
Object Properties:
 
  • advertiser_id (string) – Unique advertiser identifier
  • banners ([BannerObject]) – List of banner objects
  • budget (float) – Hourly budget
  • campaign_id (string) – Unique campaign identifier
  • filters (RequireExcludeObject) – Filters for campaign
  • keywords (JSONObject) – Key-value map of keywords
  • max_cpc (float) – Max cost per click
  • max_cpm (float) – Max cost per view
  • time_end (integer) – Campaign end time (epoch time, in seconds)
  • time_start (integer) – Campaign start time (epoch time, in seconds)
JSON Example
{
    "time_start": "1543326642", 
    "budget": 0.75, 
    "campaign_id": "BXfmBKBdsQdDOdNbCtxd", 
    "advertiser_id": "QdDOdNbCtxdAXfmBKBds", 
    "max_cpc": 0.01, 
    "filters": "{RequireExcludeObject object}", 
    "keywords": "{JSONObject object}", 
    "banners": [
        "{BannerObject object}", 
        "{BannerObject object}"
    ], 
    "time_end": "1643326642", 
    "max_cpm": 0.005
}
class adpay.iface.proto.EventObject[source]

Bases: jsonobject.api.JsonObject

EventObject
Object Properties:
 
  • banner_id (string) – Unique banner identifier
  • case_id (string) – Unique case identifier for a set of events
  • event_id (string) – Unique event identifier
  • event_type (string) – Event type: click, view or conversion
  • event_value (float) – Custom value for event
  • human_score (float) – Human score (0.0 for bot to 1.0 for human)
  • our_keywords (JSONObject) – Key-value map of keywords
  • publisher_id (string) – Unique publisher identifier
  • timestamp (integer) – Event time (epoch time, in seconds)
  • their_keywords (JSONObject) – Key-value map of keywords
JSON Example
{
    "banner_id": "YDCkxfuSqEuauWMTfFuE", 
    "human_score": 1.0, 
    "event_type": "ZKLstVjbARzpuRGkIUIo", 
    "event_id": "WFrjYbnZUldFBneizUWv", 
    "timestamp": "1543326642", 
    "their_keywords": "{JSONObject object}", 
    "our_keywords": "{JSONObject object}", 
    "case_id": "ATDIQgQNIQGIsrflhiyU", 
    "publisher_id": "tUiugGxOVBbOPOIbQSfR", 
    "event_value": 0.5
}
class adpay.iface.proto.PaymentsRequest[source]

Bases: jsonobject.api.JsonObject

PaymentsRequest
Object Properties:
 
  • timestamp (integer) – Timestamp in epoch seconds
JSON Example
{
    "timestamp": "1544454407"
}
timestamp

Timestamp of payment request

class adpay.iface.proto.PaymentsResponse[source]

Bases: jsonobject.api.JsonObject

PaymentsResponse
Object Properties:
 
JSON Example
{
    "payments": [
        "{SinglePaymentResponse object}", 
        "{SinglePaymentResponse object}"
    ]
}
payments

List of payments for individual events

class adpay.iface.proto.RequireExcludeObject[source]

Bases: jsonobject.api.JsonObject

RequireExcludeListObject

Require and exclude attributes are dictionary/JSON Object, where each key is a list/JSON Array of values. The values are all strings, but they can define a range, by adding a special delimiter (default: ‘–’).

Examples of valid key-value pairs:

  • “age”: [“18–30”]
  • “interest”: [“cars”]
  • “movies”: [“action”, “horror”, “thriller”]
Object Properties:
 
  • exclude (DictProperty) – Dictionary of excluded keywords
  • require (DictProperty) – Dictionary of required keywords
JSON Example
{
    "exclude": "{DictProperty object}", 
    "require": "{DictProperty object}"
}
exclude

Dictionary of excluded keywords

require

Dictionary of required keywords

class adpay.iface.proto.SinglePaymentResponse[source]

Bases: jsonobject.api.JsonObject

SinglePaymentResponse
Object Properties:
 
  • amount (float) – Amount to be paid for event
  • event_id (string) – Unique event identifier
  • reason (integer) – Reason for payment rejection. This will correlate with amount, ie. amount > 0 when reason == 0.
JSON Example
{
    "event_id": "INLCctAwPXbrehWuAOYx", 
    "amount": 0.15498, 
    "reason": "0"
}
amount

Amount to be paid for that event

event_id

Event identifier

reason

Payment rejection reason