mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
🐛 Set new Hubspot granular scopes (#2531)
* Hubspot Developer API Credentials: Use granular scopes as contacts scope is no longer available for new apps * ⚡ Add new scopes to regular node * ⚡ Small fix * ⚡ Load contacts, companies and deals from API Co-authored-by: that-one-tom <19203795+that-one-tom@users.noreply.github.com>
This commit is contained in:
@@ -39,12 +39,16 @@ export async function hubspotApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||
|
||||
return await this.helpers.request!(options);
|
||||
} else if (authenticationMethod === 'developerApi') {
|
||||
const credentials = await this.getCredentials('hubspotDeveloperApi');
|
||||
if (endpoint.includes('webhooks')) {
|
||||
|
||||
options.qs.hapikey = credentials!.apiKey as string;
|
||||
return await this.helpers.request!(options);
|
||||
const credentials = await this.getCredentials('hubspotDeveloperApi');
|
||||
options.qs.hapikey = credentials!.apiKey as string;
|
||||
return await this.helpers.request!(options);
|
||||
|
||||
} else {
|
||||
return await this.helpers.requestOAuth2!.call(this, 'hubspotDeveloperApi', options, { tokenType: 'Bearer', includeCredentialsOnRefreshOnBody: true });
|
||||
}
|
||||
} else {
|
||||
// @ts-ignore
|
||||
return await this.helpers.requestOAuth2!.call(this, 'hubspotOAuth2Api', options, { tokenType: 'Bearer', includeCredentialsOnRefreshOnBody: true });
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user