Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating a Hubspot Company is not doing anything #101

Open
tbleiermedialab opened this issue Aug 20, 2020 · 0 comments
Open

Updating a Hubspot Company is not doing anything #101

tbleiermedialab opened this issue Aug 20, 2020 · 0 comments

Comments

@tbleiermedialab
Copy link

tbleiermedialab commented Aug 20, 2020

Hi,

I'm struggling to get the update function in the company client to work.

def update(self, company_id: str, data: Dict = None, **options) -> Dict:
"""update the given company with data"""
data = data or {}
return self._call(
"companies/{}".format(company_id), data=data, method="PUT", **options
)

I'm wondering if its asking for data, but the request in the Hubspot API is looking for properties. Would this be causing it not to work? For example, the sample JSON hubspot is showing in the API, https://legacydocs.hubspot.com/docs/methods/companies/update_company, is expecting properties, not data. The sample JSON given, is:
Example PUT JSON:
{
"properties": [
{
"name": "description",
"value": "A far better description than before"
}
]
}

Right now I'm calling the function with:
updateCompanyDict = {
"name":"rpm_id",
"value":rpmCustomerAccountId
}

response = companies_client_update.update(company_id=company.companyId, data=updateCompanyDict, debug=True)

The debug for the request above shows:
{
"data": "{"name": "rpm_id", "value": 1286}",
"headers": {
"Accept-Encoding": "gzip",
"Content-Type": "application/json"
},
"url": "/companies/v2/companies/4326408039?hapikey=hapikey"
}

where hapikey, is our key.

Can you please shed some light?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant