mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Add user resource (#892)
This commit is contained in:
@@ -23,7 +23,10 @@ export async function zendeskApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||
body,
|
||||
//@ts-ignore
|
||||
uri,
|
||||
json: true
|
||||
json: true,
|
||||
qsStringifyOptions: {
|
||||
arrayFormat: 'brackets',
|
||||
},
|
||||
};
|
||||
|
||||
options = Object.assign({}, options, option);
|
||||
@@ -43,8 +46,6 @@ export async function zendeskApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||
options.uri = `https://${credentials.subdomain}.zendesk.com/api/v2${resource}.json`;
|
||||
options.headers!['Authorization'] = `Basic ${base64Key}`;
|
||||
|
||||
//console.log(options);
|
||||
|
||||
return await this.helpers.request!(options);
|
||||
} else {
|
||||
const credentials = this.getCredentials('zendeskOAuth2Api');
|
||||
@@ -58,6 +59,7 @@ export async function zendeskApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||
return await this.helpers.requestOAuth2!.call(this, 'zendeskOAuth2Api', options);
|
||||
}
|
||||
} catch(err) {
|
||||
|
||||
let errorMessage = err.message;
|
||||
if (err.response && err.response.body && err.response.body.error) {
|
||||
errorMessage = err.response.body.error;
|
||||
|
||||
Reference in New Issue
Block a user