This topic was automatically generated from Slack. You can find the original thread here.
Joseph : Hello Pipedream team! I’m excited to join and hopefully find a way to resolve my question. I am a noob so please bear with me : ) I am trying to connect ActiveCampaign email marketing account with Twilio account in such a way that when a new Contact is added to ActiveCampaign an outbound call to contact’s phone number is automatically made by Twilio.
I was able to connect the ActiveCampaign and Twilio app in my workflow in the following way:
Step #1 “New Contact Added to List” steps.trigger for ActiveCampaign followed by Step #2 steps.post_account_calls for Twilio.
However, when I pass test new added Contact data from ActiveCampaign to Twilio in my flow I get the following error message for Twilio: ErrorRequest failed with status code 400
Error - 21201 No ‘To’ number specified
You attempted to initiate an outbound phone call, but you did not specify what number to call in the ‘To’ POST parameter
The error code shown for it is:
{
“code”: 21201,
“message”: “No ‘To’ number is specified”,
“more_info”: “[params.To[“contact[phone]”]](Error 21201 | Twilio>”,
“status”: 400
}
at null.createError (/opt/ee/node_modules/axios/lib/core/createError.js:16:15)
at null.settle (/opt/ee/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/opt/ee/node_modules/axios/lib/adapters/http.js:236:11)
at IncomingMessage.emit (events.js:203:15)
at null.endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
I think the issue is that params is not properly set up in the code at ActiveCampaign first step in the workflow. Here is the full code for this first step:
const activecampaign = require("…/…/activecampaign.app.js");
const common = require("…/common-webhook.js");
module.exports = {
…common,
name: “New Contact Added to List”,
key: “activecampaign-contact-added-to-list”,
description: “Emits an event each time a new contact is added to a list.”,
version: “0.0.1”,
methods: {
…common.methods,
getEvents() {
return [“subscribe”];
},
async getMeta(body) {
const { list } = await this.activecampaign.getList(body.list);
const { date_time: dateTimeIso } = body;
const ts = Date.parse(dateTimeIso);
return {
id: ${body["contact[id]"]}${list.id}
,
summary: ${body["contact[email]"]} added to ${list.name}
,
ts
};
console.log(<http://params.To[%22contact[phone]%22]));
},
},
};
I know that the params is completely wrong here, put in the wrong place, etc.
I would greatly appreciate any tips and help in getting this fixed so that outbound calls can be placed automatically to Contacts added to ActiveCampaign list. Thank you!