Module bluevia :: Class BlueViaAds
[hide private]
[frames] | no frames]

Class BlueViaAds

source code

BlueVia --+
          |
         BlueViaAds

The BlueVia class for receiving BlueVia ads.

Instance Methods [hide private]
 
__init__(self, adspaceId, sandbox='_Sandbox', realm='BlueVia', version='v1')
Initialize the BlueViaAds object
source code
 
getAd_2l(self, country, targetUserId=None, textAd=False, userAgent='none', keywordList=None, protectionPolicy=1)
Get ads without user authorization (2-legged oAuth)
source code
 
getAd_3l(self, textAd=False, userAgent='none', keywordList=None, protectionPolicy=1)
Get ads without user authorization (2-legged oAuth)
source code
 
_getAd(self, token, country, targetUserId, textAd, userAgent, keywordList, protectionPolicy)
Internal method
source code

Inherited from BlueVia: hasCredentials, loadAccessToken, setAccessToken, setConsumer, setDebug

Inherited from BlueVia (private): _debug, _signAndSend

Class Variables [hide private]

Inherited from BlueVia: access_token, consumer, debugFlag, environment, http, realm, version

Method Details [hide private]

__init__(self, adspaceId, sandbox='_Sandbox', realm='BlueVia', version='v1')
(Constructor)

source code 

Initialize the BlueViaAds object

Parameters:
  • adspaceId - The BlueVia ad space id provide during BlueVia app generation
  • sandbox - (string): Indicates whether testing should be done in Sandbox mode. Use "" for real network access; Default: "_Sandbox"
  • realm - (string): Realm string; Default: "BlueVia"
  • version - (string): BlueVia API version; Default: "v1"

getAd_2l(self, country, targetUserId=None, textAd=False, userAgent='none', keywordList=None, protectionPolicy=1)

source code 

Get ads without user authorization (2-legged oAuth)

Parameters:
  • country - (string): User's country in standard abbreviation, e.g. "UK"
  • targetUserId - (string): Unique id to avoid users to be presented with the same Ad several times. Default: None,
  • textAd - (string): If true requestes text ads, else image ads; efault is False
  • userAgent - (string): Allows BlueVia advertising service to return the more appropiate size. Default: 'none' (and not python None)
  • keywordList - (array): Get an ad related to some topics (e.g. 'computer|laptop'). Default: None,
  • protectionPolicy - (int): 1: Low, moderately explicit content 2:Safe, not rated content 3:High, explicit content. Default: 1
Returns:
(tuple): (HTTP status, (dict) advertisingData). HTTP status == "201" for success.

getAd_3l(self, textAd=False, userAgent='none', keywordList=None, protectionPolicy=1)

source code 

Get ads without user authorization (2-legged oAuth)

Parameters:
  • textAd - (string): If true requestes text ads, else image ads; efault is False
  • userAgent - (string): Allows BlueVia advertising service to return the more appropiate size. Default: 'none' (and not python None)
  • keywordList - (array): Get an ad related to some topics (e.g. 'computer|laptop'). Default: None,
  • protectionPolicy - (int): 1: Low, moderately explicit content 2:Safe, not rated content 3:High, explicit content. Default: 1
Returns:
(tuple): (HTTP status, (dict) advertisingData). HTTP status == "201" for success.