Deprecated: Due to the possibility of ambiguity, accounts with both an AdSense publisher account and an AdExchange account will throw an error when trying to use the default account. Always use accounts.list
to check if there's more than one account and let the user choose in that case. After that, specify the account ID on every call using the /accounts/
namespace.
Request
HTTP request
GET https://www.googleapis.com/adsense/v1.4/adclients/adClientId/customchannels/customChannelId/adunits
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
adClientId |
string |
Ad client which contains the custom channel. |
customChannelId |
string |
Custom channel for which to list ad units. |
Optional query parameters | ||
includeInactive |
boolean |
Whether to include inactive ad units. Default: true. |
maxResults |
integer |
The maximum number of ad units to include in the response, used for paging.
Acceptable values are 0 to 10000 , inclusive.
|
pageToken |
string |
A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. |
Authorization
This request requires authorization with at least one of the following scopes:
Scope |
---|
https://www.googleapis.com/auth/adsense |
https://www.googleapis.com/auth/adsense.readonly |
For more information, see the authentication and authorization page.
Request body
Do not supply a request body with this method.
Response
If successful, this method returns a response body with the following structure:
{ "kind": "adsense#adUnits", "etag": etag, "nextPageToken": string, "items": [ { "code": string, "id": string, "kind": "adsense#adUnit", "name": string, "status": string, "customStyle": { "kind": "adsense#adStyle", "colors": { "border": string, "title": string, "background": string, "text": string, "url": string }, "corners": string, "font": { "family": string, "size": string } }, "savedStyleId": string, "contentAdsSettings": { "type": string, "size": string, "backupOption": { "type": string, "color": string, "url": string } }, "mobileContentAdsSettings": { "type": string, "size": string, "markupLanguage": string, "scriptingLanguage": string }, "feedAdsSettings": { "type": string, "minimumWordCount": integer, "frequency": integer, "adPosition": string } } ] }
Property name | Value | Description | Notes |
---|---|---|---|
kind |
string |
Kind of list this is, in this case adsense#adUnits. | |
etag |
etag |
ETag of this response for caching purposes. | |
nextPageToken |
string |
Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this. | |
items[] |
list |
The ad units returned in this list response. | |
items[].code |
string |
Identity code of this ad unit, not necessarily unique across ad clients. | |
items[].id |
string |
Unique identifier of this ad unit. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. | |
items[].kind |
string |
Kind of resource this is, in this case adsense#adUnit. | |
items[].name |
string |
Name of this ad unit. | |
items[].status |
string |
Status of this ad unit. Possible values are: NEW: Indicates that the ad unit was created within the last seven days and does not yet have any activity associated with it. ACTIVE: Indicates that there has been activity on this ad unit in the last seven days. INACTIVE: Indicates that there has been no activity on this ad unit in the last seven days. Acceptable values are:
|
|
items[].customStyle |
nested object |
Custom style information specific to this ad unit. | |
items[].customStyle.kind |
string |
Kind this is, in this case adsense#adStyle. | |
items[].customStyle.colors |
object |
The colors which are included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash. | |
items[].customStyle.colors.border |
string |
The color of the ad border. | |
items[].customStyle.colors.title |
string |
The color of the ad title. | |
items[].customStyle.colors.background |
string |
The color of the ad background. | |
items[].customStyle.colors.text |
string |
The color of the ad text. | |
items[].customStyle.colors.url |
string |
The color of the ad url. | |
items[].customStyle.corners |
string |
The style of the corners in the ad (deprecated: never populated, ignored).
Acceptable values are:
|
|
items[].customStyle.font |
object |
The font which is included in the style. | |
items[].customStyle.font.family |
string |
The family of the font.
Acceptable values are:
|
|
items[].customStyle.font.size |
string |
The size of the font.
Acceptable values are:
|
|
items[].savedStyleId |
string |
ID of the saved ad style which holds this ad unit's style information. | |
items[].contentAdsSettings |
object |
Settings specific to content ads (AFC) and highend mobile content ads (AFMC - deprecated). | |
items[].contentAdsSettings.type |
string |
Type of this ad unit. | |
items[].contentAdsSettings.size |
string |
Size of this ad unit. | |
items[].contentAdsSettings.backupOption |
object |
The backup option to be used in instances where no ad is available. | |
items[].contentAdsSettings.backupOption.type |
string |
Type of the backup option. Possible values are BLANK, COLOR and URL.
Acceptable values are:
|
|
items[].contentAdsSettings.backupOption.color |
string |
Color to use when type is set to COLOR. | |
items[].contentAdsSettings.backupOption.url |
string |
URL to use when type is set to URL. | |
items[].mobileContentAdsSettings |
object |
Settings specific to WAP mobile content ads (AFMC) - deprecated. | |
items[].mobileContentAdsSettings.type |
string |
Type of this ad unit. | |
items[].mobileContentAdsSettings.size |
string |
Size of this ad unit. | |
items[].mobileContentAdsSettings.markupLanguage |
string |
The markup language to use for this ad unit.
Acceptable values are:
|
|
items[].mobileContentAdsSettings.scriptingLanguage |
string |
The scripting language to use for this ad unit.
Acceptable values are:
|
|
items[].feedAdsSettings |
object |
Settings specific to feed ads (AFF) - deprecated. | |
items[].feedAdsSettings.type |
string |
The type of ads which should appear. | |
items[].feedAdsSettings.minimumWordCount |
integer |
The minimum length an entry should be in order to have attached ads. | |
items[].feedAdsSettings.frequency |
integer |
The frequency at which ads should appear in the feed (i.e. every N entries). | |
items[].feedAdsSettings.adPosition |
string |
The position of the ads relative to the feed entries.
Acceptable values are:
|
Try it!
Use the APIs Explorer below to call this method on live data and see the response.