mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(Hubspot): Add support for Private App Token Authentication
This commit is contained in:
@@ -27,6 +27,7 @@ export async function hubspotApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||
const options: OptionsWithUri = {
|
||||
method,
|
||||
qs: query,
|
||||
headers: {},
|
||||
uri: uri || `https://api.hubapi.com${endpoint}`,
|
||||
body,
|
||||
json: true,
|
||||
@@ -39,6 +40,11 @@ export async function hubspotApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||
|
||||
options.qs.hapikey = credentials!.apiKey as string;
|
||||
return await this.helpers.request!(options);
|
||||
} else if (authenticationMethod === 'appToken') {
|
||||
const credentials = await this.getCredentials('hubspotAppToken');
|
||||
|
||||
options.headers!['Authorization'] = `Bearer ${credentials!.appToken}`;
|
||||
return await this.helpers.request!(options);
|
||||
} else if (authenticationMethod === 'developerApi') {
|
||||
if (endpoint.includes('webhooks')) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user