MX.Platform.Notifications.Api.Client.V1 1.0.18

dotnet add package MX.Platform.Notifications.Api.Client.V1 --version 1.0.18
                    
NuGet\Install-Package MX.Platform.Notifications.Api.Client.V1 -Version 1.0.18
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MX.Platform.Notifications.Api.Client.V1" Version="1.0.18" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MX.Platform.Notifications.Api.Client.V1" Version="1.0.18" />
                    
Directory.Packages.props
<PackageReference Include="MX.Platform.Notifications.Api.Client.V1" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MX.Platform.Notifications.Api.Client.V1 --version 1.0.18
                    
#r "nuget: MX.Platform.Notifications.Api.Client.V1, 1.0.18"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MX.Platform.Notifications.Api.Client.V1@1.0.18
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MX.Platform.Notifications.Api.Client.V1&version=1.0.18
                    
Install as a Cake Addin
#tool nuget:?package=MX.Platform.Notifications.Api.Client.V1&version=1.0.18
                    
Install as a Cake Tool

MX.Platform.Notifications.Api.Client.V1

This package provides a typed HTTP client for the Platform Notifications service with Entra ID authentication and DI registration.

Installation

dotnet add package MX.Platform.Notifications.Api.Client.V1

Registration

services.AddNotificationsApiClient(options => options
    .WithBaseUrl("https://your-notifications-api.azurewebsites.net")
    .WithEntraIdAuthentication("api://your-app-id"));

Sending an Email

public class OrderService(INotificationsApiClient notifications)
{
    public async Task SendOrderConfirmation(string customerEmail, string orderId)
    {
        var request = new SendEmailRequestDto
        {
            SenderDomain = "contoso.com",
            SenderDisplayName = "Contoso Orders",
            Subject = $"Order {orderId} Confirmed",
            HtmlBody = $"<p>Your order <strong>{orderId}</strong> has been confirmed.</p>",
            PlainTextBody = $"Your order {orderId} has been confirmed.",
            To = [new EmailRecipientDto { EmailAddress = customerEmail }]
        };

        var result = await notifications.Email.SendEmail(request);

        if (!result.IsSuccess)
        {
            // Handle failure — check result.Result.Errors for details
            throw new InvalidOperationException(
                $"Failed to send email: {result.StatusCode}");
        }

        // result.Result.Data.MessageId contains the tracking ID
        // result.Result.Data.Status will be "Queued"
    }
}

Error Handling

Status Code Meaning
202 Email accepted and queued for asynchronous delivery
400 Invalid request (missing required fields)
401 Authentication failure (invalid or missing token)
403 Missing required app role for the sender domain
500 Internal server error (returned as CLIENT_ERROR in the client)

On unhandled exceptions (network errors, timeouts), the client returns an IApiResult with IsSuccess = false, StatusCode = 500, and error code CLIENT_ERROR. OperationCanceledException is not caught and will propagate.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MX.Platform.Notifications.Api.Client.V1:

Package Downloads
MX.Platform.Notifications.Api.Client.Testing

Test helpers for consumer apps: in-memory fakes of INotificationsApiClient, DTO factory methods, and DI extensions for integration tests.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.18 106 3/10/2026
1.0.17 108 3/10/2026
1.0.7 101 3/8/2026
1.0.3 99 3/7/2026