Add support for suspended tickets to Zendesk node (#2297)

* Added Suspended Tickets (Delete, List, Get, Recover)

* Added Search option to Active tickets

* Added internal note, public reply and assignee email options to active ticket updates

*  Small improvements to #2296

* 🐛 Fix issue with pagination

*  Improvements

Co-authored-by: Jonathan <jonathan.bennetts@gmail.com>
This commit is contained in:
Ricardo Espinoza
2021-10-13 19:45:53 -04:00
committed by GitHub
parent d49aa18717
commit 7ddd6ad9c2
4 changed files with 241 additions and 35 deletions

View File

@@ -42,7 +42,7 @@ export async function zendeskApiRequest(this: IHookFunctions | IExecuteFunctions
}
const base64Key = Buffer.from(`${credentials.email}/token:${credentials.apiToken}`).toString('base64');
options.uri = `https://${credentials.subdomain}.zendesk.com/api/v2${resource}.json`;
options.uri = uri || `https://${credentials.subdomain}.zendesk.com/api/v2${resource}.json`;
options.headers!['Authorization'] = `Basic ${base64Key}`;
return await this.helpers.request!(options);
} else {
@@ -52,7 +52,7 @@ export async function zendeskApiRequest(this: IHookFunctions | IExecuteFunctions
throw new NodeOperationError(this.getNode(), 'No credentials got returned!');
}
options.uri = `https://${credentials.subdomain}.zendesk.com/api/v2${resource}.json`;
options.uri = uri || `https://${credentials.subdomain}.zendesk.com/api/v2${resource}.json`;
return await this.helpers.requestOAuth2!.call(this, 'zendeskOAuth2Api', options);
}