Why is my code not pulling the list options for Outbound phone number or the Flow SID in Twilio?

This topic was automatically generated from Slack. You can find the original thread here.

:wave: Need some Help. I am running the following code and it refuses to pull the list options for Outbound phone number or the Flow SID. This was working earlier today but stopped working:

import { axios } from “@pipedream/platform”

export default defineComponent({
props: {
twilio: {
type: “app”,
app: “twilio”,
},
phoneNumber: {
type: “string”,
label: “Phone Number”,
description: “The phone number to call, in E.164 format”,
},
outboundPhoneNumber: {
type: “string”,
label: “Twilio Outbound Phone Number or Alphanumeric Sender ID”,
description: “The Twilio phone number or alphanumeric sender ID to use for the outbound call”,
},
flowSid: {
type: “string”,
label: “Twilio Flow SID”,
description: “The SID of the Twilio Studio Flow to execute”,
},
parameters: {
type: “object”,
label: “Flow Parameters”,
description: “JSON object containing parameters to pass to the flow”,
optional: true,
},
},
async run({ steps, $ }) {
console.log(“Starting execution of Twilio Studio Flow”);
console.log(Phone Number (To): ${this.phoneNumber});
console.log(Twilio Outbound Number (From): ${this.outboundPhoneNumber});
console.log(Twilio Flow SID: ${this.flowSid});
console.log(Parameters: ${JSON.stringify(this.parameters || {})});

try {
  const formData = new URLSearchParams();
  formData.append('To', this.phoneNumber);
  formData.append('From', this.outboundPhoneNumber);
  formData.append('Parameters', JSON.stringify(this.parameters || {}));

  console.log("Prepared form data for request.");

  const response = await axios($, {
    method: "POST",
    url: `https://studio.twilio.com/v2/Flows/${this.flowSid}/Executions`,
    auth: {
      username: `${this.twilio.$auth.AccountSid}`,
      password: `${this.twilio.$auth.AuthToken}`,
    },
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    data: formData.toString(),
  });

  console.log('Studio Flow execution started with SID:', response.sid);
} catch (error) {
  console.error('Error initiating Studio Flow execution:');
  if (error.response) {
    console.error(`Response Status: ${error.response.status}`);
    console.error(`Response Data: ${JSON.stringify(error.response.data)}`);
  } else {
    console.error(error.message);
  }
}

},
})

Hi , would you mind filing a support ticket at Support - Pipedream? Select workflows and share the link so we can have the context

submitted. Please note, I have a follow up issue for the same workflow. I was working on that issue when this prop issue occurred.

Thanks! I just noticed you are looking for a list of options for the outboundPhoneNumber prop?

Yep I can help with the follow up issue after this one

Thank you!

Not trying to bug you however, what are the ticket times currently? Just trying to budget my time on this project’

No worries — It depends on the volume of requests we get at a given time frame

It has been quite light these past couple of days

I just replied there

I feel pretty dumb rn, bgl

*ngl

I’ve made this mistake many times, believe me! So no need to worry about it

Sometimes we just need a fresh view from someone else to notice a small detail

Absolutely

Btw, it’s impressive what you’ve achieved with your workflows

I saw your video and will look into the issue, and get back to you in the email thread

Thank You very much. I am determined to fail and learn.

UGH! Once again I have failed forward. Please disregard my last request. It is resolved. I neglected to set up an outbound widget and configuration.

I deeply appreciate y0our patience and help Andrew. Thank you. I love you guys at Pipedream. Always been great to me, even though I’m just learning.