Michael David Arner
Michael David Arner

Reputation: 15

Twilio. Set Fax Webhook programmatically using the API

My application wants to dynamically purchase new FAX numbers when the pool of serviced users exceeds a certain amount. I am able to do this programmatically from API like this (C#):

using Twilio;
using Twilio.Rest.Fax.V1;
using Twilio.Rest.Api.V2010.Account;

var incomingPhoneNumber = IncomingPhoneNumberResource.Create(
  statusCallback: new Uri("https://myapp.co/api/v1/fax/twiliostatus"),
  statusCallbackMethod:Twilio.Http.HttpMethod.Post,
  pathAccountSid:"xxx",
  phoneNumber: new Twilio.Types.PhoneNumber(numbers[i].PhoneNumber)
  );

...but I don't see any mechanism for setting the value corresponding to the "A Fax Comes In" webhook (where I set method and URI) in the portal. Is there a way I can set this from the API?

thanks in advance!

Upvotes: 1

Views: 80

Answers (1)

Alan
Alan

Reputation: 10781

It looks like the attribute you need to set is voiceReceiveMode.

IncomingPhoneNumber resource

The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: fax or voice and defaults to voice.

Upvotes: 2

Related Questions