From 519680c2cf37f3b7341e87e71b911ac2fee8bdfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Martinez?= Date: Mon, 23 Oct 2023 11:01:48 +0200 Subject: [PATCH] fix(Customer.io Node): Fix api endpoint when using EU region (#7485) Fixes #7484 --- packages/nodes-base/nodes/CustomerIo/GenericFunctions.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/CustomerIo/GenericFunctions.ts b/packages/nodes-base/nodes/CustomerIo/GenericFunctions.ts index 45ef62d5b..2ea9b213f 100644 --- a/packages/nodes-base/nodes/CustomerIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/CustomerIo/GenericFunctions.ts @@ -32,7 +32,13 @@ export async function customerIoApiRequest( const region = credentials.region; options.url = `https://${region}/api/v1${endpoint}`; } else if (baseApi === 'api') { - options.url = `https://api.customer.io/v1/api${endpoint}`; + const region = credentials.region; + // Special handling for EU region + if (region === 'track-eu.customer.io') { + options.url = `https://api-eu.customer.io/v1/api${endpoint}`; + } else { + options.url = `https://api.customer.io/v1/api${endpoint}`; + } } else if (baseApi === 'beta') { options.url = `https://beta-api.customer.io/v1/api${endpoint}`; }