team-telnyx / telnyx-dotnet

.NET SDK for the Telnyx API
MIT License
9 stars 9 forks source link

List Phone Numbers on Message Profile #35

Closed kalzekdor closed 3 years ago

kalzekdor commented 3 years ago

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.

Using version 2.1.1 of the Telnyx.net library.

thedonmon commented 3 years ago

@kalzekdor apologies for the delay. Will revise and make updates as necessary.