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

Add Delivery Receipt Route

In order to receive Delivery receipts we'll need to add another route to our SmsController. This will be a GET route at /webhooks/dlr. This will only print to the console

[HttpGet("/webhooks/dlr")]
public IActionResult ReceiveDlr()
{
    var dlr = Vonage.Utility.WebhookParser.ParseQuery<DeliveryReceipt>(Request.Query);
    Console.WriteLine("DLR Received");
    Console.WriteLine($"Message Id: {dlr.MessageId}");
    Console.WriteLine($"To: {dlr.Msisdn}");
    Console.WriteLine($"From: {dlr.To}");
    Console.WriteLine($"Time: {dlr.MessageTimestamp}");
    return Ok();
}

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