0

当我向QBO V2 API发送更新请求时,我收到了'内部服务器错误'响应。这些请求曾用于工作;我甚至有一个没有改变的单元测试,专门针对这个不再起作用的请求。QBO Api上的“内部服务器错误”更新调用

我所有的其他请求类型似乎仍然有效。通常情况下,如果QBO与请求混淆,QBO会给出相当不错的错误消息。

最近有没有其他人遇到过类似的问题,或者对我可以做的事情有任何想法不会导致正常的错误信息?

这里的请求之一的副本:

POST /resource/customer/v2/682571780/1?oauth_version=1.0&oauth_token=*token*&oauth_nonce=*nonce*&oauth_timestamp=1372345998&oauth_signature=*signature*&oauth_consumer_key=*key*&oauth_signature_method=HMAC-SHA1 HTTP/1.1 
Host: qbo.sbfinance.intuit.com 
Content-Length: 1368 
content-type: application/xml 
Accept-Encoding: gzip, deflate, compress 
Accept: */* 
User-Agent: python-requests/1.2.3 CPython/2.7.3 Linux/3.5.0-17-generic 

<?xml version='1.0' encoding='ASCII' standalone='yes'?> 
<Customer xmlns="http://www.intuit.com/sb/cdm/v2"> 
    <Id idDomain="QBO">1</Id> 
    <SyncToken>49</SyncToken> 
    <MetaData> 
    <CreateTime>2013-04-10T14:07:41-07:00</CreateTime> 
    <LastUpdatedTime>2013-04-25T09:40:40-07:00</LastUpdatedTime> 
    </MetaData> 
    <Name>Test A. User</Name> 
    <Address> 
    <Line1>123 Test Drive</Line1> 
    <City>Smallville</City> 
    <Country>United States of America</Country> 
    <CountrySubDivisionCode>WY</CountrySubDivisionCode> 
    <PostalCode>12345</PostalCode> 
    <GeoCode>LAT=42.8142432,LNG=-73.9395687</GeoCode> 
    <Tag>Billing</Tag> 
    </Address> 
    <Phone> 
    <DeviceType>Primary</DeviceType> 
    <FreeFormNumber>(123) 456-7890</FreeFormNumber> 
    </Phone> 
    <WebSite/> 
    <Email> 
    <Address>[email protected]</Address> 
    </Email> 
    <GivenName>Test</GivenName> 
    <MiddleName>A</MiddleName> 
    <FamilyName>User</FamilyName> 
    <DBAName>Emerging Threats</DBAName> 
    <CustomField> 
    <DefinitionId>Preferred Delivery Method</DefinitionId> 
    <Value>PRINT</Value> 
    </CustomField> 
    <CustomField> 
    <DefinitionId>Resale Number</DefinitionId> 
    </CustomField> 
    <CustomField> 
    <DefinitionId>Bill With Parent</DefinitionId> 
    <Value>false</Value> 
    </CustomField> 
    <ShowAs>Test User</ShowAs> 
    <OpenBalance> 
    <Amount>20.00</Amount> 
    </OpenBalance> 
</Customer> 
+0

它什么时候开始发生,它还在继续? –

+0

由于我没有尽可能多的涉及更新客户的用例,所以在过去几天我只注意到它。我刚刚做了一次更新估计状态的测试,但仍然有效。所以我的基本更新请求代码应该没问题,这只是尝试更新客户时出现的问题。 – shader

回答

3

能不能请你在ApiExplorer以下XML。它为我工作得很好。 ApiExplorer - https://developer.intuit.com/apiexplorer?apiname=V2QBO

请用正确的测试数据更改Id和Synctoken,Name等。

PN - 更新QBO Customer时不支持post body中的customeFields。 https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/customer

<?xml version="1.0" encoding="utf-8"?> 
<Customer xmlns:ns2="http://www.intuit.com/sb/cdm/qbo" xmlns="http://www.intuit.com/sb/cdm/v2"> 
    <Id>4</Id> 
    <SyncToken>6</SyncToken> 
    <MetaData> 
     <CreateTime>2013-04-10T14:07:41-07:00</CreateTime> 
     <LastUpdatedTime>2013-04-25T09:40:40-07:00</LastUpdatedTime> 
    </MetaData> 
    <TypeOf>Person</TypeOf> 
    <Name>John Doe NEW 2</Name> 
    <Address> 
     <Line1>123 Test Drive</Line1> 
     <City>Smallville</City> 
     <Country>United States of America</Country> 
     <CountrySubDivisionCode>WY</CountrySubDivisionCode> 
     <PostalCode>12345</PostalCode> 
     <GeoCode>LAT=42.8142432,LNG=-73.9395687</GeoCode> 
     <Tag>Billing</Tag> 
    </Address> 
    <Phone> 
     <DeviceType>Primary</DeviceType> 
     <FreeFormNumber>(123) 456-7890</FreeFormNumber> 
    </Phone> 
    <WebSite/> 
    <Email> 
     <Address>[email protected]</Address> 
    </Email> 
    <GivenName>Test</GivenName> 
    <MiddleName>A</MiddleName> 
    <FamilyName>User</FamilyName> 
    <DBAName>Emerging Threats</DBAName> 
    <ShowAs>Test User</ShowAs> 
    <OpenBalance> 
     <Amount>20.00</Amount> 
    </OpenBalance> 
</Customer> 

请让我知道它是否适合您。

谢谢

+0

谢谢,那正是问题所在。现在我只是在发布前删除CustomFields,并且更新功能正常。关于这个令人讨厌的部分是我从来没有真正自己添加这些自定义字段;它们是来自客户“GET”请求的响应的一部分。 – shader