Last active
March 12, 2018 04:09
-
-
Save IntuitDeveloperRelations/6582149 to your computer and use it in GitHub Desktop.
IPP .NET SDK v3 - QBO - Retrieve Customer with DisplayName filter #IppDotNetSdkV3 #Customer #QBO #Filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Intuit.Ipp.Core; | |
using Intuit.Ipp.Data; | |
using Intuit.Ipp.LinqExtender; | |
using Intuit.Ipp.QueryFilter; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
static class SampleCalls | |
{ | |
public static Customer QueryCustomerByDisplayName(ServiceContext context, string displayName) { | |
displayName = displayName.Replace("'", "\\'"); //Escape special characters | |
QueryService<Customer> customerQueryService = new QueryService<Customer>(context); | |
return customerQueryService.Where(m => m.DisplayName == displayName).FirstOrDefault(); | |
} | |
} | |
//Request | |
//POST https://quickbooks.api.intuit.com/v3/company/797145280/query HTTP/1.1 | |
//Content-Type: application/text | |
//Host: quickbooks.api.intuit.com | |
//Authorization: OAuth oauth_token="lvprdTJzbZqooMvYCvU35HwpwYsL1ZaJsvJwRYAIvZcL906W",oauth_nonce="0689fd4a-b88b-4320-9c8e-42b1329b4a88",oauth_consumer_key="qyprdcAQ7lV9AbDAdMA5WEkHEkvcj4",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1379344912",oauth_version="1.0",oauth_signature="IQr2DNicXVwOmFglRchY52UkZOg%3D" | |
//User-Agent: V3DotNetSDK1.0.7 | |
//Content-Length: 62 | |
//Expect: 100-continue | |
//Connection: Keep-Alive | |
//Select * FROM Customer WHERE DisplayName = 'Customer\'s Name' | |
//Response | |
//HTTP/1.1 200 OK | |
//Date: Mon, 16 Sep 2013 15:21:53 GMT | |
//Server: Apache/2.2.22 (Unix) | |
//Cache-Control: max-age=0, no-cache, no-store, must-revalidate, private | |
//Expires: 0 | |
//Vary: Accept-Encoding | |
//intuit_tid: d0f15674-68f4-4141-8066-86da77c2f63c | |
//Via: 1.1 ipp-gateway-.net | |
//Content-Length: 807 | |
//Connection: close | |
//Content-Type: application/xml;charset=UTF-8 | |
//<?xml version="1.0" encoding="UTF-8" standalone="yes"?><IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-09-16T08:21:54.331-07:00"><QueryResponse startPosition="1" maxResults="1"><Customer domain="QBO" sparse="false"><Id>2</Id><SyncToken>1</SyncToken><MetaData><CreateTime>2013-09-16T08:16:50-07:00</CreateTime><LastUpdatedTime>2013-09-16T08:17:16-07:00</LastUpdatedTime></MetaData><FullyQualifiedName>Customer's Name</FullyQualifiedName><DisplayName>Customer's Name</DisplayName><PrintOnCheckName>Customer's Name</PrintOnCheckName><Active>true</Active><Taxable>true</Taxable><Job>false</Job><BillWithParent>false</BillWithParent><Balance>0</Balance><BalanceWithJobs>0</BalanceWithJobs><PreferredDeliveryMethod>Print</PreferredDeliveryMethod></Customer></QueryResponse></IntuitResponse> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment