Skip to content

Updating a Hubspot Company is not doing anything #101

@tbleiermedialab

Description

@tbleiermedialab

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions