1 API Parameters
_
2 Resources
2.1 accounts
3 Resources
adsensehost-accounts-list
adsensehost-accounts-get
3.1 customchannels
adsensehost-customchannels-list
adsensehost-customchannels-get
adsensehost-customchannels-insert
adsensehost-customchannels-patch
adsensehost-customchannels-delete
adsensehost-customchannels-update
3.2 adclients
adsensehost-adclients-list
adsensehost-adclients-get
3.3 reports
adsensehost-reports-generate
3.4 urlchannels
adsensehost-urlchannels-list
adsensehost-urlchannels-insert
adsensehost-urlchannels-delete
3.5 associationsessions
adsensehost-associationsessions-start
adsensehost-associationsessions-verify
Version: 5.3

AdSense Host API v4.1

This documentation has been automatically generated using information supplied by the Google API Discovery service.

Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities. Google documentation.

    1 API Parameters

    2 Resources

      2.1 accounts

    3 Resources

      3.1 customchannels

      3.2 adclients

      3.3 reports

      3.4 urlchannels

      3.5 associationsessions

(require-gapi-doc adsensehost.v4.1.js)

1 API Parameters

The following optional keyword arguments may be passed to all functions for this web service:

procedure

(_ [#:alt alt    
  #:fields fields    
  #:key key    
  #:oauth_token oauth_token    
  #:prettyPrint prettyPrint    
  #:quotaUser quotaUser    
  #:userIp userIp])  jsexpr?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A

This is not actually a function. This is just using Scribble’s defproc form to list the optional keyword arguments that may be passed to all functions for this service.

alt: Data format for the response.

fields: Selector specifying which fields to include in a partial response.

key: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token: OAuth 2.0 token for the current user.

prettyPrint: Returns response with indentations and line breaks.

quotaUser: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

userIp: IP address of the site where the request originates. Use this if you want to enforce per-user limits.

2 Resources

2.1 accounts

3 Resources

procedure

(adsensehost-accounts-list 
  #:filterAdClientId filterAdClientId 
  [#:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  filterAdClientId : string?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
List hosted accounts associated with this AdSense account by ad client id.

filterAdClientId: Ad clients to list accounts for.

procedure

(adsensehost-accounts-get #:accountId accountId    
  [#:alt alt    
  #:fields fields    
  #:key key    
  #:oauth_token oauth_token    
  #:prettyPrint prettyPrint    
  #:quotaUser quotaUser    
  #:userIp userIp])  jsexpr?
  accountId : string?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Get information about the selected associated AdSense account.

accountId: Account to get information about.

3.1 customchannels

procedure

(adsensehost-customchannels-list #:adClientId adClientId 
  [#:maxResults maxResults 
  #:pageToken pageToken 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  maxResults : string? = 'N/A
  pageToken : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
List all host custom channels in this AdSense account.

adClientId: Ad client for which to list custom channels.

maxResults: The maximum number of custom channels to include in the response, used for paging.

pageToken: A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.

procedure

(adsensehost-customchannels-get 
  #:adClientId adClientId 
  #:customChannelId customChannelId 
  [#:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  customChannelId : string?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Get a specific custom channel from the host AdSense account.

adClientId: Ad client from which to get the custom channel.

customChannelId: Custom channel to get.

procedure

(adsensehost-customchannels-insert #:adClientId adClientId 
  [#:id id 
  #:name name 
  #:kind kind 
  #:code code 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  id : string? = 'N/A
  name : string? = 'N/A
  kind : string? = 'N/A
  code : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Add a new custom channel to the host AdSense account.

adClientId: Ad client to which the new custom channel will be added.

id: Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format.

name: Name of this custom channel.

kind: Kind of resource this is, in this case adsensehost#customChannel.

code: Code of this custom channel, not necessarily unique across ad clients.

procedure

(adsensehost-customchannels-patch 
  #:adClientId adClientId 
  #:customChannelId customChannelId 
  [#:id id 
  #:name name 
  #:kind kind 
  #:code code 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  customChannelId : string?
  id : string? = 'N/A
  name : string? = 'N/A
  kind : string? = 'N/A
  code : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Update a custom channel in the host AdSense account. This method supports patch semantics.

adClientId: Ad client in which the custom channel will be updated.

customChannelId: Custom channel to get.

id: Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format.

name: Name of this custom channel.

kind: Kind of resource this is, in this case adsensehost#customChannel.

code: Code of this custom channel, not necessarily unique across ad clients.

procedure

(adsensehost-customchannels-delete 
  #:adClientId adClientId 
  #:customChannelId customChannelId 
  [#:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  customChannelId : string?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Delete a specific custom channel from the host AdSense account.

adClientId: Ad client from which to delete the custom channel.

customChannelId: Custom channel to delete.

procedure

(adsensehost-customchannels-update #:adClientId adClientId 
  [#:id id 
  #:name name 
  #:kind kind 
  #:code code 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  id : string? = 'N/A
  name : string? = 'N/A
  kind : string? = 'N/A
  code : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Update a custom channel in the host AdSense account.

adClientId: Ad client in which the custom channel will be updated.

id: Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format.

name: Name of this custom channel.

kind: Kind of resource this is, in this case adsensehost#customChannel.

code: Code of this custom channel, not necessarily unique across ad clients.

3.2 adclients

procedure

(adsensehost-adclients-list [#:maxResults maxResults 
  #:pageToken pageToken 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  maxResults : string? = 'N/A
  pageToken : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
List all host ad clients in this AdSense account.

maxResults: The maximum number of ad clients to include in the response, used for paging.

pageToken: A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.

procedure

(adsensehost-adclients-get #:adClientId adClientId    
  [#:alt alt    
  #:fields fields    
  #:key key    
  #:oauth_token oauth_token    
  #:prettyPrint prettyPrint    
  #:quotaUser quotaUser    
  #:userIp userIp])  jsexpr?
  adClientId : string?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Get information about one of the ad clients in the Host AdSense account.

adClientId: Ad client to get.

3.3 reports

procedure

(adsensehost-reports-generate #:endDate endDate 
  #:startDate startDate 
  [#:sort sort 
  #:filter filter 
  #:maxResults maxResults 
  #:dimension dimension 
  #:locale locale 
  #:metric metric 
  #:startIndex startIndex 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  endDate : string?
  startDate : string?
  sort : string? = 'N/A
  filter : string? = 'N/A
  maxResults : string? = 'N/A
  dimension : string? = 'N/A
  locale : string? = 'N/A
  metric : string? = 'N/A
  startIndex : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.

endDate: End of the date range to report on in "YYYY-MM-DD" format, inclusive.

startDate: Start of the date range to report on in "YYYY-MM-DD" format, inclusive.

sort: The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.

filter: Filters to be run on the report.

maxResults: The maximum number of rows of report data to return.

dimension: Dimensions to base the report on.

locale: Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.

metric: Numeric columns to include in the report.

startIndex: Index of the first row of report data to return.

3.4 urlchannels

procedure

(adsensehost-urlchannels-list #:adClientId adClientId 
  [#:maxResults maxResults 
  #:pageToken pageToken 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  maxResults : string? = 'N/A
  pageToken : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
List all host URL channels in the host AdSense account.

adClientId: Ad client for which to list URL channels.

maxResults: The maximum number of URL channels to include in the response, used for paging.

pageToken: A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.

procedure

(adsensehost-urlchannels-insert #:adClientId adClientId 
  [#:id id 
  #:kind kind 
  #:urlPattern urlPattern 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  id : string? = 'N/A
  kind : string? = 'N/A
  urlPattern : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Add a new URL channel to the host AdSense account.

adClientId: Ad client to which the new URL channel will be added.

id: Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format.

kind: Kind of resource this is, in this case adsensehost#urlChannel.

urlPattern: URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home

procedure

(adsensehost-urlchannels-delete #:adClientId adClientId 
  #:urlChannelId urlChannelId 
  [#:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  urlChannelId : string?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Delete a URL channel from the host AdSense account.

adClientId: Ad client from which to delete the URL channel.

urlChannelId: URL channel to delete.

3.5 associationsessions

procedure

(adsensehost-associationsessions-start 
  #:productCode productCode 
  #:websiteUrl websiteUrl 
  [#:userLocale userLocale 
  #:websiteLocale websiteLocale 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  productCode : string?
  websiteUrl : string?
  userLocale : string? = 'N/A
  websiteLocale : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Create an association session for initiating an association with an AdSense user.

productCode: Products to associate with the user.

websiteUrl: The URL of the user’s hosted website.

userLocale: The preferred locale of the user.

websiteLocale: The locale of the user’s hosted website.

procedure

(adsensehost-associationsessions-verify 
  #:token token 
  [#:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  token : string?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Verify an association session after the association callback returns from AdSense signup.

token: The token returned to the association callback URL.