0

I'm working with Etsy API . I got ConsumerKey , ConsumerSecret , OauthToken , OauthTokenSecret . Now i want to make request that need require Authorize

My code like this

        var client = new OAuthRequest
        {
            Method = "GET",
            Type = OAuthRequestType.ProtectedResource,
            SignatureMethod = OAuthSignatureMethod.HmacSha1,
            ConsumerKey = ConsumerKey,
            ConsumerSecret = ConsumerSecret,
            Token = OauthToken,
            TokenSecret = OauthTokenSecret,
            RequestUrl = requestUrl,
        };

        requestUrl += "?" + client.GetAuthorizationQuery();

        var restClient = new RestClient();

        var restRequest = new RestRequest(requestUrl, Method.GET);
        var result = restClient.Execute(restRequest).Content;

But i got result oauth_problem=token_rejected

Any help would be greatly appreciated.

Dakota
  • 495
  • 2
  • 10
  • Hello! Where you're calling `client.GetAuthorizationQuery()`, does it return a key-value pair, like `key=value`, so in your RequestUrl it would look like `?key=value`? If not, could you try calling `restRequest.AddQueryParameter()` & passing in what's returned from `GetAuthorizationQuery()`? – ZachOverflow Mar 31 '21 at 22:55
  • I also found a similar question, not sure if it’s related but see the answer - https://stackoverflow.com/questions/26954935/etsy-oauth-authentication-c-sharp-restsharp?r=SearchResults – ZachOverflow Apr 01 '21 at 00:29
  • Thank you @ZachOverflow . Can you help how can check account suspended ? – Dakota Apr 15 '21 at 04:50

0 Answers0