-
Notifications
You must be signed in to change notification settings - Fork 309
Open
Labels
difficulty: easyfix is easy in difficultyfix is easy in difficultystatus: help wantedrequesting help from the communityrequesting help from the communitytype: bugbug in the librarybug in the library
Description
Issue Summary
Creating a message resource with the sendAt parameter set yields error response from Twilio API, stating invalid format, since wrong separators are used, . (dot) instead of : (colon)
Steps to Reproduce
- Create message with MessageResource.CreateAsync that has sendAt DateTime
- Receive exception response from API
Code Snippet
public async Task SendSmsAsync(SmsMessage msg)
{
var conf = await _configurationProvider.GetConfiguration();
await MessageResource.CreateAsync(@from: conf.From,
to: msg.To,
sendAt: msg.SendAt,
scheduleType: MessageResource.ScheduleTypeEnum.Fixed,
body: msg.Body,
client: _twilioRestClientFactory.Create(conf));
}
Exception/Log
API response:
{"code": 20001, "message": "Invalid SendAt: 2022-01-28T14.44.47Z. SendAt must be a valid ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z'", "more_info": "https://www.twilio.com/docs/errors/20001", "status": 400}
Exception trace (truncated):
Twilio.Exceptions.ApiException: Invalid SendAt: 2022-01-28T14.44.47Z. SendAt must be a valid ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z'
at Twilio.Clients.TwilioRestClient.ProcessResponse(Response response)
at Twilio.Clients.TwilioRestClient.RequestAsync(Request request)
at Twilio.Rest.Api.V2010.Account.MessageResource.CreateAsync(CreateMessageOptions options, ITwilioRestClient client)
at Twilio.Rest.Api.V2010.Account.MessageResource.CreateAsync(PhoneNumber to, String pathAccountSid, PhoneNumber from, String messagingServiceSid, String body, List`1 mediaUrl, Uri statusCallback, String applicationSid, Nullable`1 maxPrice, Nullable`1 provideFeedback, Nullable`1 attempt, Nullable`1 validityPeriod, Nullable`1 forceDelivery, ContentRetentionEnum contentRetention, AddressRetentionEnum addressRetention, Nullable`1 smartEncoded, List`1 persistentAction, ScheduleTypeEnum scheduleType, Nullable`1 sendAt, Nullable`1 sendAsMms, ITwilioRestClient client) [...]
Technical details:
- twilio-csharp version: 5.70
- csharp version: net6.0
tokuosma and Swimburger
Metadata
Metadata
Assignees
Labels
difficulty: easyfix is easy in difficultyfix is easy in difficultystatus: help wantedrequesting help from the communityrequesting help from the communitytype: bugbug in the librarybug in the library