title: Ebay Auth token
body: <p>I'm using Sandbox Auth. Token here and it always sends me an error like this.</p>
  
  <p><strong>Error: Auth token is invalid. Validation of the authentication token in API request failed.</strong></p>
  
  <p>But if I use my Production Auth. Token it seems to workout and has no problem at all.</p>
  
  <p>I've also checked the validity of my Sandbox Token and the expiration date is November 2016 which is far enough. Can someone please help me regarding my problem? Thanks in advance.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>require __DIR__.'/../vendor/autoload.php';
  
  $config = require __DIR__.'/../configuration.php';
  
  use \DTS\eBaySDK\Constants;
  use \DTS\eBaySDK\Trading\Services;
  use \DTS\eBaySDK\Trading\Types;
  use \DTS\eBaySDK\Trading\Enums;
  
  $service = new Services\TradingService(array(
      'apiVersion' =&gt; $config['tradingApiVersion'],
      'siteId' =&gt; Constants\SiteIds::US
  ));
  
  $request = new Types\GetMyeBaySellingRequestType();
  
  $request-&gt;RequesterCredentials = new Types\CustomSecurityHeaderType();
  $request-&gt;RequesterCredentials-&gt;eBayAuthToken = $config['sandbox']['userToken'];
  
  $request-&gt;ActiveList = new Types\ItemListCustomizationType();
  $request-&gt;ActiveList-&gt;Include = true;
  $request-&gt;ActiveList-&gt;Pagination = new Types\PaginationType();
  $request-&gt;ActiveList-&gt;Pagination-&gt;EntriesPerPage = 10;
  $request-&gt;ActiveList-&gt;Sort = Enums\ItemSortTypeCodeType::C_CURRENT_PRICE_DESCENDING;
  
  $pageNum = 1;
  
  do {
      $request-&gt;ActiveList-&gt;Pagination-&gt;PageNumber = $pageNum;
      $response = $service-&gt;getMyeBaySelling($request);
  
  echo "==================\nResults for page $pageNum\n==================\n";
  
  if (isset($response-&gt;Errors)) {
      foreach ($response-&gt;Errors as $error) {
          printf("%s: %s\n%s\n\n",
              $error-&gt;SeverityCode === Enums\SeverityCodeType::C_ERROR ? 'Error' : 'Warning',
              $error-&gt;ShortMessage,
              $error-&gt;LongMessage
          );
      }
  }
  
  if ($response-&gt;Ack !== 'Failure' &amp;&amp; isset($response-&gt;ActiveList)) {
      foreach ($response-&gt;ActiveList-&gt;ItemArray-&gt;Item as $item) {
          printf("(%s) %s: %s %.2f\n",
              $item-&gt;ItemID,
              $item-&gt;Title,
              $item-&gt;SellingStatus-&gt;CurrentPrice-&gt;currencyID,
              $item-&gt;SellingStatus-&gt;CurrentPrice-&gt;value
          );
      }
  }
  
  $pageNum += 1;
  
  } while(isset($response-&gt;ActiveList) &amp;&amp; $pageNum &lt;= $response-&gt;ActiveList-&gt;PaginationResult-&gt;TotalNumberOfPages);
  </code></pre>
  
  <p>Credits to Sir David T. Sadler</p>