I try to use oAuth to get data through the etsy.com API. I did everything according to their instructions :
Received:
<?php $conskey = 'm4cztdgpbparyv8223hyxdoqw'; $conssec = '63fur1wp9on'; $oauth = new OAuth($conskey, $conssec, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI); $req_token = $oauth->getRequestToken("https://openapi.etsy.com/v2/oauth/request_token?scope=email_r%20transactions_r&profile_r&address_r", 'oob', "GET"); $oauth->setToken($req_token['oauth_token'], $req_token['oauth_token_secret']); print_r($req_token); $acc_token = $oauth->getAccessToken("https://openapi.etsy.com/v2/oauth/access_token", null, '2b875b97', "GET"); print_r($acc_token); ?> I get fatalka:
Fatal error: Uncaught OAuthException: Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect) in /home/vagrant/html/project2/index.php on line 21 I feel that I’m somehow confused with verified_token , I manually entered it from my account after the initial authorization ( 2b875b97 ). I do not know what to do, tell me what could be the error.
scope=email_r%20transactions_r"% 20" means a space, and your remaining scopes are separated by "&". Maybe they, too, "% 20" separated? - Dmitry Kozlov