My favorites | English | Sign in

Documentation for the requested version is not available.Documentation for the requested diff is not available.

AccountService

Link to this version

Use AccountService to create new AdSense accounts for your publishers, associate existing publisher accounts with your site, and update publisher account settings.

Creating an AdSense Account

To create an AdSense account, use the createAccount request with input parameters that describe the publisher and website. Parameters that describe the publisher are loginEmail, entityType (Business or Individual), usersPreferredLocale, emailPromotionsPreferences, and hasAcceptedTCs. Parameters that describe the website are synServiceTypes, websiteUrl, and websiteLocale. Note that each AdSense account is associated with a single website URL.

The response to creating an account is a SyndicationService_Data object, which holds the publisher ID. This ID uniquely identifies the publisher and is used as the synServiceId parameter in operations in related services.

Viewing and Updating an Account

You can view and make modifications to many of the values originally passed in when an account was created, such as the password and email preferences. AccountService has administrative operations:

  • View and modify entity type of publisher (Individual or Business)
  • View and modify publisher's preferred language for email (approval and verification), and for the publisher's interaction with the AdSense front end
  • View and modify email promotions preferences of publisher
  • View account approval status

and website operations:

  • View website URL of publisher (this URL cannot be changed)
  • View and modify language of publisher's website
  • View and add syndication service types (though currently there is only one, ContentAds)

After you have created a new AdSense account, you can use the other services to generate an ad code snippet, modify the ad style, layout and type, and set site filters.

Requests

addSyndicationService

Adds the SyndicationService corresponding to synServiceType to the publisher's account.

Parameters

synServiceType SyndicationService_Type
type of the SyndicationService

Values are:

  • ContentAds - Corresponds to the AdSense For Content (AFC) syndication service
  • SearchAds - Corresponds to the AdSense For Search (AFS) syndication service

Response

(none)

See Also:

Errors

332 if the publisher is already signed up for synServiceType.

associateAccount +v3

Creates an association between the developer and the publisher. If an association already exists, the method does nothing. The loginEmail and one or both of postalCode and phone are required. Before creating the association this method does some sanity checks to match the account with the provided postal code and phone hints. If either of the hints match, then it sets up the MPM association. Otherwise returns an error.

Parameters

loginEmail string
the email address of the publisher
postalCode string
the postalCode hint
phone string
phone hint consisting of the last 5 digits of the publisher's telephone number, excluding punctuation. For example, the phone hint for (650)253-8000 would be "38000".
developerUrl string
the site to be associated with this publisher.

Response

SyndicationService_Data[] the SyndicationService_Data objects corresponding to synServiceTypes. A SyndicationService_Data object contains a client ID and syndication type. For example:
   <id>ca-pub-9644922955003912</id>
   <type>ContentAds</type>

Errors

105 if loginEmail does not correspond to an AdSense account.
112 if none of the hints match the data from the AdSense account corresponding to loginEmail.
205 if loginEmail corresponds to a Disapproved AdSense account.
321 if loginEmail is not a valid email address.
323 if postalCode is not of a valid format.
324 if the phone hint is not a 5 digit number.
325 if both the phone and postalCode are nil or empty strings.

associateExistingAccount

Deprecated. Use associateAccount.

Creates an association between the developer and the publisher. If an association already exists, the method does nothing. The loginEmail and one or both of postalCode and phone are required.

Before creating the association this method does some sanity checks to match the account with the provided postal code and phone hints. If either of the hints match, then it sets up the MPM association. Otherwise returns an error.

Parameters

loginEmail string
the email address of the publisher
postalCode string
the postalCode hint
phone string
phone hint consisting of the last 5 digits of the publisher's telephone number, excluding punctuation. For example, the phone hint for (650)253-8000 would be "38000".

Response

SyndicationService_Data[] the SyndicationService_Data objects corresponding to synServiceTypes. A SyndicationService_Data object contains a client ID and syndication type. For example:
   <id>ca-pub-9644922955003912</id>
   <type>ContentAds</type>

Errors

105 if loginEmail does not correspond to an AdSense account.
112 if none of the hints match the data from the AdSense account corresponding to loginEmail.
205 if loginEmail corresponds to a Disapproved AdSense account.
321 if loginEmail is not a valid email address.
323 if postalCode is not of a valid format.
324 if the phone hint is not a 5 digit number.
325 if both the phone and postalCode are nil or empty strings.

createAccount +v3

Creates a new AdSense account.

Parameters

loginEmail string
The login email for the new account. Email promotions will be sent to this email.
entityType EntityType
The entity type.

Values are:

  • Individual - The entity is of type individual
  • Business - The entity is of type business

websiteUrl string
the url of the primary website of the publisher.
websiteLocale string
The locale of the website. This must be a Google supported locale.
usersPreferredLocale string
All correspondence with the user will occur in this locale. This must be a Google supported locale.
emailPromotionsPreferences boolean
Email promotions preferences for the new account. These are enabled if true.
synServiceTypes SyndicationService_Type[]
the AdSense services requested.

Values are:

  • ContentAds - Corresponds to the AdSense For Content (AFC) syndication service
  • SearchAds - Corresponds to the AdSense For Search (AFS) syndication service

developerUrl string
the site to be associated with this publisher. You can retreve your site URLs using getDeveloperSiteData.

Response

SyndicationService_Data[] an array of SyndicationService_Data objects corresponding to synServiceTypes. A SyndicationService_Data object contains a client ID and syndication type. For example:
   <id>ca-pub-9644922955003912</id>
   <type>ContentAds</type>

Errors

302 if no syndication services are specified
303 if loginEmail is already in use by another user
311 if usersPreferredLocale is not valid
312 if websiteLocale is not valid
313 if websiteUrl is not valid
314 if any of the elements of synServiceTypes is not valid
316 if entityType is not valid
317 if the login email is valid but the user has already specified a different EntityType
321 if loginEmail is not valid
326 if any of the elements of synServiceTypes is repeated
327 if websiteLocale is not supported by one or more of the synServiceTypes

createAdSenseAccount

Deprecated. Use createAccount.

Creates a new AdSense account.

Parameters

loginEmail string
The login email for the new account. Email promotions will be sent to this email.
entityType EntityType
The entity type.

Values are:

  • Individual - The entity is of type individual
  • Business - The entity is of type business

websiteUrl string
the url of the primary website of the publisher.
websiteLocale string
The locale of the website. This must be a Google supported locale.
usersPreferredLocale string
All correspondence with the user will occur in this locale. This must be a Google supported locale.
emailPromotionsPreferences boolean
Email promotions preferences for the new account. These are enabled if true.
synServiceTypes SyndicationService_Type[]
the AdSense services requested.

Values are:

  • ContentAds - Corresponds to the AdSense For Content (AFC) syndication service
  • SearchAds - Corresponds to the AdSense For Search (AFS) syndication service

hasAcceptedTCs boolean
this parameter is deprecated and will be ignored. However, the parameter is still required in the current version of the API.

Response

SyndicationService_Data[] an array of SyndicationService_Data objects corresponding to synServiceTypes. A SyndicationService_Data object contains a client ID and syndication type. For example:
   <id>ca-pub-9644922955003912</id>
   <type>ContentAds</type>

Errors

302 if no syndication services are specified
303 if loginEmail is already in use by another user
311 if usersPreferredLocale is not valid
312 if websiteLocale is not valid
313 if websiteUrl is not valid
314 if any of the elements of synServiceTypes is not valid
315 if the user has not accepted the terms and conditions
316 if entityType is not valid
317 if the login email is valid but the user has already specified a different EntityType
321 if loginEmail is not valid
326 if any of the elements of synServiceTypes is repeated
327 if websiteLocale is not supported by one or more of the synServiceTypes

getAllSyndicationServices

Returns data about all the SyndicationService services subscribed to by the publisher.

Parameters

dummy int
ignored. This parameter is present because some SOAP toolkits cannot deal with functions that have headers but no parameters.

Response

SyndicationService_Data[] data about all of the SyndicationServices. A SyndicationService_Data object contains a client ID and syndication type. For example:
   <id>ca-pub-9644922955003912</id>
   <type>ContentAds</type>

See Also:

getApprovalStatus

Returns the ApprovalStatus of this account.

Parameters

dummy int
ignored. This parameter is present because some SOAP toolkits cannot deal with functions that have headers but no parameters.

Response

ApprovalStatus status the ApprovalStatus of this account

Values are:

  • Pending_Email_Verification - Publisher has not yet verified his/her email address.
  • Pending_For_Submission - Publisher has verified his/her email address, but has not submitted the application to provide the address information.
  • Pending_Approval - Publisher has verified email and has submitted the application to provide the address information. But the account has not been approved yet.
  • Approved - Publisher's account has been approved.
  • Disabled - Publisher's account has been disabled due to violation of the Terms and Conditions.

getAssociationStatus

Returns the publisher's association status with the developer. Returned values could be one of NotAssociated, Pending, Refused, or Active.

Parameters

dummy int
ignored. This parameter is present because some SOAP toolkits cannot deal with functions that have headers but no parameters.

Response

MpmStatus the publisher's association status with the developer.

Values are:

  • NotAssociated - Publisher is not associated with developer
  • Pending - Publisher's association with developer is pending
  • Active - Publisher has an active association with developer
  • Refused - Publisher has refused an association request with developer.

getBulkApprovalStatus +v3

Returns the ApprovalStatus for the provided list of clients.

Parameters

clientIds string[]
the list of client ids to provide approval status for.

Response

PublisherApprovalStatus[] a list of PublisherApprovalStatus objects which connect the requested client id to the returned approval status. Client ids which have a failure condition will be omitted from the returned list. To obtain more specific information about why they failed, use the getApprovalStatus(int) api call.

Errors

334 if the list of client ids is missing

getBulkAssociationStatus +v3

Returns the MpmStatus for the provided list of clients.

Parameters

clientIds string[]
the list of client ids to provide association status for.

Response

PublisherAssociationStatus[] a list of PublisherAssociationStatus objects which connect the request client id to the returned association status. Client ids which have a failure condition will be omitted from the returned list. To obtain more specific information about why they failed, use the getAssociationStatus(int) api call.

Errors

334 if the list of client ids is missing

getDeveloperSiteData +v3

Gets the developer site data.

Response

DeveloperSiteData[] an array of DeveloperSiteData objects that contain the developer's site information.

getEmailPromotionsPreference

Returns whether email promotions are enabled for the account.

Parameters

dummy int
ignored. This parameter is present because some SOAP toolkits cannot deal with functions that have headers but no parameters.

Response

boolean the email promotions preference

getEntityType

Returns the entity type for the account

Parameters

dummy int
ignored. This parameter is present because some SOAP toolkits cannot deal with functions that have headers but no parameters.

Response

EntityType the EntityType for this account.

Values are:

  • Individual - The entity is of type individual
  • Business - The entity is of type business

getSupportedWebsiteLocales

Returns the list of supported website locales.

Parameters

dummy int
ignored. This parameter is present because some SOAP toolkits cannot deal with functions that have headers but no parameters.

Response

string[] the list of support website locales. These must be Google supported locales.

getSupportedWebsiteLocalesForSyndicationService

Returns the list of supported website locales for a given type of SyndicationService.

Parameters

synServiceType SyndicationService_Type
type of the SyndicationService

Values are:

  • ContentAds - Corresponds to the AdSense For Content (AFC) syndication service
  • SearchAds - Corresponds to the AdSense For Search (AFS) syndication service

Response

string[] the list of supported website locales for a given type of SyndicationService. This must be Google supported locales.

getSyndicationService

Returns the service data for the SyndicationService corresponding to the synServiceType parameter.

Parameters

synServiceType SyndicationService_Type
type of the SyndicationService

Values are:

  • ContentAds - Corresponds to the AdSense For Content (AFC) syndication service
  • SearchAds - Corresponds to the AdSense For Search (AFS) syndication service

Response

SyndicationService_Data SyndicationService_Data object corresponding to the synServiceType parameter passed in. A SyndicationService_Data object contains a client ID and syndication type. For example:
   <id>ca-pub-9644922955003912</id>
   <type>ContentAds</type>

See Also:

Errors

204 if the publisher is not signed up for the syndication service corresponding to synServiceType.
314 if synServiceType is not valid.

getUsersPreferredLocale

Return the user's preferred locale.

Parameters

dummy int
ignored. This parameter is present because some SOAP toolkits cannot deal with functions that have headers but no parameters.

Response

string the user's preferred locale. All correspondence with the user will occur in this locale. This must be a Google supported locale.

getWebsiteLocale

Returns the website language setting for the account.

Parameters

dummy int
ignored. This parameter is present because some SOAP toolkits cannot deal with functions that have headers but no parameters.

Response

string The locale of the website.

getWebsiteUrl

Returns the Website URL

Parameters

dummy int
ignored. This parameter is present because some SOAP toolkits cannot deal with functions that have headers but no parameters.

Response

string the website URL for this account.

resendVerificationEmail +v3

Resends the verification email. The verification email can be sent up to three times.

Parameters

developerUrl string
the developer site URL.

Response

(none)

Errors

205 if the account has been disapproved.
335 if developerUrl the developer site URL is invalid.
338 if the verification email has already been sent three times.
339 if the publisher is not in pending association status with this developer site.

setEmailPromotionsPreference

Set whether the account should receive email promotions or not

Parameters

enableEmailPromotions boolean
the email preferences

Response

(none)

setUsersPreferredLocale

Set the user's preferred locale. All correspondence with the user will occur in this locale

Parameters

usersPreferredLocale string
the user's preferred locale. This must be a Google supported locale

Response

(none)

Errors

311 if usersPreferredLocale is not valid