Skip to content

Add a Webhooks client#129

Open
sangaline wants to merge 4 commits intojpetrucciani:masterfrom
sangaline:ews-add-webhooks-client
Open

Add a Webhooks client#129
sangaline wants to merge 4 commits intojpetrucciani:masterfrom
sangaline:ews-add-webhooks-client

Conversation

@sangaline
Copy link
Contributor

This adds a new Webhooks client that can be used to manage webhook settings and subscriptions using the Hubspot Webhooks API. This API has different requirements from the other API clients, namely it requires the use of an API key for the developer account where the webhook subscriptions live; oauth authentication won't work, nor will the legacy API key or private app access token from a non-developer account. Conversely, the developer account API key cannot be used to access anything from a non-developer account (e.g. contacts, deals, companies). The API also requires that an app_id be specified when initializing the client, for example:

client = Hubspot3(api_key='<my-developer-key>', app_id=1234)
client.webhooks.get_all_subscriptions()

As a side note, the API keys for non-developer accounts are being officially sunset tomorrow and will stop working for anybody who didn't specifically get an extension. This might suggest that the api_key parameter should be phased out, but it's worth noting that it's deprecation is only for non-developer accounts and this PR is an example of how the parameter continues to be useful moving forward.

@jpetrucciani
Copy link
Owner

@sangaline Sent you a message on linkedin - but in the meantime, looks like I need to update some typing stuff, and upgrade our prospector config!

@jpetrucciani
Copy link
Owner

Okay I've fixed a lot of the prospector and typing stuff in #130 , could you rebase and rerun the CI?

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

Successfully merging this pull request may close these issues.

2 participants