title: How to use quick book invoice api in asp.net
body: <p>I have a requirement to integerate Quickbook api with my web application. I just created a sample application to accomplish it. I am strange to this I really dont have any idea about how to connect the api or to consume the api.I have mentioned the codes that i have took from ("<a href="https://developer.intuit.com/" rel="nofollow noreferrer">https://developer.intuit.com/</a>").
  I tried by creating an app in the app manager, I have atttached the image FYR. After entering all those details i am not getting "accessTokenSecret" value. Here i just entered the apptoken valuea as accessToken value. Iam getting exception as "Unauthorized" in the service context  line. Help me on this. </p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using Intuit.Ipp.Core;
  using Intuit.Ipp.Services;
  using Intuit.Ipp.Data;
  using Intuit.Ipp.Utility;
  using Intuit.Ipp.Security;
  using Intuit.Ipp.Data.Qbo;
  using Newtonsoft.Json;
  
  namespace QuickBookApiConsumption
  {
      public partial class Invoice : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
  
          }
  
          protected void btnsendInvoiceDetails_Click(object sender, EventArgs e)
          {
              string accessToke = "";
              string appToken = "297db54bb5526b494dba97fb2a41063192cd";
              string accessTokenSecret = "297db54bb5526b494dba97fb2a41063192cd";
              string consumerKey = "qyprdMSG1YHpCPSlWQZTiKVc78dywR";
              string consumerSecret = "JPfXE17YnCPGU9m9vuXkF2M765bDb7blhcLB7HeF";
              string companyID = "812947125";
              OAuthRequestValidator oauthValidator = new OAuthRequestValidator(appToken, accessTokenSecret, consumerKey, consumerSecret);
              ServiceContext context = new ServiceContext(oauthValidator, appToken, companyID, IntuitServicesType.QBO);
              DataServices service = new DataServices(context);
              Invoice os = new Invoice();
              Intuit.Ipp.Data.Qbo.InvoiceHeader o = new Intuit.Ipp.Data.Qbo.InvoiceHeader();
              o.CustomerName = "Viki";
              o.CustomerId = new Intuit.Ipp.Data.Qbo.IdType { Value = "12" };
              o.ShipMethodName = "Email";
              o.SubTotalAmt = 3.00m;
              o.TotalAmt = 6.00m;
              o.ShipAddr = new Intuit.Ipp.Data.Qbo.PhysicalAddress { City = "Chni" };
  
          }
      }
  }
  </code></pre>
  
  <p><strong>Image:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/VZNxi.png" alt="QuickBook Api App Creation Image"></p>