We use optional, privacy-safe analytics to understand which pages help visitors. Nothing optional runs until you choose. Privacy policy

Skip to content
Example AvailableDirect HTTP API

Send SMS from ASP.NET Core with the SendiMessage API

ASP.NET Core registers a named HttpClient for SendiMessage once, then any service or minimal-API endpoint can send with dependency injection — no static clients, easy to test.

The example wires both the outbound send and the inbound webhook endpoint into a minimal API app.

Request This SetupBook an Integration Review

What this integration enables

Order and status notifications
Trigger messages from ASP.NET Core when records change state.
Appointment reminders
Scheduled tasks that message customers before a booking.
Support updates
Notify customers as their request moves forward.
Reply handling
Receive incoming replies on a webhook route in the same codebase.

Architecture

How it fits together: Your application event, then ASP.NET Core server code, then SendiMessage API, then Managed messaging line, then Webhook events.
  1. Your application eventAn order ships, a booking nears, a ticket updates
  2. ASP.NET Core server codeBuilds the request with credentials from the environment
  3. SendiMessage APIPOST /send-message returns the queued message
  4. Managed messaging lineSMS, or iMessage on supported lines and destinations
  5. Webhook eventsDelivery status and incoming replies post back to your endpoint

Example request

ASP.NET Core
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpClient("sendimessage", client =>
{
client.BaseAddress = new Uri("https://api.sendimessage.com/v1/");
client.DefaultRequestHeaders.Add("X-API-Key",
builder.Configuration["SendiMessage:ApiKey"]); // from env / user-secrets
client.DefaultRequestHeaders.Add("X-API-Secret",
builder.Configuration["SendiMessage:ApiSecret"]);
});
var app = builder.Build();
app.MapPost("/notify", async (IHttpClientFactory factory, NotifyRequest body) =>
{
var client = factory.CreateClient("sendimessage");
var response = await client.PostAsJsonAsync("send-message", new
{
number = body.To, content = body.Text,
});
if (!response.IsSuccessStatusCode)
return Results.StatusCode(502);
var message = await response.Content.ReadFromJsonAsync<QueuedMessage>();
return Results.Ok(message); // { message_handle, status: "QUEUED", … }
});
app.MapPost("/webhooks/sendimessage", (HttpRequest request) =>
{
// Verify the SendiMessage-Signature header before trusting the event.
return Results.Ok();
});
app.Run();
record NotifyRequest(string To, string Text);
record QueuedMessage(string Message_Handle, string Status);
record WebhookEvent(string Type);

Delivery events and incoming replies

Point a ASP.NET Core route at your webhook URL to receive delivery status and incoming replies. Verify the signature header before processing.

webhook event
// "outbound" event → your aspnet-core endpoint
// Verify the SendiMessage-Signature header (t={timestamp},v1=HMAC-SHA256 of
// "{timestamp}.{raw body}", keyed with your webhook secret), then use
// GET /v2/messages/{message_handle} for authoritative state and match it to
// your contact_id in aspnet-core.

Limitations and honest notes

  • iMessage delivery is available on supported messaging lines and destinations. Recipients without iMessage receive SMS when fallback is configured — never assume universal iMessage availability.
  • Messages are accepted asynchronously — the API returns status QUEUED and final status arrives via webhook or the message endpoints.
  • No official SDK for this ecosystem yet — the example uses plain HTTP against the REST API. Official SDKs are published for JavaScript/TypeScript (npm: sendimessage), Python (PyPI: sendimessage), PHP (Composer: sendimessage/sdk), and Go (github.com/sendimessage/sendimessage-go). Every SDK is dependency-free and covers the full public API surface.

Security considerations

  • Keep the API key pair in server configuration or environment variables, never in the repository.
  • Verify webhook signatures before trusting delivery or reply events.

Frequently asked questions

Is there an official ASP.NET Core package for SendiMessage?
Not a framework-specific one. SendiMessage is a plain REST API, so your framework's standard HTTP client is all that's required — the example on this page is complete. Official SDKs are published for JavaScript/TypeScript, Python, PHP, and Go.
Can ASP.NET Core receive message replies?
Yes. Add a route that accepts SendiMessage webhook POSTs; incoming replies arrive as receive events. Correlate them with your records via the message_handle and conversation data in the event.

Ready to connect ASP.NET Core?

Request a messaging line and a SendiMessage integration specialist will review your ASP.NET Core workflow and guide the setup.