简体   繁体   English

QBO Api更新调用中的“内部服务器错误”

[英]“Internal Server Error” on QBO Api Update call

When I send an update request to the QBO V2 api, I get back an 'internal server error' response. 当我向QBO V2 API发送更新请求时,我得到一个“内部服务器错误”响应。 These requests used to work; 这些请求曾经有效。 I even have an unchanged unit test from before specifically for this request that no longer works. 我什至没有以前专门针对此请求的未更改单元测试,因此不再有效。

All of my other request types seem to still be working. 我所有其他的请求类型似乎仍然有效。 Normally QBO gives pretty decent error messages if it's something I messed up with the request. 通常,如果我弄错了请求,QBO会给出相当不错的错误消息。

Has anyone else run into a similar issue recently, or have any ideas on what I could be doing that wouldn't result in a normal error message? 最近有没有其他人遇到类似问题,或者对我可以做的任何想法都不会导致正常的错误消息?

Here's a copy of one of the requests: 这是其中一个请求的副本:

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>test-user@mailinator.com</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>

Can you please try the following XML in ApiExplorer. 您能否在ApiExplorer中尝试以下XML。 It worked fine for me. 对我来说很好。 ApiExplorer - https://developer.intuit.com/apiexplorer?apiname=V2QBO ApiExplorer- https://developer.intuit.com/apiexplorer? apiname = V2QBO

Please change the Id and Synctoken, Name etc with correct test data. 请使用正确的测试数据更改ID和Synctoken,名称等。

PN - Looks like customeFields in the post body are not supported while updating QBO Customer. PN-好像更新QBO客户时不支持帖子正文中的customeFields。 https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/customer 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>test-user@mailinator.com</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>

Please let me know if it works for you. 请让我知道它是否适合您。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM