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
<PackageReference Include="MX.Platform.Notifications.Api.Client.V1" Version="1.0.18" />
<PackageVersion Include="MX.Platform.Notifications.Api.Client.V1" Version="1.0.18" />
<PackageReference Include="MX.Platform.Notifications.Api.Client.V1" />
paket add MX.Platform.Notifications.Api.Client.V1 --version 1.0.18
#r "nuget: MX.Platform.Notifications.Api.Client.V1, 1.0.18"
#:package MX.Platform.Notifications.Api.Client.V1@1.0.18
#addin nuget:?package=MX.Platform.Notifications.Api.Client.V1&version=1.0.18
#tool nuget:?package=MX.Platform.Notifications.Api.Client.V1&version=1.0.18
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 | Versions 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. |
-
net10.0
- Azure.Identity (>= 1.17.1)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Options (>= 10.0.3)
- MX.Api.Abstractions (>= 2.3.25)
- MX.Api.Client (>= 2.3.25)
- MX.Platform.Notifications.Abstractions.V1 (>= 1.0.18)
- Newtonsoft.Json (>= 13.0.4)
- RestSharp (>= 113.1.0)
-
net9.0
- Azure.Identity (>= 1.17.1)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Options (>= 10.0.3)
- MX.Api.Abstractions (>= 2.3.25)
- MX.Api.Client (>= 2.3.25)
- MX.Platform.Notifications.Abstractions.V1 (>= 1.0.18)
- Newtonsoft.Json (>= 13.0.4)
- RestSharp (>= 113.1.0)
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.