Skip to content

Latest commit

 

History

History
366 lines (267 loc) · 18.6 KB

ShopListingImageApi.md

File metadata and controls

366 lines (267 loc) · 18.6 KB

Swagger\Client\ShopListingImageApi

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

Method HTTP request Description
deleteListingImage DELETE /v3/application/shops/{shop_id}/listings/{listing_id}/images/{listing_image_id}
getListingImage GET /v3/application/listings/{listing_id}/images/{listing_image_id}
getListingImageDeprecated GET /v3/application/shops/{shop_id}/listings/{listing_id}/images/{listing_image_id}
getListingImages GET /v3/application/listings/{listing_id}/images
getListingImagesDeprecated GET /v3/application/shops/{shop_id}/listings/{listing_id}/images
uploadListingImage POST /v3/application/shops/{shop_id}/listings/{listing_id}/images

deleteListingImage

deleteListingImage($shop_id, $listing_id, $listing_image_id)

General ReleaseReport bug

This endpoint is ready for production use.

Open API V3 endpoint to delete a listing image. A copy of the file remains on our servers, and so a deleted image may be re-associated with the listing without re-uploading the original image; see uploadListingImage.

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\ShopListingImageApi(
    // 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_image_id = 56; // int | The numeric ID of the primary [listing image](/documentation/reference#tag/ShopListing-Image) for this transaction.

try {
    $apiInstance->deleteListingImage($shop_id, $listing_id, $listing_image_id);
} catch (Exception $e) {
    echo 'Exception when calling ShopListingImageApi->deleteListingImage: ', $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_image_id int The numeric ID of the primary listing image for this transaction.

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]

getListingImage

\Swagger\Client\Model\ListingImage getListingImage($listing_id, $listing_image_id)

General ReleaseReport bug

This endpoint is ready for production use.

Retrieves the references and metadata for a listing image with a specific image ID.

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');

$apiInstance = new Swagger\Client\Api\ShopListingImageApi(
    // 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.
$listing_image_id = 56; // int | The numeric ID of the primary [listing image](/documentation/reference#tag/ShopListing-Image) for this transaction.

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

Parameters

Name Type Description Notes
listing_id int The numeric ID for the listing associated to this transaction.
listing_image_id int The numeric ID of the primary listing image for this transaction.

Return type

\Swagger\Client\Model\ListingImage

Authorization

api_key

HTTP request headers

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

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

getListingImageDeprecated

\Swagger\Client\Model\ListingImage getListingImageDeprecated($shop_id, $listing_id, $listing_image_id)

General ReleaseReport bug

This endpoint is ready for production use.

NOTE: This endpoint is being deprecated in favor of not requiring the shops/:shop_id as part of the URL. Retrieves the references and metadata for a listing image with a specific image ID.

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');

$apiInstance = new Swagger\Client\Api\ShopListingImageApi(
    // 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_image_id = 56; // int | The numeric ID of the primary [listing image](/documentation/reference#tag/ShopListing-Image) for this transaction.

try {
    $result = $apiInstance->getListingImageDeprecated($shop_id, $listing_id, $listing_image_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ShopListingImageApi->getListingImageDeprecated: ', $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_image_id int The numeric ID of the primary listing image for this transaction.

Return type

\Swagger\Client\Model\ListingImage

Authorization

api_key

HTTP request headers

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

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

getListingImages

\Swagger\Client\Model\ListingImages getListingImages($listing_id)

General ReleaseReport bug

This endpoint is ready for production use.

Retrieves all listing image resources for a listing with a specific listing ID.

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');

$apiInstance = new Swagger\Client\Api\ShopListingImageApi(
    // 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.

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

Parameters

Name Type Description Notes
listing_id int The numeric ID for the listing associated to this transaction.

Return type

\Swagger\Client\Model\ListingImages

Authorization

api_key

HTTP request headers

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

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

getListingImagesDeprecated

\Swagger\Client\Model\ListingImages getListingImagesDeprecated($shop_id, $listing_id)

General ReleaseReport bug

This endpoint is ready for production use.

NOTE: This endpoint is being deprecated in favor of not requiring the shops/:shop_id as part of the URL. Retrieves all listing image resources for a listing with a specific listing ID.

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');

$apiInstance = new Swagger\Client\Api\ShopListingImageApi(
    // 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.

try {
    $result = $apiInstance->getListingImagesDeprecated($shop_id, $listing_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ShopListingImageApi->getListingImagesDeprecated: ', $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.

Return type

\Swagger\Client\Model\ListingImages

Authorization

api_key

HTTP request headers

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

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

uploadListingImage

\Swagger\Client\Model\ListingImage uploadListingImage($shop_id, $listing_id, $image, $listing_image_id, $rank, $overwrite, $is_watermarked, $alt_text)

General ReleaseReport bug

This endpoint is ready for production use.

Uploads or assigns an image to a listing identified by a shop ID with a listing ID. To upload a new image, set the image file as the value for the `image` parameter. You can assign a previously deleted image to a listing using the deleted image's image ID in the `listing_image_id` parameter. When a request contains both `image` and `listing_image_id` parameter values, the endpoint uploads the image in the `image` parameter only. Note: When uploading a new image, data such as colors and size may return as null values due to asynchronous processing of the image. Use getListingImage endpoint to fetch these values.

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\ShopListingImageApi(
    // 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.
$image = "image_example"; // string | 
$listing_image_id = 56; // int | 
$rank = 56; // int | 
$overwrite = true; // bool | 
$is_watermarked = true; // bool | 
$alt_text = "alt_text_example"; // string | 

try {
    $result = $apiInstance->uploadListingImage($shop_id, $listing_id, $image, $listing_image_id, $rank, $overwrite, $is_watermarked, $alt_text);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ShopListingImageApi->uploadListingImage: ', $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.
image string****string [optional]
listing_image_id int [optional]
rank int [optional]
overwrite bool [optional]
is_watermarked bool [optional]
alt_text string [optional]

Return type

\Swagger\Client\Model\ListingImage

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]