title: Intuit.Ipp.Exception.InvalidTokenException: Unauthorized
body: <p>I have built a QuickBooks Online integration using QuickBooks Anywhere. I am using the paid edition of QuickBooks Online, but my customer is using the trial. My app is currently in development mode and has not been approved by the Intuit Marketplace.</p>
  
  <p>This code works fine with my site. Does being on a trial of QuickBooks Online mean you can't write data? My customer was able to pull a list of accounts, vendors, and payment methods just fine.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>ItemQuery itQuery = new ItemQuery();
  itQuery.Name = "Unknown";
  itemsList = itQuery.ExecuteQuery&lt;Item&gt;();
  </code></pre>
  
  <blockquote>
    <p>QBO : Error 1/23/2013 12:59:48 PM Error querying items : Intuit.Ipp.Exception.InvalidTokenException: Unauthorized
       at Intuit.Ipp.Services.QboService.Get[T](IQboQuery qboQuery, String simpleQuery, Boolean isQuerySpecified)
       at Intuit.Ipp.Services.ServiceExtensions.ExecuteQuery[T](IQuery query, ServiceContext serviceContext)</p>
  </blockquote>
  
  <p>The customer can authenticate OK:</p>
  
  <pre><code>OAuthRequestValidator oauthValidator = new OAuthRequestValidator(acT, acTS, coK, coKS);
  IntuitServicesType st = IntuitServicesType.QBO;
  ServiceContext context = new ServiceContext(oauthValidator, acT, cId, st);
  dataServices = new DataServices(context);
  </code></pre>