问题
I am working on quickbooks v3 api integration. I have done all integrations but got stuck in Quickbooks Disconnect from app.
I am using the following snippet of code for disconnecting from quickbooks
final IAPlatformClient pClient = new IAPlatformClient();
pClient.disconnect(consumerkey, consumersecret, accessToken, accessTokenSecret);
This code is throwing the following error
Error Code: null,Error Message: Failed to disconnect: null null at com.intuit.ia.connection.PlatformHttpClient.disconnect(PlatformHttpClient.java:81) at com.intuit.ia.connection.IAPlatformClient.disconnect(IAPlatformClient.java:40) at com.intuit.ia.connection.IAPlatformClient$disconnect.call(Unknown Source)
Not sure if i am missing any dependency for disconnect api as all other integrations(sign-in/blue-dot menu/connect to QB) are working fine with the v3 API.
I had done it using v2 quickbooks API and everything was working but getting this in v3.
Any help would be appreciated.
Thanks in advance
EDIT
Quickbooks disconnect API at https://developer.intuit.com/docs/0025_quickbooksapi/0060_auth_auth/0015_disconnect_api descripbed the URL requires a GEt request. So instead of going through the v3 API i also tried to make a GET request to the api url as follows
https://appcenter.intuit.com/api/v1/Connection/Disconnect?oauth_token=token&oauth_token_secret=secret&oauth_consumer_key=key&oauth_consumer_secret=secret
Now i get error code 50 "Missing appToken" error
Does the disconnect API work with GET request? Which parameter am i missing here?
UPDATE:
Link for Sample code for Quickbooks V3 API.
https://github.com/IntuitDeveloperRelations/QuickbooksV3API-Java/tree/master/QuickbooksV3API
回答1:
Can you please add the latest(1.0.2) qbapihelper jar in your classpath and try the call.
Jar name - ipp-java-qbapihelper-1.2.0-jar-with-dependencies.jar
Disconnect API doesn't have any issue. It worked fine. You can try this call using any standard RESTClient like fiddler. PFB details.
GET URI - https://appcenter.intuit.com/api/v1/Connection/Disconnect
Request Header -
content-type: application/xml
Host: appcenter.intuit.com
Response -
<?xml version="1.0" encoding="utf-8"?>
<PlatformResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://platform.intuit.com/api/v1">
<ErrorMessage />
<ErrorCode>0</ErrorCode>
<ServerTime>2013-12-24T10:09:48.7601Z</ServerTime>
</PlatformResponse>
The above response suggests a successful API call. Ref - Edit - Updating the latest doc ref - https://developer.intuit.com/docs/0050_quickbooks_api/0020_authentication_and_authorization/oauth_management_api#Disconnect
Thanks
来源:https://stackoverflow.com/questions/20586739/disconnecting-app-in-quickbooks-v3-api