这份文档还在翻译中,预期年底前完成。欢迎您提供宝贵的意见及建议。

Configure your prerequisites

There are a few prerequisites that you need to complete before you can work through this tutorial. If you've already completed any of them, feel free to skip that step.


您可以通过 Dashboard 创建 Vonage 帐户。

在 Dashboard 中,您可以创建应用程序并购买 Vonage 号码。您也可以使用 Nexmo CLI 执行这些任务。

Download and install the latest version of the .NET Core SDK.

Vonage 的 API 必须可以通过公共互联网访问您的 Webhook。在开发过程中,无需依赖您自己的服务器实现此目标的一种简单方法是使用 Ngrok。要了解更多信息,请阅读有关 Ngrok 的文档

下载并安装 ngrok,然后执行以下命令以将端口 3000 的应用程序公开到公共互联网:

./ngrok http 3000

如果您是付费订阅者,则可以键入:

./ngrok http 3000 -subdomain=your_domain

注意 :在本示例中,Ngrok 会将您在创建 Vonage 应用程序时指定的 Vonage Webhook 转移到 localhost:3000。尽管这里显示端口 3000,但是您可以使用任何方便的空闲端口。

Configure Account Webhooks

In order to receive SMS messages and DLRs you will need to set two account level settings. Your account level Delivery Receipt and Inbound Messages URL. You can find this in your dashboard account settings page.

Set these URLs to, replacing NGROK_HOST_NAME with your ngrok host name

  • Inbound Messages: http://NGROK_HOST_NAME/webhooks/inbound-sms
  • Delivery Receipts: http://NGROK_HOST_NAME/webhooks/dlr

How to Receive SMS Delivery Receipts with ASP.NET Core MVC

Delivery receipts allow you to get information about when an SMS is delivered to a user's handset. This tutorial shows how you can receive these delivery receipt notifications in your ASP .NET application.



Steps