GET/negative_keyword
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 can be used to retrieve all of the negative keywords for ad groups in priority strategy campaigns that use the Cost Per Click (CPC) funding model.
The results can be filtered using the campaign_ids, ad_group_ids, and negative_keyword_status query parameters.
Call the getCampaigns method to retrieve a list of current campaign IDs for a seller.
Input
Resource URI
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
Parameter | Type | Description |
---|---|---|
ad_group_ids | string | A comma-separated list of ad group IDs. This query parameter is used if the seller wants to retrieve the negative keywords from one or more specific ad groups. The results might not include these ad group IDs if other search conditions exclude them. Use the getAdGroups method to retrieve the ad group IDs for a seller. Required if the search results must be filtered to include negative keywords created at the ad group level. Occurrence: Conditional |
campaign_ids | string | This path parameter specifies the unique eBay-assigned identifier of the ad campaign associated with the negative keywords being retrieved. This query parameter is used if the seller wants to retrieve the negative keywords from a specific campaign. The results might not include these campaign IDs if other search conditions exclude them. Note: Currently, only one campaign ID value is supported for each request. Use the getCampaigns method to retrieve campaign IDs. Occurrence: Optional |
negative_keyword_status | string | A comma-separated list of negative keyword statuses. This query parameter is used if the seller wants to filter the search results based on one or more negative keyword statuses. See NegativeKeywordStatusEnum for supported values. Occurrence: Optional |
limit | string | The number of results, from the current result set, to be returned in a single page. Occurrence: Optional |
offset | string | The 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. 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/field | Type | Description |
---|---|---|
href | string | The URI of the current page of results from the result set. Occurrence: Conditional |
limit | integer | 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: Conditional |
negativeKeywords | array of NegativeKeyword | A list of negative keywords returned in the paginated collection. Occurrence: Conditional |
negativeKeywords.adGroupId | string | An ad group ID that is generated when an ad group is first created and associated with a campaign. Occurrence: Conditional |
negativeKeywords.campaignId | string | A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. Occurrence: Conditional |
negativeKeywords.negativeKeywordId | string | A unique eBay-assigned ID for a negative keyword. This keyword ID will be generated for each successfully created negative keyword. Occurrence: Always |
negativeKeywords.negativeKeywordMatchType | NegativeKeywordMatchTypeEnum | A field that defines the match type for the negative keyword.
Occurrence: Always |
negativeKeywords.negativeKeywordStatus | NegativeKeywordStatusEnum | A field that defines the status of the negative keyword. Occurrence: Always |
negativeKeywords.negativeKeywordText | string | The text for the negative keyword. Occurrence: Always |
next | string | 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 |
offset | integer | 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. Occurrence: Conditional |
prev | string | 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 |
total | integer | The total number of result sets in the paginated collection. Occurrence: Conditional |
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.
Status | Meaning |
---|---|
200 | Success |
400 | Bad Request |
403 | Forbidden |
404 | Not Found |
409 | Business error |
500 | Internal Server error |
Error codes
For more on errors, plus the codes of other common errors, see Handling errors.
Code | Domain | Category | Meaning |
---|---|---|---|
35001 | API_MARKETING | APPLICATION | There was a problem with an eBay internal system or process. Contact eBay Developer Technical Support for assistance. |
35029 | API_MARKETING | REQUEST | The 'limit' has to be greater than zero and less than {maxLimitValue}. |
35030 | API_MARKETING | REQUEST | The 'offset' cannot be less than zero. |
35089 | API_MARKETING | BUSINESS | We are currently testing a premium ads product with a small invite-only group. We will share more information when we are ready to expand. |
35129 | API_MARKETING | BUSINESS | This method is not supported for campaigns with smart targeting type. |
36329 | API_MARKETING | REQUEST | The ad group Id is required. |
36347 | API_MARKETING | REQUEST | Currently only one value is supported for 'campaign_ids'. |
36350 | API_MARKETING | REQUEST | The 'negative_keyword_status' is invalid. |
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 Details for Multiple Negative Keywords
This example retrieves the details for multiple negative keywords.
Input
There is no additional input or request payload for this sample.
GEThttps://api.ebay.com/sell/marketing/v1/negative_keyword
Output
If the call is successful, the details for all available negative keywords are returned.