Skip to main content

GET/ad_campaign/{campaign_id}/ad_group

Note: This method is only available for select partners who have been approved for the eBay priority strategy program. For information about how to request access to this program, refer to Priority Strategy Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for priority strategy, use the getAdvertisingEligibility method in Account API.
This method retrieves ad groups for the specified campaigns.

Each campaign can only have one ad group.

In the request, supply the campaign_ids as path parameters.

Call getCampaigns to retrieve a list of the current campaign IDs for a seller.

Input

Resource URI

GET https://api.ebay.com/sell/marketing/v1/ad_campaign/{campaign_id}/ad_group?

This method is supported in Sandbox environment. To access the endpoint, just replace the api.ebay.com root URI with api.sandbox.ebay.com

URI parameters

ParameterTypeDescription
campaign_idstringThis path parameter specifies the unique eBay-assigned identifier of the ad campaign associated with the ad groups being retrieved.

Use the getCampaigns method to retrieve campaign IDs.

Occurrence: Required

limitstringThe number of results, from the current result set, to be returned in a single page.

Occurrence: Optional

offsetstringThe number of results that will be skipped in the result set. This is used with the limit field to control the pagination of the output.

For example, if the offset is set to 0 and the limit is set to 10, the method will retrieve items 1 through 10 from the list of items returned. If the offset is set to 10 and the limit is set to 10, the method will retrieve items 11 through 20 from the list of items returned.

Default: 0

Occurrence: Optional

ad_group_statusstringA comma-separated list of ad group statuses. The results will be filtered to only include the given statuses of the ad group.

See AdGroupStatusEnum for supported values.

Occurrence: Optional

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

All other standard RESTful request headers are optional. For more information on standard RESTful request headers, see the HTTP request headers- opens rest request components page table.

OAuth scope

This request requires an access token created with the authorization code grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):

https://api.ebay.com/oauth/api_scope/sell.marketing.readonly

https://api.ebay.com/oauth/api_scope/sell.marketing

See OAuth access tokens for more information.

Request payload

This call has no payload.

Request fields

This call has no field definitions.

Output

HTTP response headers

This call has no response headers.

Response payload

Response fields

Output container/fieldTypeDescription
adGroupsarray of AdGroup

The details of existing ad groups, such as the name, ID, and status of the ad groups.

Occurrence: Always

adGroups.adGroupIdstring

A unique eBay-assigned ID for an ad group in a campaign that uses the Cost Per Click (CPC) funding model.

Occurrence: Always

adGroups.adGroupStatusAdGroupStatusEnum

An enumeration value representing the current status of the ad group.

Valid Values:

  • ACTIVE
  • PAUSED
  • ARCHIVED

Occurrence: Always

adGroups.defaultBidAmount

A bid amount that applies to all of the keywords in an ad group that do not have individual bids. For all keywords without individual bids, the default bid is the amount that the seller will pay per click for the listings in the ad group in the promoted listings campaign.

Valid Values: 0.5, 0.75

Occurrence: Always

adGroups.defaultBid.currencyCurrencyCodeEnum

The base currency applied to the value field to establish a monetary amount.

The currency is represented as a 3-letter ISO 4217 currency code. For example, the code for the Canadian Dollar is CAD

Occurrence: Conditional

adGroups.defaultBid.valuestring

The monetary amount in the specified currency.

Required in the amount type.

Occurrence: Conditional

adGroups.namestring

The seller-defined name of the ad group.

Occurrence: Always

hrefstring

The URI of the current page of results from the result set.

Occurrence: Always

limitinteger

The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter.

Occurrence: Always

nextstring

The call URI that can be used to retrieve the next page in the result set. This value is returned only if there is an additional page of results to display from the result set.

Occurrence: Conditional

offsetinteger

The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter.

Default: 0


Note: The items in a paginated result set use a zero-based list, where the first item in the list has an offset of 0.

Occurrence: Always

prevstring

The call URI that can be used to retrieve the previous page in the result set. Basically, all of the request parameters will remain the same except the offset value, which will be decreased to retrieve the previous page of results.

Occurrence: Conditional

totalinteger

The total number of items retrieved in the result set.

Note: If no items are found, this field is returned with a value of 0.

Occurrence: Always

HTTP status codes

This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.

StatusMeaning
200Success
400Bad Request
404Not Found
409Business error
500Internal Server error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
35001API_MARKETINGAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay Developer Technical Support for assistance.
35002API_MARKETINGAPPLICATIONInternal error. Please wait a few minutes and try the call again.
35029API_MARKETINGREQUESTThe 'limit' has to be greater than zero and less than {maxLimitValue}.
35030API_MARKETINGREQUESTThe 'offset' cannot be less than zero.
35045API_MARKETINGREQUESTNo campaign found for campaign id {campaign_id}.
35129API_MARKETINGBUSINESSThis method is not supported for campaigns with smart targeting type.

Warnings

This call has no warnings.

Samples

New to making API calls? Please see Making a Call.

Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.

Sample 1: Retrieve Multiple Ad Groups

This example retrieves all ad groups for the specified priority strategy ad campaign.

Input

The input for this sample is the campaign_id of the priority ad campaign for which the ad groups shall be retrieved.

GEThttps://api.ebay.com/sell/marketing/v1/ad_campaign/1********4/ad_group

Output

If the call is successful, the ad groups for the specified ad campaign are retrieved.

Got thoughts? Click the feedback button – your insights help us improve!