title: How to fix issue calling Amazon SP-API, which always returns Unauthorized, even with valid Token and Signature
body: <p>I went through the guide of for getting setup to call the new SP-API (<a href="https://github.com/amzn/selling-partner-api-docs/blob/main/guides/developer-guide/SellingPartnerApiDeveloperGuide.md" rel="noreferrer">https://github.com/amzn/selling-partner-api-docs/blob/main/guides/developer-guide/SellingPartnerApiDeveloperGuide.md</a>), and during the process checked off all of the api areas to grant access to (i.e. Orders, Inventory, etc).  I am using the C# library provided by Amazon (<a href="https://github.com/amzn/selling-partner-api-models/tree/main/clients/sellingpartner-api-aa-csharp" rel="noreferrer">https://github.com/amzn/selling-partner-api-models/tree/main/clients/sellingpartner-api-aa-csharp</a>).  I successfully get an access token and successfully sign the request, but always get the following error: <strong>Access to requested resource is denied.  / Unauthorized, with no details.</strong>  I am trying to perform a simple get to the <strong>/orders/v0/orders</strong> endpoint.  Any ideas what I'm doing wrong?   Any help would be greatly appreciated!</p>
  <p>Below is my code:</p>
  <pre><code>private const string MARKETPLACE_ID = &quot;ATVPDKIKX0DER&quot;;
  
  var resource = $&quot;/orders/v0/orders&quot;;
  
  var client = new RestClient(&quot;https://sellingpartnerapi-na.amazon.com&quot;);
  
  IRestRequest restRequest = new RestRequest(resource, Method.GET);
  
  restRequest.AddParameter(&quot;MarketPlaceIds&quot;, MARKETPLACE_ID, ParameterType.QueryString);
  
  restRequest.AddParameter(&quot;CreatedAfter&quot;, DateTime.UtcNow.AddDays(-5), ParameterType.QueryString);
  
  
  
  var lwaAuthorizationCredentials = new LWAAuthorizationCredentials
  
  {
  
      ClientId = AMAZON_LWA_CLIENT_ID,
  
      ClientSecret = AMAZON_LWA_CLIENT_SECRET,
  
      RefreshToken = AMAZON_LWA_REFRESH_TOKEN,
  
      Endpoint = new Uri(&quot;https://api.amazon.com/auth/o2/token&quot;)
  
  };
  
  
  
  restRequest = new LWAAuthorizationSigner(lwaAuthorizationCredentials).Sign(restRequest);
  
  
  
  var awsAuthenticationCredentials = new AWSAuthenticationCredentials
  
  {
  
      AccessKeyId = AMAZON_ACCESS_KEY_ID,
  
      SecretKey = AMAZON_ACCESS_SECRET,
  
      Region = &quot;us-east-1&quot;
  
  };
  
  
  
  restRequest = new AWSSigV4Signer(awsAuthenticationCredentials).Sign(restRequest, client.BaseUrl.Host);
  
  var response = client.Execute(restRequest);
  </code></pre>