-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Typescript types for SMS Status Callbacks #802
Comments
I was referring to the HTTP body that the webhook sends. Something like this:
|
Ah I see. We'll add this issue to our backlog to be prioritized (internal reference: DI-2383). +1s and comments on the issue summary will help it move up the backlog. |
Bumping this, also I defined some types myself in one of my projects where I used Status Callbacks: export enum OutboundSmsStatuses {
sent = 'sent',
delivered = 'delivered',
undelivered = 'undelivered',
failed = 'failed',
queued = 'queued',
}
export enum InboundSmsStatuses {
receiving = 'receiving',
received = 'received',
}
export interface StatusCallback {
AccountSid: `AC${string}`;
MessageSid: `SM${string}`;
SmsSid: `SM${string}`;
MessageStatus: OutboundSmsStatuses | InboundSmsStatuses;
SmsStatus: OutboundSmsStatuses | InboundSmsStatuses;
From: `+${number}`;
To: `+${number}`;
ApiVersion: `${number}-${number}-${number}`;
} As you may notice this is using TypeScript's Template Literal Types |
There are a few more statuses like 'accepted' and 'scheduled' that I am not sure where to place but this is the gist of it. |
Previously, in v3 There is a reason for that? b471067#diff-2adf184f135ba5d85051c5b5f187adf3d9eb878362c5a04be926ef951b1ff5afL477 |
Hi @vinicius73. Thanks for pointing this out. We'll add this issue to our backlog to be prioritized (internal reference: DI-2576). +1s and comments on the issue summary will help it move up the backlog. In the future, please open a new issue thread so that we can better triage the issue, help to avoid potentially missing your comment, and help track the progress individually from the OP. |
And any news about adding Status Callback type, as per the suggestion above or in general? |
@PCOffline We have this on our internal backlog (DI-2383). |
Thanks @Hunga1 |
This issue has been added to our internal backlog to be prioritized as it changes generated configuration. +1s on the issue summary will help it move up the backlog (DI-2383). |
It would of course be quite nice if Twilio provided types for all the different webhook request bodies, including SMS and Voice. This issue has a common thread with #588 which I see has also been marked as Can anyone (perhaps @claudiachua) speak to the current status of DI-2383? How far down the backlog is it? I would hope Twilio considers DX a priority. 🙂 |
Yeah this issue has been stale for over a year. The change is small enough to take a day of work for me, which would include both research about every field and actual code, so I'd assume it'd take even less time for a Twilio employee familiar with the codebase and API. |
Hey, @Hunga1, @claudiachua, any updates on this? I don't see a reason why such a small change would take over a year. |
@PCOffline Would you perhaps have the bandwidth to submit a PR? I wonder if Twilio would take it given the right conditions. |
@otowncaleb ill try :) |
I'm pretty sure there are no typescript types for SMS Status Callback Webhooks. Could you add this in the future? Thanks!
The text was updated successfully, but these errors were encountered: