Skip to content

Latest commit

 

History

History
254 lines (187 loc) · 12.9 KB

ShopListingFileApi.md

File metadata and controls

254 lines (187 loc) · 12.9 KB

Swagger\Client\ShopListingFileApi

All URIs are relative to https://openapi.etsy.com

Method HTTP request Description
deleteListingFile DELETE /v3/application/shops/{shop_id}/listings/{listing_id}/files/{listing_file_id}
getAllListingFiles GET /v3/application/shops/{shop_id}/listings/{listing_id}/files
getListingFile GET /v3/application/shops/{shop_id}/listings/{listing_id}/files/{listing_file_id}
uploadListingFile POST /v3/application/shops/{shop_id}/listings/{listing_id}/files

deleteListingFile

deleteListingFile($shop_id, $listing_id, $listing_file_id)

General ReleaseReport bug

This endpoint is ready for production use.

Deletes a file from a specific listing. When you delete the final file for a digital listing, the listing converts into a physical listing. The response to a delete request returns a list of the remaining file records associated with the given listing.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\ShopListingFileApi(
    // 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
);
$shop_id = 56; // int | The unique positive non-zero numeric ID for an Etsy Shop.
$listing_id = 56; // int | The numeric ID for the [listing](/documentation/reference#tag/ShopListing) associated to this transaction.
$listing_file_id = 56; // int | The unique numeric ID of a file associated with a digital listing.

try {
    $apiInstance->deleteListingFile($shop_id, $listing_id, $listing_file_id);
} catch (Exception $e) {
    echo 'Exception when calling ShopListingFileApi->deleteListingFile: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
shop_id int The unique positive non-zero numeric ID for an Etsy Shop.
listing_id int The numeric ID for the listing associated to this transaction.
listing_file_id int The unique numeric ID of a file associated with a digital listing.

Return type

void (empty response body)

Authorization

api_key, oauth2

HTTP request headers

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

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

getAllListingFiles

\Swagger\Client\Model\ShopListingFiles getAllListingFiles($listing_id, $shop_id)

General ReleaseReport bug

This endpoint is ready for production use.

Retrieves all the files associated with the given digital listing. Requesting files from a physical listing returns an empty result.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\ShopListingFileApi(
    // 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
);
$listing_id = 56; // int | The numeric ID for the [listing](/documentation/reference#tag/ShopListing) associated to this transaction.
$shop_id = 56; // int | The unique positive non-zero numeric ID for an Etsy Shop.

try {
    $result = $apiInstance->getAllListingFiles($listing_id, $shop_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ShopListingFileApi->getAllListingFiles: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
listing_id int The numeric ID for the listing associated to this transaction.
shop_id int The unique positive non-zero numeric ID for an Etsy Shop.

Return type

\Swagger\Client\Model\ShopListingFiles

Authorization

api_key, oauth2

HTTP request headers

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

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

getListingFile

\Swagger\Client\Model\ShopListingFile getListingFile($shop_id, $listing_id, $listing_file_id)

General ReleaseReport bug

This endpoint is ready for production use.

Retrieves a single file associated with the given digital listing. Requesting a file from a physical listing returns an empty result.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\ShopListingFileApi(
    // 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
);
$shop_id = 56; // int | The unique positive non-zero numeric ID for an Etsy Shop.
$listing_id = 56; // int | The numeric ID for the [listing](/documentation/reference#tag/ShopListing) associated to this transaction.
$listing_file_id = 56; // int | The unique numeric ID of a file associated with a digital listing.

try {
    $result = $apiInstance->getListingFile($shop_id, $listing_id, $listing_file_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ShopListingFileApi->getListingFile: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
shop_id int The unique positive non-zero numeric ID for an Etsy Shop.
listing_id int The numeric ID for the listing associated to this transaction.
listing_file_id int The unique numeric ID of a file associated with a digital listing.

Return type

\Swagger\Client\Model\ShopListingFile

Authorization

api_key, oauth2

HTTP request headers

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

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

uploadListingFile

\Swagger\Client\Model\ShopListingFile uploadListingFile($shop_id, $listing_id, $listing_file_id, $file, $name, $rank)

General ReleaseReport bug

This endpoint is ready for production use.

Uploads a new file for a digital listing, or associates an existing file with a specific listing. You must either provide the `listing_file_id` of an existing file, or the name and binary file data for a file to upload. Associating an existing file to a physical listing converts the physical listing into a digital listing, which removes all shipping costs and any product and inventory variations.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\ShopListingFileApi(
    // 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
);
$shop_id = 56; // int | The unique positive non-zero numeric ID for an Etsy Shop.
$listing_id = 56; // int | The numeric ID for the [listing](/documentation/reference#tag/ShopListing) associated to this transaction.
$listing_file_id = 56; // int | 
$file = "file_example"; // string | 
$name = "name_example"; // string | 
$rank = 56; // int | 

try {
    $result = $apiInstance->uploadListingFile($shop_id, $listing_id, $listing_file_id, $file, $name, $rank);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ShopListingFileApi->uploadListingFile: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
shop_id int The unique positive non-zero numeric ID for an Etsy Shop.
listing_id int The numeric ID for the listing associated to this transaction.
listing_file_id int [optional]
file string****string [optional]
name string [optional]
rank int [optional]

Return type

\Swagger\Client\Model\ShopListingFile

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

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