<?php
$shop_id = "50273658"; 
$api_url = "https://openapi.etsy.com/v3/application/listings/1669589014";
$apiKey = "9vnyhcjjd9p6q4m239g9brio ";

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $api_url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    "x-api-key: $apiKey",
    'Content-Type: application/json'
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($curl);
//print_r($response);



$ch = curl_init();


curl_setopt($ch, CURLOPT_URL, "https://openapi.etsy.com/v3/application/shops/$shop_id/listings/1669589014/variation-images");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "x-api-key: $apiKey"
]);


$response = curl_exec($ch);


if(curl_errno($ch)) {
    echo 'Curl error: ' . curl_error($ch);
    exit;
}


curl_close($ch);


$responseData = json_decode($response, true);


echo "<pre>";
print_r($responseData);