c# - Etsy API says UnAuthorized(401) when fetching access_token -
i following this question connect etsy api , have written following code:
class etsy { private const string access_token = "jagbkdwqii82lhiaj2pqcujd "; private const string secret = "is1bztdh2k"; private const string base_url = "https://openapi.etsy.com/v2"; private string token = ""; public etsy() { string f = ""; try { var request_token_url = base_url + "/oauth/request_token"; var oauth = new manager(); oauth["consumer_key"] = access_token; oauth["consumer_secret"] = secret; oauth.acquirerequesttoken(request_token_url, "post"); f = "required tokens = " + oauth["token"].tostring(); token = f; } catch (exception ex) { console.writeline("exception: "+ex.message); token = "exception :\n"+ex.message; } } public string show() { return token; } }
when running code keeps giving unauthorized(401)
error. same credentials use etsy python library works fine. doing wrong?
update:
i debugged further , found it's sending following headers:
header:- oauth oauth_callback="oob", oauth_consumer_key="jagbkdwqii82lhiaj2pqcujd", oauth_nonce="150z8543", oauth_signature="4qgkvgbif%2bqpoyncnnwwniirhjo%3d", oauth_signature_method="hmac-sha1", oauth_timestamp="1431409362", oauth_version="1.0"
is missing?
Comments
Post a Comment