AccountService

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:

and website operations:

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.

The version 2 WSDL for this service is at https://www.google.com/api/adsense/v2/AccountService?wsdl.

The version 3 WSDL for this service is at https://www.google.com/api/adsense/v3/AccountService?wsdl.

Requests

addSyndicationService

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

Parameters

Parameter nameParameter typeParameter description
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
  • ReferralAds - Corresponds to the referral syndication service

Response

Response typeResponse description
(none)

See Also:

SyndicationService

Errors

Error numberError description
332 if the publisher is already signed up for synServiceType.

associateAccount   new in 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

Parameter nameParameter typeParameter description
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

Response typeResponse description
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

Error numberError description
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

Parameter nameParameter typeParameter description
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

Response typeResponse description
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

Error numberError description
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   new in v3

Creates a new AdSense account.

Parameters

Parameter nameParameter typeParameter description
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
  • ReferralAds - Corresponds to the referral syndication service

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

Response

Response typeResponse description
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

Error numberError description
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

Parameter nameParameter typeParameter description
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
  • ReferralAds - Corresponds to the referral 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

Response typeResponse description
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

Error numberError description
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

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

Response

Response typeResponse description
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:

SyndicationService

getApprovalStatus

Returns the ApprovalStatus of this account.

Parameters

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

Response

Response typeResponse description
ApprovalStatus status the ApprovalStatus of this account

Values are:

  • Pending_Email_Verification - Publisher has not yet verified his/her email address.
  • Pending_Approval - Publisher has verified email but the account has not been approved as 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

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

Response

Response typeResponse description
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   new in v3

Returns the ApprovalStatus for the provided list of clients.

Parameters

Parameter nameParameter typeParameter description
clientIds string[]
the list of client ids to provide approval status for.

Response

Response typeResponse description
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

Error numberError description
334 if the list of client ids is missing

getBulkAssociationStatus   new in v3

Returns the MpmStatus for the provided list of clients.

Parameters

Parameter nameParameter typeParameter description
clientIds string[]
the list of client ids to provide association status for.

Response

Response typeResponse description
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

Error numberError description
334 if the list of client ids is missing

getDeveloperSiteData   new in v3

Gets the developer site data.

Response

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

getEmailPromotionsPreference

Returns whether email promotions are enabled for the account.

Parameters

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

Response

Response typeResponse description
boolean the email promotions preference

getEntityType

Returns the entity type for the account

Parameters

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

Response

Response typeResponse description
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

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

Response

Response typeResponse description
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

Parameter nameParameter typeParameter description
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
  • ReferralAds - Corresponds to the referral syndication service

Response

Response typeResponse description
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

Parameter nameParameter typeParameter description
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
  • ReferralAds - Corresponds to the referral syndication service

Response

Response typeResponse description
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:

SyndicationService_Data
SyndicationService_Type

Errors

Error numberError description
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

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

Response

Response typeResponse description
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

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

Response

Response typeResponse description
string The locale of the website.

getWebsiteUrl

Returns the Website URL

Parameters

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

Response

Response typeResponse description
string the website URL for this account.

resendVerificationEmail   new in v3

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

Parameters

Parameter nameParameter typeParameter description
developerUrl string
the developer site URL.

Response

Response typeResponse description
(none)

Errors

Error numberError description
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

Parameter nameParameter typeParameter description
enableEmailPromotions boolean
the email preferences

Response

Response typeResponse description
(none)

setUsersPreferredLocale

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

Parameters

Parameter nameParameter typeParameter description
usersPreferredLocale string
the user's preferred locale. This must be a Google supported locale

Response

Response typeResponse description
(none)

Errors

Error numberError description
311 if usersPreferredLocale is not valid