refactor(signalwire): add dynamic api base url
This commit is contained in:
@@ -4,7 +4,7 @@ const fetchMessages = async ($: IGlobalVariable) => {
|
||||
const toNumber = $.step.parameters.toNumber as string;
|
||||
|
||||
let response;
|
||||
let requestPath = 'https://' + $.auth.data.spaceName + '.' + $.auth.data.spaceRegion + 'signalwire.com' + `/api/laml/2010-04-01/Accounts/${$.auth.data.accountSid}/Messages?To=${toNumber}`;
|
||||
let requestPath = `/api/laml/2010-04-01/Accounts/${$.auth.data.accountSid}/Messages?To=${toNumber}`;
|
||||
|
||||
do {
|
||||
response = await $.http.get(requestPath);
|
||||
@@ -20,7 +20,7 @@ const fetchMessages = async ($: IGlobalVariable) => {
|
||||
$.pushTriggerItem(dataItem);
|
||||
});
|
||||
|
||||
requestPath = 'https://' + $.auth.data.spaceName + '.' + $.auth.data.spaceRegion + 'signalwire.com' + response.data.next_page_uri;
|
||||
requestPath = response.data.next_page_uri;
|
||||
} while (requestPath);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user