Open ipsod opened 9 years ago
To save a time, post please details about Etsy image uploading.
It's a bit of a pain to set up, since you (seemingly) first have to create a shipping template, then create a listing using that shipping template's id, then upload an image to the listing. Here's a link to Etsy's documentation:
ShippingTemplate https://www.etsy.com/developers/documentation/reference/shippingtemplate#method_createshippingtemplate
Listing https://www.etsy.com/developers/documentation/reference/listing#method_createlisting
ListingImage https://www.etsy.com/developers/documentation/reference/listingimage#section_uploading_images
Here's the array I used for creating a listing - could save you some keystrokes:
$fields = array(
'quantity' => (integer) 1,
'title' => 'Product',
'state' => 'draft',
'description' => 'Testing description.',
'price' => (float) 42.42,
'materials' => array('glass'),
'shipping_template_id' => (integer) $shipping_template_id,
//'shop_section_id' => null,
//'is_customizable' => null,
//'non_taxable' => null,
//'image_ids' => null,
//'image' => null,
'processing_min' => 1,
'processing_max' => 3,
'category_id' => 68890894, // art and collectibles / glass art / sculptures and figurines
'taxonomy_id' => 2889, // art and collectibles / glass art / sculptures and figurines
'tags' => 'glass,marble,lampwork,bead', // validate using regex pattern: /[^\p{L}\p{Nd}\p{Zs}\-'™©®]/u
'who_made' => 'i_did',
'is_supply' => (boolean) 0,
'when_made' => '2010_2015',
//'recipient' => null,
//'occasion' => null,
//'style' => null
);
Thank you, I will see it soon
Cool, thank you!
Soon :)
Thanks. But I am stuck with the same problem. What i did is: After creating shipping template and listing, for uploading image: $url = "https://openapi.etsy.com/v2/listings/".$this->listing['listing_id']."/images"; $i = str_replace($wp_dir['url'],$wp_dir['path'],$image); $data = [ '@image' => '@'.$i.';type='.$img_type['type'] ]; this gave me image path as : Array ( [@image] => @E:\xampp\htdocs\wordpress/wp-content/uploads/2018/01/cd_4_angle.jpg;type=image/jpeg )
also $url = "https://openapi.etsy.com/v2/listings/".$this->listing['listing_id']."/images"; $i = str_replace($wp_dir['url'],$wp_dir['path'],$image); $data = [ 'image' => '@'.$i.';type='.$img_type['type'] ]; this gave me image path as : Array ( [image] => @E:\xampp\htdocs\wordpress/wp-content/uploads/2018/01/cd_4_angle.jpg;type=image/jpeg ) and this too: $url = "https://openapi.etsy.com/v2/listings/".$this->listing['listing_id']."/images"; $i = str_replace($wp_dir['url'],$wp_dir['path'],$image); $data = [ 'image' => '@'.$i.';type='.$img_type['type'] ]; this gave me image path as : Array ( [image] => @http://localhost/wordpress/wp-content/uploads/2013/06/cd_6_angle.jpg;type=image/jpeg) But in none of the case image is uploading. Products lists are uploaded, but why my image are not uploading ? .I already saw the link above for uploading image in etsy api site. Could you please help me through this?
Did anyone figure it out? I'm stuck on the same problem
The example for this in Etsy's documentation.
This worked for me, though: https://notestoself.dev/posts/etsy-api-php-oauth-listing-image-upload/
I've not used your package, but its predecessor. I was able to list an item on etsy, but failed to upload an image to an etsy listing. Would you please write an example of an etsy image upload?