Creating new listing on Etsy

949 views
Skip to first unread message

3dAvi

unread,
Aug 27, 2012, 10:00:15 AM8/27/12
to etsy-...@googlegroups.com
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 



















Abe Stanway

unread,
Aug 27, 2012, 5:32:01 PM8/27/12
to etsy-...@googlegroups.com
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". 

3dAvi

unread,
Aug 30, 2012, 6:47:06 AM8/30/12
to etsy-...@googlegroups.com
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+ 

Abe Stanway

unread,
Aug 30, 2012, 10:45:41 AM8/30/12
to etsy-...@googlegroups.com
Hi - sure, I can take a look for you. What is your app's name? What is the email address you registered it under?

chinaboy

unread,
Sep 4, 2012, 5:32:34 AM9/4/12
to etsy-...@googlegroups.com
HI 3dAvi 
     Do you get Full Access in Production API,I am Limited Access.but it says i can operate in sanbox

3dAvi

unread,
Sep 4, 2012, 5:38:12 AM9/4/12
to etsy-...@googlegroups.com
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  


3dAvi

unread,
Sep 4, 2012, 6:01:27 AM9/4/12
to etsy-...@googlegroups.com
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.


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

Sathya Anand

unread,
May 8, 2020, 5:40:00 PM5/8/20
to Etsy API
Sir could you please give full access to our app also.
i am trying to create a new listing on Etsy, 
I have done all the oauth authentication process.
I get response like
Invalid auth/bad request (got a 403, expected HTTP/1.1 20X or a redirect) 
This method not accessible to restricted API key. 
I kindly requested for full access.and it tells it may take upto 2 weeks..
but as we are doing project want to submit in 2days..kindly give full access..
APP NAME:Listingapp
email address: motsy...@gmail.com
Reply all
Reply to author
Forward
0 new messages