APIs & Integrations

SRoy
参加者 | Gold Partner
参加者 | Gold Partner

How to update account-id of existing user.

解決

Hello,

 

I have developed a Hubspot App that utilizes Hubspot CRM Accounting Extensions API.

The app works fine as it can create invoices or attach invoices to deals or to companies.

Due to some internal feature upgrade, I want to change the "accountId" of the Hubspot user without asking the user to reinstall the app. This accountId was set via "PUT crm/v3/extensions/accounting/user-accounts". But when I unset the accoutId using "DELETE /crm/v3/extensions/accounting/user-accounts/{accountId}", nothing happens. From the accounting webhook calls, I can see that Hubspot still looks for the old accountId when I visit deal details page. 

Interesting fact is that if call "PUT crm/v3/extensions/accounting/user-accounts" with different accountId, that new accountId is get attached. And when I did try "create invoice"button from deal details page, Hubspot shows me two accounts  (the old and new one) to choose from.

 

Is it really possible to remove an existing accountId for a Hubspot user via CRM Accoutning Extension API without the need to uninstall the Hubspot app that atttached that accountId?

 

Regards,

Sujoy

 

0 いいね!
1件の承認済みベストアンサー
dennisedson
解決策
HubSpot製品開発チーム
HubSpot製品開発チーム

How to update account-id of existing user.

解決

@SRoy 

This is the feeback I received (verbatim)

So if I'm reading correctly:
  • The customers deletes a userAccount, and then creates a new one,
  • They're still seeing calls on the deal page that fetches the userAccount that was deleted
The only thing in the deal page that should still contain the old one they deleted would be any previous invoices that were created for that accountId. That is by design, we don't delete invoices for an account if it's disconnected.As for their second point about the accountId showing up if they update it with the update API that shouldn't happen so I'd need to know more information to debug what they mean there.

元の投稿で解決策を見る

0 いいね!
5件の返信
SRoy
参加者 | Gold Partner
参加者 | Gold Partner

How to update account-id of existing user.

解決

Thank you@dennisedson for the information.

I opened up create invoice page on a fresh deal and saw that the deleted accountId is not showing up.

So, I think account deletion is working. I will do further testing and then mark your reply as "Accept as Solution".

SRoy
参加者 | Gold Partner
参加者 | Gold Partner

How to update account-id of existing user.

解決

Hello, @dennisedson, any update on the issue?

0 いいね!
dennisedson
解決策
HubSpot製品開発チーム
HubSpot製品開発チーム

How to update account-id of existing user.

解決

@SRoy 

This is the feeback I received (verbatim)

So if I'm reading correctly:
  • The customers deletes a userAccount, and then creates a new one,
  • They're still seeing calls on the deal page that fetches the userAccount that was deleted
The only thing in the deal page that should still contain the old one they deleted would be any previous invoices that were created for that accountId. That is by design, we don't delete invoices for an account if it's disconnected.As for their second point about the accountId showing up if they update it with the update API that shouldn't happen so I'd need to know more information to debug what they mean there.
0 いいね!
SRoy
参加者 | Gold Partner
参加者 | Gold Partner

How to update account-id of existing user.

解決

Hello Dennis,

I am using hubspot-api-python library. I am not using hapikey but  Oauth access token. The code is like below,

import hubspot
from pprint import pprint


client = hubspot.Client.create(access_token="<Outh Access Token>");

try:
    api_response = client.crm.extensions.accounting.user_accounts_api.archive(account_id="1124019")
    pprint(api_response)
except Exception as e:
    print("Exception when calling user_accounts_api->archive: %s\n" % e)

When I run it from command line, I just get "None" on the console and no exception is raised.

 

I can perform the same operation using "curl" tool like below,

curl --request DELETE --url https://api.hubapi.com/crm/v3/extensions/accounting/user-accounts/1124019 --header 'authorization: Bearer <Oauth Bearer Token>'

 

I have also tested using the online tool that is provided on https://developers.hubspot.com/docs/api/crm/extensions/accounting page to test API call.

SRoy_0-1627538213954.png

 

 

Since, there is no API endpoint (or I am not able to find it) to check which accountIds are attached to a Hubspot user, it is very difficult to know if the addition or deletion of accountIds works unless to check the invoice creation  process.

 

Regards,

Sujoy

0 いいね!
dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

How to update account-id of existing user.

解決

Hey @SRoy 

I am looking into this

Could you provide exact requests and the body that you are sending (minus the hapikey) and maybe some screenshots of what you are seeing?

 

0 いいね!