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 ("https://developer.intuit.com/"). 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.
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" };
}
}
}
Image: