Skip to content

Latest commit

 

History

History
265 lines (174 loc) · 12.7 KB

AdReportTaskApi.md

File metadata and controls

265 lines (174 loc) · 12.7 KB

eBay\Sell\Marketing\AdReportTaskApi

All URIs are relative to https://api.ebay.com/sell/marketing/v1.

Method HTTP request Description
createReportTask() POST /ad_report_task
deleteReportTask() DELETE /ad_report_task/{report_task_id}
getReportTask() GET /ad_report_task/{report_task_id}
getReportTasks() GET /ad_report_task

createReportTask()

createReportTask($create_report_task)

This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. When creating a report task, you can specify the items you want included in the report. The items you specify, using either listingId or inventoryReference values, must be in a Promoted Listings campaign for them to be included in the report. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type.

Example

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


// Configure OAuth2 access token for authorization: api_auth
$config = eBay\Sell\Marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = eBay\Sell\Marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new eBay\Sell\Marketing\Api\AdReportTaskApi(
    // 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
);
$create_report_task = new \eBay\Sell\Marketing\Model\CreateReportTask(); // \eBay\Sell\Marketing\Model\CreateReportTask | The container for the fields that define the report task.

try {
    $apiInstance->createReportTask($create_report_task);
} catch (Exception $e) {
    echo 'Exception when calling AdReportTaskApi->createReportTask: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
create_report_task \eBay\Sell\Marketing\Model\CreateReportTask The container for the fields that define the report task.

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]

deleteReportTask()

deleteReportTask($report_task_id)

This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks.

Example

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


// Configure OAuth2 access token for authorization: api_auth
$config = eBay\Sell\Marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = eBay\Sell\Marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new eBay\Sell\Marketing\Api\AdReportTaskApi(
    // 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
);
$report_task_id = 'report_task_id_example'; // string | A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask.

try {
    $apiInstance->deleteReportTask($report_task_id);
} catch (Exception $e) {
    echo 'Exception when calling AdReportTaskApi->deleteReportTask: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
report_task_id string A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask.

Return type

void (empty response body)

Authorization

api_auth, api_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

getReportTask()

getReportTask($report_task_id): \eBay\Sell\Marketing\Model\ReportTask

This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks.

Example

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


// Configure OAuth2 access token for authorization: api_auth
$config = eBay\Sell\Marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = eBay\Sell\Marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new eBay\Sell\Marketing\Api\AdReportTaskApi(
    // 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
);
$report_task_id = 'report_task_id_example'; // string | A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask.

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

Parameters

Name Type Description Notes
report_task_id string A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask.

Return type

\eBay\Sell\Marketing\Model\ReportTask

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]

getReportTasks()

getReportTasks($limit, $offset, $report_task_statuses): \eBay\Sell\Marketing\Model\ReportTaskPagedCollection

This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result.

Example

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


// Configure OAuth2 access token for authorization: api_auth
$config = eBay\Sell\Marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = eBay\Sell\Marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new eBay\Sell\Marketing\Api\AdReportTaskApi(
    // 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
);
$limit = 'limit_example'; // string | Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500
$offset = 'offset_example'; // string | Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0
$report_task_statuses = 'report_task_statuses_example'; // string | This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values: &nbsp;&nbsp;&nbsp;PENDING &nbsp;&nbsp;&nbsp;SUCCESS &nbsp;&nbsp;&nbsp;FAILED

try {
    $result = $apiInstance->getReportTasks($limit, $offset, $report_task_statuses);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdReportTaskApi->getReportTasks: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
limit string Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 [optional]
offset string Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 [optional]
report_task_statuses string This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values: &nbsp;&nbsp;&nbsp;PENDING &nbsp;&nbsp;&nbsp;SUCCESS &nbsp;&nbsp;&nbsp;FAILED [optional]

Return type

\eBay\Sell\Marketing\Model\ReportTaskPagedCollection

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]