AdSense Host API . associationsessions

Instance Methods

close()

Close httplib2 connections.

start(productCode, websiteUrl, websiteLocale=None, callbackUrl=None, userLocale=None)

Create an association session for initiating an association with an AdSense user.

verify(token)

Verify an association session after the association callback returns from AdSense signup.

Method Details

close()
Close httplib2 connections.
start(productCode, websiteUrl, websiteLocale=None, callbackUrl=None, userLocale=None)
Create an association session for initiating an association with an AdSense user.

Args:
  productCode: string, Products to associate with the user. (required) (repeated)
    Allowed values
      AFC - AdSense For Content
      AFG - AdSense For Games
      AFMC - AdSense For Mobile Content - deprecated
      AFS - AdSense For Search - deprecated
      AFV - AdSense For Video
  websiteUrl: string, The URL of the user's hosted website. (required)
  websiteLocale: string, The locale of the user's hosted website.
  callbackUrl: string, The URL to redirect the user to once association is completed. It receives a token parameter that can then be used to retrieve the associated account.
  userLocale: string, The preferred locale of the user.

Returns:
  An object of the form:

    {
    "redirectUrl": "A String", # Redirect URL of this association session. Used to redirect users into the AdSense association flow.
    "productCodes": [ # The products to associate with the user. Options: AFC, AFG, AFV, AFS (deprecated), AFMC (deprecated)
      "A String",
    ],
    "kind": "adsensehost#associationSession", # Kind of resource this is, in this case adsensehost#associationSession.
    "userLocale": "A String", # The preferred locale of the user themselves when going through the AdSense association flow.
    "websiteLocale": "A String", # The locale of the user's hosted website.
    "websiteUrl": "A String", # The URL of the user's hosted website.
    "id": "A String", # Unique identifier of this association session.
    "status": "A String", # Status of the completed association, available once the association callback token has been verified. One of ACCEPTED, REJECTED, or ERROR.
    "accountId": "A String", # Hosted account id of the associated publisher after association. Present if status is ACCEPTED.
  }
verify(token)
Verify an association session after the association callback returns from AdSense signup.

Args:
  token: string, The token returned to the association callback URL. (required)

Returns:
  An object of the form:

    {
    "redirectUrl": "A String", # Redirect URL of this association session. Used to redirect users into the AdSense association flow.
    "productCodes": [ # The products to associate with the user. Options: AFC, AFG, AFV, AFS (deprecated), AFMC (deprecated)
      "A String",
    ],
    "kind": "adsensehost#associationSession", # Kind of resource this is, in this case adsensehost#associationSession.
    "userLocale": "A String", # The preferred locale of the user themselves when going through the AdSense association flow.
    "websiteLocale": "A String", # The locale of the user's hosted website.
    "websiteUrl": "A String", # The URL of the user's hosted website.
    "id": "A String", # Unique identifier of this association session.
    "status": "A String", # Status of the completed association, available once the association callback token has been verified. One of ACCEPTED, REJECTED, or ERROR.
    "accountId": "A String", # Hosted account id of the associated publisher after association. Present if status is ACCEPTED.
  }