“内部服务器错误"在 QBO Api 更新电话上 [英] "Internal Server Error" on QBO Api Update call

查看:57
本文介绍了“内部服务器错误"在 QBO Api 更新电话上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我向 QBO V2 api 发送更新请求时,我收到内部服务器错误"响应.这些请求曾经有效;我什至有一个未更改的单元测试,专门针对此不再有效的请求.

我的所有其他请求类型似乎仍然有效.通常 QBO 会给出相当不错的错误消息,如果这是我在请求中搞砸的事情.

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

这是其中一个请求的副本:

POST/resource/customer/v2/682571780/1?oauth_version=1.0&oauth_token=*token*&oauth_nonce=*nonce*&oauth_timestamp=1372345998&*oauth_auth_signature&oauth_auth_signature;*key*&oauth_signature_method=HMAC-SHA1 HTTP/1.1主持人:qbo.sbfinance.intuit.com内容长度:1368内容类型:应用程序/xml接受编码:gzip、放气、压缩接受: */*用户代理:python-requests/1.2.3 CPython/2.7.3 Linux/3.5.0-17-generic<?xml version='1.0' encoding='ASCII' standalone='yes'?><客户 xmlns="http://www.intuit.com/sb/cdm/v2"><Id idDomain="QBO">1</Id><SyncToken>49</SyncToken><元数据><CreateTime>2013-04-10T14:07:41-07:00</CreateTime><LastUpdatedTime>2013-04-25T09:40:40-07:00</LastUpdatedTime></元数据><姓名>测试A.用户</姓名><地址><Line1>123 试驾</Line1><City>Smallville</City><国家>美利坚合众国</国家><CountrySubDivisionCode>WY</CountrySubDivisionCode><邮政编码>12345</邮政编码><GeoCode>LAT=42.8142432,LNG=-73.9395687</GeoCode><标签>计费</标签></地址><电话><DeviceType>主要</DeviceType><FreeFormNumber>(123) 456-7890</FreeFormNumber></电话><网站/><电子邮件><地址>test-user@mailinator.com</地址></电子邮件><GivenName>测试</GivenName><MiddleName>A</MiddleName><FamilyName>用户</FamilyName><DBAName>新兴威胁</DBAName><自定义字段><DefinitionId>首选交付方法</DefinitionId><值>打印</值></CustomField><自定义字段><DefinitionId>转售编号</DefinitionId></CustomField><自定义字段><DefinitionId>与父母的帐单</DefinitionId><值>假</值></CustomField><ShowAs>测试用户</ShowAs><OpenBalance><金额>20.00</金额></OpenBalance></客户>

解决方案

能否请您在 ApiExplorer 中尝试以下 XML.它对我来说很好.ApiExplorer - https://developer.intuit.com/apiexplorer?apiname=V2QBO

请使用正确的测试数据更改 Id 和 Synctoken、Name 等.

PN - 更新 QBO 客户时似乎不支持帖子正文中的 customereFields.https://developer.intuit.com/docs/0025_quickbooksapi/0050_2v_services/0400_quickbooks_online/客户

<Line1>123 试驾</Line1><City>Smallville</City><国家>美利坚合众国</国家><CountrySubDivisionCode>WY</CountrySubDivisionCode><邮政编码>12345</邮政编码><GeoCode>LAT=42.8142432,LNG=-73.9395687</GeoCode><标签>计费</标签></地址><电话><DeviceType>主要</DeviceType><FreeFormNumber>(123) 456-7890</FreeFormNumber></电话><网站/><电子邮件><地址>test-user@mailinator.com</地址></电子邮件><GivenName>测试</GivenName><MiddleName>A</MiddleName><FamilyName>用户</FamilyName><DBAName>新兴威胁</DBAName><ShowAs>测试用户</ShowAs><OpenBalance><金额>20.00</金额></OpenBalance></客户>

请告诉我它是否适合您.

谢谢

When I send an update request to the QBO V2 api, I get back an 'internal server error' response. 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.

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. It worked fine for me. ApiExplorer - https://developer.intuit.com/apiexplorer?apiname=V2QBO

Please change the Id and Synctoken, Name etc with correct test data.

PN - Looks like customeFields in the post body are not supported while updating QBO 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

这篇关于“内部服务器错误"在 QBO Api 更新电话上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆