I'm trying to list the phone numbers associated with a Message Profile, as described in the documentation.
The code listed in the documentation is:
var service = new MessagingProfileService();
var listOptions = new ListMessagingProfilesPhoneNumbersOptions();
service.List("id", listOptions);
Several problems with this.
Firstly, the MessagingProfileService.List() method doesn't support a first parameter of a string, it expects the ListMessagingProfilesPhoneNumbersOptions type. I'm guessing that the Id parameter needs to be set on the ListMessagingProfilesPhoneNumbersOptions object in order to identify which message profile to list numbers from. Not a huge deal, but the documentation is inaccurate.
Secondly, the return type of the List() method returns a list of MessagingProfiles, not a list of phone numbers associated with the given Messaging Profile. I'm not attempting to list all of the MessagingProfiles. Is the documentation pointing me to the wrong class/method? The MessageProfile objects don't seem to have a List method of their own.
Ultimately, it's not at all clear how to retrieve the list of phone numbers associated with a MessagingProfile. I'm going to have to make some manual HTTP requests rather than using the .net SDK.
I'm trying to list the phone numbers associated with a Message Profile, as described in the documentation.
The code listed in the documentation is:
Several problems with this.
Firstly, the
MessagingProfileService.List()
method doesn't support a first parameter of a string, it expects theListMessagingProfilesPhoneNumbersOptions
type. I'm guessing that theId
parameter needs to be set on theListMessagingProfilesPhoneNumbersOptions
object in order to identify which message profile to list numbers from. Not a huge deal, but the documentation is inaccurate.Secondly, the return type of the
List()
method returns a list ofMessagingProfile
s, not a list of phone numbers associated with the given Messaging Profile. I'm not attempting to list all of the MessagingProfiles. Is the documentation pointing me to the wrong class/method? The MessageProfile objects don't seem to have aList
method of their own.Ultimately, it's not at all clear how to retrieve the list of phone numbers associated with a MessagingProfile. I'm going to have to make some manual HTTP requests rather than using the .net SDK.
Using version 2.1.1 of the Telnyx.net library.