Skip to content

Latest commit

 

History

History
408 lines (273 loc) · 28.2 KB

NegativeKeywordApi.md

File metadata and controls

408 lines (273 loc) · 28.2 KB

macropage\SDKs\ebay\rest\marketing\NegativeKeywordApi

All URIs are relative to https://api.ebay.com/sell/marketing/v1, except if the operation defines another base path.

Method HTTP request Description
bulkCreateNegativeKeyword() POST /bulk_create_negative_keyword
bulkUpdateNegativeKeyword() POST /bulk_update_negative_keyword
createNegativeKeyword() POST /negative_keyword
getNegativeKeyword() GET /negative_keyword/{negative_keyword_id}
getNegativeKeywords() GET /negative_keyword
updateNegativeKeyword() PUT /negative_keyword/{negative_keyword_id}

bulkCreateNegativeKeyword()

bulkCreateNegativeKeyword($contentType, $bulkCreateNegativeKeywordRequest): \macropage\SDKs\ebay\rest\marketing\Model\BulkCreateNegativeKeywordResponse

<span class="tablenote">Note: This method is only available for select partners who have been approved for the eBay Promoted Listings Advanced (PLA) program. For information about how to request access to this program, refer to <a href="/api-docs/sell/static/marketing/pl-verify-eligibility.html#access-requests " target="_blank "> Promoted Listings Advanced Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for PLA, use the <a href="/api-docs/sell/account/resources/advertising_eligibility/methods/getAdvertisingEligibility " target="_blank ">getAdvertisingEligibility method in Account API.
This method adds negative keywords, in bulk, to an existing ad group in a PLA campaign that uses manual targeting.

Specify the campaignId and adGroupId in the request body, along with the negativeKeywordText and negativeKeywordMatchType.

Call the <a href="/api-docs/sell/marketing/resources/campaign/methods/getCampaigns">getCampaigns method to retrieve a list of current campaign IDs for a specified seller.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\marketing\Api\NegativeKeywordApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$contentType = 'contentType_example'; // string | This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>.
$bulkCreateNegativeKeywordRequest = new \macropage\SDKs\ebay\rest\marketing\Model\BulkCreateNegativeKeywordRequest(); // \macropage\SDKs\ebay\rest\marketing\Model\BulkCreateNegativeKeywordRequest | A type that defines the fields for the bulk request to create negative keywords.

try {
    $result = $apiInstance->bulkCreateNegativeKeyword($contentType, $bulkCreateNegativeKeywordRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NegativeKeywordApi->bulkCreateNegativeKeyword: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
contentType string This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=&quot;/api-docs/static/rest-request-components.html#HTTP&quot; target=&quot;_blank &quot;>HTTP request headers</a>.
bulkCreateNegativeKeywordRequest \macropage\SDKs\ebay\rest\marketing\Model\BulkCreateNegativeKeywordRequest A type that defines the fields for the bulk request to create negative keywords.

Return type

\macropage\SDKs\ebay\rest\marketing\Model\BulkCreateNegativeKeywordResponse

Authorization

api_auth, api_auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

bulkUpdateNegativeKeyword()

bulkUpdateNegativeKeyword($contentType, $bulkUpdateNegativeKeywordRequest): \macropage\SDKs\ebay\rest\marketing\Model\BulkUpdateNegativeKeywordResponse

<span class="tablenote">Note: This method is only available for select partners who have been approved for the eBay Promoted Listings Advanced (PLA) program. For information about how to request access to this program, refer to <a href="/api-docs/sell/static/marketing/pl-verify-eligibility.html#access-requests " target="_blank "> Promoted Listings Advanced Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for PLA, use the <a href="/api-docs/sell/account/resources/advertising_eligibility/methods/getAdvertisingEligibility " target="_blank ">getAdvertisingEligibility method in Account API.
This method updates the statuses of existing negative keywords, in bulk.

Specify the negativeKeywordId and negativeKeywordStatus in the request body.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\marketing\Api\NegativeKeywordApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$contentType = 'contentType_example'; // string | This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>.
$bulkUpdateNegativeKeywordRequest = new \macropage\SDKs\ebay\rest\marketing\Model\BulkUpdateNegativeKeywordRequest(); // \macropage\SDKs\ebay\rest\marketing\Model\BulkUpdateNegativeKeywordRequest | A type that defines the fields for the bulk request to update negative keyword statuses.

try {
    $result = $apiInstance->bulkUpdateNegativeKeyword($contentType, $bulkUpdateNegativeKeywordRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NegativeKeywordApi->bulkUpdateNegativeKeyword: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
contentType string This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=&quot;/api-docs/static/rest-request-components.html#HTTP&quot; target=&quot;_blank &quot;>HTTP request headers</a>.
bulkUpdateNegativeKeywordRequest \macropage\SDKs\ebay\rest\marketing\Model\BulkUpdateNegativeKeywordRequest A type that defines the fields for the bulk request to update negative keyword statuses.

Return type

\macropage\SDKs\ebay\rest\marketing\Model\BulkUpdateNegativeKeywordResponse

Authorization

api_auth, api_auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createNegativeKeyword()

createNegativeKeyword($contentType, $createNegativeKeywordRequest): object

<span class="tablenote">Note: This method is only available for select partners who have been approved for the eBay Promoted Listings Advanced (PLA) program. For information about how to request access to this program, refer to <a href="/api-docs/sell/static/marketing/pl-verify-eligibility.html#access-requests " target="_blank "> Promoted Listings Advanced Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for PLA, use the <a href="/api-docs/sell/account/resources/advertising_eligibility/methods/getAdvertisingEligibility " target="_blank ">getAdvertisingEligibility method in Account API.
This method adds a negative keyword to an existing ad group in a PLA campaign that uses manual targeting.

Specify the campaignId and adGroupId in the request body, along with the negativeKeywordText and negativeKeywordMatchType.

Call the <a href="/api-docs/sell/marketing/resources/campaign/methods/getCampaigns">getCampaigns method to retrieve a list of current campaign IDs for a specified seller.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\marketing\Api\NegativeKeywordApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$contentType = 'contentType_example'; // string | This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>.
$createNegativeKeywordRequest = new \macropage\SDKs\ebay\rest\marketing\Model\CreateNegativeKeywordRequest(); // \macropage\SDKs\ebay\rest\marketing\Model\CreateNegativeKeywordRequest | A type that defines the fields for the request to create a negative keyword.

try {
    $result = $apiInstance->createNegativeKeyword($contentType, $createNegativeKeywordRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NegativeKeywordApi->createNegativeKeyword: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
contentType string This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=&quot;/api-docs/static/rest-request-components.html#HTTP&quot; target=&quot;_blank &quot;>HTTP request headers</a>.
createNegativeKeywordRequest \macropage\SDKs\ebay\rest\marketing\Model\CreateNegativeKeywordRequest A type that defines the fields for the request to create a negative keyword.

Return type

object

Authorization

api_auth, api_auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getNegativeKeyword()

getNegativeKeyword($negativeKeywordId): \macropage\SDKs\ebay\rest\marketing\Model\NegativeKeyword

<span class="tablenote">Note: This method is only available for select partners who have been approved for the eBay Promoted Listings Advanced (PLA) program. For information about how to request access to this program, refer to <a href="/api-docs/sell/static/marketing/pl-verify-eligibility.html#access-requests " target="_blank "> Promoted Listings Advanced Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for PLA, use the <a href="/api-docs/sell/account/resources/advertising_eligibility/methods/getAdvertisingEligibility " target="_blank ">getAdvertisingEligibility method in Account API.
This method retrieves details on a specific negative keyword.

In the request, specify the negative_keyword_id as a path parameter.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\marketing\Api\NegativeKeywordApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$negativeKeywordId = 'negativeKeywordId_example'; // string | This path parameter specifies the unique identifier for the negative keyword being retrieved.<br /><br />Use the <a href=\"/api-docs/sell/marketing/resources/negative_keyword/methods/getNegativeKeywords\" target=\"_blank \"> getNegativeKeywords</a> method to retrieve negative keyword IDs.

try {
    $result = $apiInstance->getNegativeKeyword($negativeKeywordId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NegativeKeywordApi->getNegativeKeyword: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
negativeKeywordId string This path parameter specifies the unique identifier for the negative keyword being retrieved.<br /><br />Use the <a href=&quot;/api-docs/sell/marketing/resources/negative_keyword/methods/getNegativeKeywords&quot; target=&quot;_blank &quot;> getNegativeKeywords</a> method to retrieve negative keyword IDs.

Return type

\macropage\SDKs\ebay\rest\marketing\Model\NegativeKeyword

Authorization

api_auth, api_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getNegativeKeywords()

getNegativeKeywords($adGroupIds, $campaignIds, $limit, $negativeKeywordStatus, $offset): \macropage\SDKs\ebay\rest\marketing\Model\NegativeKeywordPagedCollectionResponse

<span class="tablenote">Note: This method is only available for select partners who have been approved for the eBay Promoted Listings Advanced (PLA) program. For information about how to request access to this program, refer to <a href="/api-docs/sell/static/marketing/pl-verify-eligibility.html#access-requests " target="_blank "> Promoted Listings Advanced Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for PLA, use the <a href="/api-docs/sell/account/resources/advertising_eligibility/methods/getAdvertisingEligibility " target="_blank ">getAdvertisingEligibility method in Account API.
This method can be used to retrieve all of the negative keywords for ad groups in PLA 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 <a href="/api-docs/sell/marketing/resources/campaign/methods/getCampaigns">getCampaigns method to retrieve a list of current campaign IDs for a seller.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\marketing\Api\NegativeKeywordApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$adGroupIds = 'adGroupIds_example'; // string | A comma-separated list of ad group IDs.<br /><br />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.<br /><br />Use the <a href=\"/api-docs/sell/marketing/resources/adgroup/methods/getAdGroups\">getAdGroups</a> method to retrieve the ad group IDs for a seller.<br /><br /><i>Required if</i> the search results must be filtered to include negative keywords created at the ad group level.
$campaignIds = 'campaignIds_example'; // string | This path parameter specifies the unique eBay-assigned identifier of the ad campaign associated with the negative keywords being retrieved.<br /><br />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.<br /><br /><span class=\"tablenote\"><b>Note:</b> Currently, only one campaign ID value is supported for each request.</span><br><br> Use the <a href=\"/api-docs/sell/marketing/resources/campaign/methods/getCampaigns\" target=\"_blank\">getCampaigns</a> method to retrieve campaign IDs.
$limit = 'limit_example'; // string | The number of results, from the current result set, to be returned in a single page.
$negativeKeywordStatus = 'negativeKeywordStatus_example'; // string | A comma-separated list of negative keyword statuses.<br /><br />This query parameter is used if the seller wants to filter the search results based on one or more negative keyword statuses.<br><br> See <a href=\"/api-docs/sell/marketing/types/pls:NegativeKeywordStatusEnum\" target=\"_blank\">NegativeKeywordStatusEnum</a> for supported values.
$offset = 'offset_example'; // string | The number of results that will be skipped in the result set. This is used with the <b>limit</b> field to control the pagination of the output.<br /><br />For example, if the <b>offset</b> is set to <code>0</code> and the <b>limit</b> is set to <code>10</code>, the method will retrieve items 1 through 10 from the list of items returned. If the <b>offset</b> is set to <code>10</code> and the <b>limit</b> is set to <code>10</code>, the method will retrieve items 11 through 20 from the list of items returned.

try {
    $result = $apiInstance->getNegativeKeywords($adGroupIds, $campaignIds, $limit, $negativeKeywordStatus, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NegativeKeywordApi->getNegativeKeywords: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
adGroupIds string A comma-separated list of ad group IDs.<br /><br />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.<br /><br />Use the <a href=&quot;/api-docs/sell/marketing/resources/adgroup/methods/getAdGroups&quot;>getAdGroups</a> method to retrieve the ad group IDs for a seller.<br /><br /><i>Required if</i> the search results must be filtered to include negative keywords created at the ad group level. [optional]
campaignIds string This path parameter specifies the unique eBay-assigned identifier of the ad campaign associated with the negative keywords being retrieved.<br /><br />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.<br /><br /><span class=&quot;tablenote&quot;><b>Note:</b> Currently, only one campaign ID value is supported for each request.</span><br><br> Use the <a href=&quot;/api-docs/sell/marketing/resources/campaign/methods/getCampaigns&quot; target=&quot;_blank&quot;>getCampaigns</a> method to retrieve campaign IDs. [optional]
limit string The number of results, from the current result set, to be returned in a single page. [optional]
negativeKeywordStatus string A comma-separated list of negative keyword statuses.<br /><br />This query parameter is used if the seller wants to filter the search results based on one or more negative keyword statuses.<br><br> See <a href=&quot;/api-docs/sell/marketing/types/pls:NegativeKeywordStatusEnum&quot; target=&quot;_blank&quot;>NegativeKeywordStatusEnum</a> for supported values. [optional]
offset string The number of results that will be skipped in the result set. This is used with the <b>limit</b> field to control the pagination of the output.<br /><br />For example, if the <b>offset</b> is set to <code>0</code> and the <b>limit</b> is set to <code>10</code>, the method will retrieve items 1 through 10 from the list of items returned. If the <b>offset</b> is set to <code>10</code> and the <b>limit</b> is set to <code>10</code>, the method will retrieve items 11 through 20 from the list of items returned. [optional]

Return type

\macropage\SDKs\ebay\rest\marketing\Model\NegativeKeywordPagedCollectionResponse

Authorization

api_auth, api_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateNegativeKeyword()

updateNegativeKeyword($negativeKeywordId, $contentType, $updateNegativeKeywordRequest)

<span class="tablenote">Note: This method is only available for select partners who have been approved for the eBay Promoted Listings Advanced (PLA) program. For information about how to request access to this program, refer to <a href="/api-docs/sell/static/marketing/pl-verify-eligibility.html#access-requests " target="_blank "> Promoted Listings Advanced Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for PLA, use the <a href="/api-docs/sell/account/resources/advertising_eligibility/methods/getAdvertisingEligibility " target="_blank ">getAdvertisingEligibility method in Account API.
This method updates the status of an existing negative keyword.

Specify the negative_keyword_id as a path parameter, and specify the negativeKeywordStatus in the request body.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\marketing\Api\NegativeKeywordApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$negativeKeywordId = 'negativeKeywordId_example'; // string | The unique identifier for the negative keyword.<br /><br />This value is returned in the <b>Location</b> response header from the <a href=\"/api-docs/sell/marketing/resources/negative_keyword/methods/createNegativeKeyword\">createNegativeKeyword</a> method.
$contentType = 'contentType_example'; // string | This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>.
$updateNegativeKeywordRequest = new \macropage\SDKs\ebay\rest\marketing\Model\UpdateNegativeKeywordRequest(); // \macropage\SDKs\ebay\rest\marketing\Model\UpdateNegativeKeywordRequest | A type that defines the fields for the request to update a negative keyword.

try {
    $apiInstance->updateNegativeKeyword($negativeKeywordId, $contentType, $updateNegativeKeywordRequest);
} catch (Exception $e) {
    echo 'Exception when calling NegativeKeywordApi->updateNegativeKeyword: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
negativeKeywordId string The unique identifier for the negative keyword.<br /><br />This value is returned in the <b>Location</b> response header from the <a href=&quot;/api-docs/sell/marketing/resources/negative_keyword/methods/createNegativeKeyword&quot;>createNegativeKeyword</a> method.
contentType string This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=&quot;/api-docs/static/rest-request-components.html#HTTP&quot; target=&quot;_blank &quot;>HTTP request headers</a>.
updateNegativeKeywordRequest \macropage\SDKs\ebay\rest\marketing\Model\UpdateNegativeKeywordRequest A type that defines the fields for the request to update a negative keyword.

Return type

void (empty response body)

Authorization

api_auth, api_auth

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]