Creating new listing on Etsy

Showing 1-7 of 7 messages
Creating new listing on Etsy 3dAvi 8/27/12 7:00 AM
Hi!

i am trying to create a new listing on Etsy, 

1)
i used oauth to authenticate and got
OAUTH_CONSUMER_KEY
and
OAUTH_CONSUMER_SECRET

2)
 i check it with this code and i got return og all the seller data, so everything is ok with the OAuth.



$oauth
= new OAuth(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
$oauth
->setToken("key","secret");

try {
 $data
= $oauth->fetch("http://openapi.etsy.com/v2/users/__SELF__", null, OAUTH_HTTP_METHOD_GET);
 $json
= $oauth->getLastResponse();
 print_r
(json_decode($json, true));
 
} catch (OAuthException $e) {
 error_log
($e->getMessage());
 error_log
(print_r($oauth->getLastResponse(), true));
 error_log
(print_r($oauth->getLastResponseInfo(), true));
 
exit;
}

3) i am trying to crate a new listings.
first i managed to create a new listing through the api browser on the production.
now, i want to create a new listing through PHP.
this is what i did, and it return my error:




this is my code:


$oauth = new OAuth(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET,OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);

$oauth
->setToken("key","secret");
 $params 
= array('description' => 'thisisdesc','materials' => 'yes','price'=>"5.99"
 
,'quantity'=>"2",'shipping_template_id'=>"52299",'shop_section_id'=>"1"
 
,'title'=>"thisistitle",'category_id'=>"i_did",'who_made'=>"5.99"
 
,'is_supply'=>"1",'when_made'=>"2010_2012");

 
 $oauth
->fetch($url, $params, OAUTH_HTTP_METHOD_POST);
 print_r
(json_decode($json, true));
 
} catch (OAuthException $e) {

 print_r
($e);

 error_log
($e->getMessage());
 error_log
(print_r($oauth->getLastResponse(), true));
 error_log
(print_r($oauth->getLastResponseInfo(), true));
 
exit;
}



i get the response of:
Invalid auth/bad request (got a 403, expected HTTP/1.1 20X or a redirect) 
This method not accessible to restricted API key. 


Please advise. thank you 



















Re: Creating new listing on Etsy Abe Stanway 8/27/12 2:32 PM
Hi - are you sure you have write access to a seller's listings? You'll need to click on your app (https://www.etsy.com/developers/your-apps), and check the box "Upload or edit listings". 
Re: Creating new listing on Etsy 3dAvi 8/30/12 3:47 AM
Hi

yes you are right, i ask full access but it is taken lots of time, it says 1-2 weeks.

is there anyone who have a inside app on etsy that can give my api key and secret.
i just want to run a script to upload all of my listings.

or, is there any other way that i can upload all of my listings, it is about 1000+ 
Re: Creating new listing on Etsy Abe Stanway 8/30/12 7:45 AM
Hi - sure, I can take a look for you. What is your app's name? What is the email address you registered it under?
Re: Creating new listing on Etsy chinaboy 9/4/12 2:32 AM
HI 3dAvi 
     Do you get Full Access in Production API,I am Limited Access.but it says i can operate in sanbox
Re: Creating new listing on Etsy 3dAvi 9/4/12 2:38 AM
Thank you , i have got a full access  and it worked but something strange mistake while creating a listing.

i use the same code, in the start it worked, i managed to create couple of listings. 
 but now  it keep telling me

The uri '/listings' doesn't map to a valid command  


Re: Creating new listing on Etsy 3dAvi 9/4/12 3:01 AM
Hi i fix IT

i upgrade my pecl oauth to 1.1 so it dosent work.
now i downgrade to oauth 1.0 and it works! 

thank you.

another problem i have is with the images, please help! 
i cant upload image, it say something with the header, please take a look on my post about it.
https://groups.google.com/forum/?fromgroups=#!topic/etsy-api-v2/KvNLQJhz_iM 


On Monday, August 27, 2012 5:00:15 PM UTC+3, 3dAvi wrote: