Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect) on getRequestToken

1,000 views
Skip to first unread message

Marc Roger

unread,
Dec 17, 2016, 3:37:51 PM12/17/16
to Etsy API
Hello,

I'm testing the Etsy API with PHP but when i try to do this step (https://www.etsy.com/developers/documentation/getting_started/oauth#section_obtaining_token_credentials), the following method always return a 401 error:


The error message is: Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect)

I had to disable the ssl check ($oauth->disableSSLChecks()) and sending the correct credentials. I've read somewhere that this erros can be generated because of the difference between timezomes (I am testing this from my localhost in Spain).

Can you help me?

Thanks in advance.

Marc Roger

unread,
Dec 19, 2016, 9:17:43 AM12/19/16
to Etsy API
Oops, sorry guys, I was wrong. The problem is not located in the getRequestToken I've wrote. The 401 error comes when I try to obtain the token credentials bt sending the verifier code received from the URL:

// set the verifier and request Etsy's token credentials url
$acc_token = $oauth2->getAccessToken("https://openapi.etsy.com/v2/oauth/access_token", null, $verifier);

Thanks.

con...@throwninstone.co.uk

unread,
Jan 28, 2018, 11:26:02 AM1/28/18
to Etsy API
I'm stuck with this too. Did you ever find a solution?

Jacob Scheele

unread,
Dec 18, 2019, 3:32:24 PM12/18/19
to Etsy API
Also having this issue, tried updating server time and disableSSLChecks. Doesn't seem to be much else out there as far as solutions from what I've found.

Amit Shukla

unread,
Dec 19, 2019, 10:06:51 AM12/19/19
to Etsy API
Hello all, 
I think you are trying to place a getRequestToken via private app on Etsy that Etsy account which is not created on same developer acoount. 
In simple words 
    -> If you have private Etsy app , then you can only request api's on shops created with same Developer account.
If you are getting this issue via public Etsy app, plz let me know in details the request data and headers. I may help you in this regards.
Thanks

kiran iftikhar

unread,
May 28, 2020, 9:10:18 AM5/28/20
to Etsy API
Hi 

How do i know that my APP is public or private? i am currently in developer mode. New to etsy integration . please guide me.

Thanks 
Kiran
Reply all
Reply to author
Forward
0 new messages