Connect an ASP.NET Application to QuickBooks Online Edition

I am trying to create an ASP.NET page that connects to QuickBooks Online Edition, reads a couple of values ​​and displays the results. So far, I have downloaded the QuickBooks SDK, but I have not been able to find a simple step-by-step example of how to create an asp.net page to connect to QuickBooks Online. The documentation of the QuickBooks SDK and the SDK itself is very confusing and overwhelming. Does anyone know a simple step-by-step tutorial on where to start ... or perhaps a hint of the very first thing to do.

+3
source share
4 answers

Here are all the steps I took to do this. Special thanks to Keith Palmer for his comments, answers, and his site , which really helped me get this job.

  • Register your application at http://appreg.quickbooks.com . This will give you the application id and application name. I used these settings:

    • Target Application: QBOE
    • Environment: Production
    • Application Type: Desktop

      • (Using Desktop made it easier if certificates are not required)
    • A confirmation key is sent to your email address, which you need to enter on page 2 of this wizard.

  • QBOE. 1, . URL- , QBOE:
  • 3 , QuickBooks Online Edition (QBOE).
  • XML QBOE QBOE. #, QBOE. QuickBooks. xml , .

    string requestUrl = null;
    requestUrl = "https://apps.quickbooks.com/j/AppGateway";
    
    HttpWebRequest WebRequestObject = null;
    StreamReader sr = null;
    HttpWebResponse WebResponseObject = null;
    StreamWriter swr = null;
    
    try
    {
        WebRequestObject = (HttpWebRequest)WebRequest.Create(requestUrl);
        WebRequestObject.Method = "POST";
        WebRequestObject.ContentType = "application/x-qbxml";
        WebRequestObject.AllowAutoRedirect = false;
    
        string post = @"<?xml version=""1.0"" encoding=""utf-8"" ?>
        <?qbxml version=""6.0""?>
        <QBXML>
          <SignonMsgsRq>
            <SignonDesktopRq>
              <ClientDateTime>%%CLIENT_DATE_TIME%%</ClientDateTime>
              <ApplicationLogin>APPLICATION_LOGIN</ApplicationLogin>
              <ConnectionTicket>CONNECTION_TICKET</ConnectionTicket>
              <Language>English</Language>
              <AppID>APP_ID</AppID>
              <AppVer>1</AppVer>
            </SignonDesktopRq>
          </SignonMsgsRq>
          <QBXMLMsgsRq onError=""continueOnError"">
            <CustomerQueryRq requestID=""2"" />
          </QBXMLMsgsRq>
        </QBXML>";
    
    
    
        post = post.Replace("%%CLIENT_DATE_TIME%%", DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss"));
        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(post);
        post = xmlDoc.InnerXml;
        WebRequestObject.ContentLength = post.Length;
        swr = new StreamWriter(WebRequestObject.GetRequestStream());
        swr.Write(post);
        swr.Close();
        WebResponseObject = (HttpWebResponse)WebRequestObject.GetResponse();
        sr = new StreamReader(WebResponseObject.GetResponseStream());
        string Results = sr.ReadToEnd();
        }
    finally
        {
            try
            {
                sr.Close();
            }
            catch
            {
            }
    
            try
            {
                WebResponseObject.Close();
                WebRequestObject.Abort();
            }
            catch
            {
            }
        }
    
  • :

    • , qbxml 6.0 ( IDN Unified On-Screen Reference 7.0)
    • onError = "continueOnError".
    • WebRequestObject.ContentLength.
    • "application/x-qbxml"
    • , , " : (400)" ". , , - xml. , , xml .
+3

Yishai , .

ASP.NET , QuickBooks Online, QuickBooks Online Edition.

/ , , . , , QuickBooks Online Edition, . :

" ?"

: ". , [ ], ".

, . , :

  • QBOE
  • Intuit AppReg
  • , AppReg QBOE (, !)
  • HTTPS POST- Intuit- Intuit
  • HTTPS POST- qbXML Intuit-, , , QuickBooks Online Edition.

> - QuickBooks wiki, QuickBooks Online Edition.

, , PHP, , QuickBooks Online Edition, , . PHP (VirtueMart) QuickBooks Online Edition. PHP : QuickBooks PHP Framework

, SSL POST- HTTPS, , DESKTOP, HOSTED. , .

, Yishai: " - , . , " ", , , ". / Intuit SDK. , , QuickBooks.

+3

, , 7 QBSDK ( , 7.0 SDK, ). .

​​ , QuickBooks Online , , QuickBooks HTTPS- , , , , . , , .

( ) Https POSTS xml QuickBooks, XML, , .

, .

SDK - ( , ), , . , , - , , QuickBooks. , ( , , , ).

EDIT: , . ( , QuickBooks Online).

- , . , , , , .

- ( , , ), , - QuickBooks - .

, , Intuit, .

0

Source: https://habr.com/ru/post/1712015/


All Articles