Unable to create(POST) objects (Account, customer…) on QB Windows using IDS and Sync Manager

[亡魂溺海] 提交于 2019-12-14 04:00:06

问题


Here I am provideing you the complete scenario where I am getting the error while posting request for creating a new account.

I am using Intuit OAuth Access and OAuth API console for testing (Using all security tokens).(https://appcenter.intuit.com/Playground/OAuth)

And the URL and request:

URL: https://services.intuit.com/sb/account/v2/570357960

Method : Post

Format: XML/JSON

Request:

<?xml version="1.0" encoding="UTF-16"?><Add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" RequestId="4df87bw2-916a-

4r95-h5d6-06dce3667562" 

xmlns="http://www.intuit.com/sb/cdm/v2"><ExternalRealmId>570357960</ExternalRealmId><Objectxsi:type="Account"><Name>CurrentAccount</Name><Active>true</Active><Type>Expense<

/Type><Subtype>Expense</Subtype><AcctNum>1111</AcctNum></Object></Add>

And getting the response (error in html):

 <div class="content-container"><fieldset>
  <h2>500 - Internal server error.</h2>
  <h3>There is a problem with the resource you are looking for, and it cannot be displayed.</h3>

and I have also checked with RESTClient utility, but getting the same above error.

Please note that the same url (https://services.intuit.com/sb/account/v2/570357960) with same security tokens is working fine for GET data , I am getting data from QB desktop into my online Application.


回答1:


As Keith said, check the Content-Type. You will also need to use a RestClient for testing. The playground will not work for testing API calls. It only works for platform calls.




回答2:


If I had to guess... I'd guess you're sending the wrong Content-Type header... but it's impossible to tell for sure until you post more code/the rest of your HTTP request.




回答3:


A few things to try. Be sure the XML is in the same order as this sample and try it. the other is a common mistake when you use Oauth in a GET you are including just the url in the signature, but in a POST you need to include the Body in the signature too or it will not pass Oauth validation.

Lastly, as Keith mentioned to check the content type. Although you would generally get a content type error.

156234822 CurrentAccount true Expense Expense 1111



来源:https://stackoverflow.com/questions/14436914/unable-to-createpost-objects-account-customer-on-qb-windows-using-ids-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!