team-telnyx / telnyx-dotnet

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

NewMessagingSenderId.AddExtraParams method throws Invalid JSON error #78

Closed jaimefuhr closed 10 months ago

jaimefuhr commented 10 months ago

Trying to use the AddExtraParams method when sending an SMS to attach metadata to the call. I'm getting

"Invalid JSON The supplied JSON is invalid. at Telnyx.Infrastructure.Requestor.ExecuteRequest(HttpRequestMessage requestMessage)"

Code:

var request = new RequestOptions(); request.ApiKey = APIKey;

var sendOptions = new NewMessagingSenderId { To = CleanPhoneNumber(message.PhoneNumberTo), MessagingProfileId = new Guid(MessageProfileId), Text = message.Text };

sendOptions.AddExtraParam("refID", "123");

var messageService = new MessagingSenderIdService(); var response = messageService.Create(sendOptions, request);

jaimefuhr commented 10 months ago

Response from Telnyx support that this may be implemented in the future but is not supported at this time.