Make it possible to use JotForm accounts from Europe

This commit is contained in:
Jan Oberhauser 2020-03-27 12:44:26 +01:00
parent 764172d46f
commit ff67e991b2
2 changed files with 18 additions and 1 deletions

View file

@ -13,5 +13,22 @@ export class JotFormApi implements ICredentialType {
type: 'string' as NodePropertyTypes,
default: '',
},
{
displayName: 'API Domain',
name: 'apiDomain',
type: 'options' as NodePropertyTypes,
options: [
{
name: 'api.jotform.com',
value: 'api.jotform.com',
},
{
name: 'eu-api.jotform.com',
value: 'eu-api.jotform.com',
},
],
default: 'api.jotform.com',
description: 'The API domain to use. Use "eu-api.jotform.com" if your account is in based in Europe.',
},
];
}

View file

@ -21,7 +21,7 @@ export async function jotformApiRequest(this: IHookFunctions | IExecuteFunctions
method,
qs,
form: body,
uri: uri ||`http://api.jotform.com${resource}`,
uri: uri || `https://${credentials.apiDomain || 'api.jotform.com'}${resource}`,
json: true
};
if (!Object.keys(body).length) {