mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat: Add Twilio Trigger Node (#8859)
Co-authored-by: Michael Kret <michael.k@radency.com> Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
@@ -4,6 +4,8 @@ import type {
|
||||
IDataObject,
|
||||
IHttpRequestMethods,
|
||||
IRequestOptions,
|
||||
IHttpRequestOptions,
|
||||
ILoadOptionsFunctions,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
/**
|
||||
@@ -40,6 +42,24 @@ export async function twilioApiRequest(
|
||||
return await this.helpers.requestWithAuthentication.call(this, 'twilioApi', options);
|
||||
}
|
||||
|
||||
export async function twilioTriggerApiRequest(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: IHttpRequestMethods,
|
||||
endpoint: string,
|
||||
body: FormData | IDataObject = {},
|
||||
): Promise<any> {
|
||||
const options: IHttpRequestOptions = {
|
||||
method,
|
||||
body,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
url: `https://events.twilio.com/v1/${endpoint}`,
|
||||
json: true,
|
||||
};
|
||||
return await this.helpers.requestWithAuthentication.call(this, 'twilioApi', options);
|
||||
}
|
||||
|
||||
const XML_CHAR_MAP: { [key: string]: string } = {
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
|
||||
Reference in New Issue
Block a user