hubspot3 icon indicating copy to clipboard operation
hubspot3 copied to clipboard

Updating a Hubspot Company is not doing anything

Open tbleiermedialab opened this issue 4 years ago • 0 comments

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?

tbleiermedialab avatar Aug 20 '20 18:08 tbleiermedialab