ServiceResource - add Status property (related to error - Unprocessable Entity)
JakubHolovsky opened this issue · 2 comments
JakubHolovsky commented
Issue Summary
When calling
await UsAppToPersonResource.CreateAsync(
brandRegistrationSid: brandRegistration.Sid,
description: input.MessageCampaignUseCase,
messageSamples: messageSamples,
usAppToPersonUsecase: "STARTER",
hasEmbeddedLinks: true,
hasEmbeddedPhone: true,
pathMessagingServiceSid: service.Sid,
client: twilioRestClient
);
we are getting:
Unprocessable Entity in the call to create an A2P Campaign for messaging service MGfb753ea7d7587e0a34586376c61a13b4: Can't create campaign
Can you add a status property on MessageResource with "Status" so we can check the status before submitting it to UsAppToPersonResource.CreateAsync otherwise I haven't found any other way how to check for the validity of the messaging service before we pass it on.
Steps to Reproduce
- Create a messaging service right before doing a UsAppToPersonResource.CreateAsync call
- Observe that it fails on Unprocessable Entity in the call to create an A2P Campaign for messaging service MGfb753ea7d7587e0a34586376c61a13b4: Can't create campaign
Code Snippet
await UsAppToPersonResource.CreateAsync(
brandRegistrationSid: brandRegistration.Sid,
description: input.MessageCampaignUseCase,
messageSamples: messageSamples,
usAppToPersonUsecase: "STARTER",
hasEmbeddedLinks: true,
hasEmbeddedPhone: true,
pathMessagingServiceSid: service.Sid,
client: twilioRestClient
);
Exception/Log
Unprocessable Entity in the call to create an A2P Campaign for messaging service MGfb753ea7d7587e0a34586376c61a13b4: Can't create campaign
Technical details:
- twilio-csharp version: 5.62.5
- csharp version: 9
shwetha-manvinkurke commented
The MessageResource
is auto generated based on the api definition. Is the issue that the particular service does not exist? How do you define validity here?
JenniferMah commented
Closing due to inactivity. Please open a new github issues if you need any additional help.