May 18, 2026

Sending SMS with SMSFlow using C# 


Sending SMS with SMSFlow using C#

Sending SMS with SMSFlow using C# 

SMSFlow provides a simple and reliable REST API that allows developers to send SMS messages directly from their applications using C#.  

Whether you are building notifications, marketing campaigns, appointment reminders, or system alerts, integrating SMS functionality into a C# application is straightforward with SMSFlow.  

In this guide, you will learn how to authenticate with the SMSFlow API, retrieve a bearer token, and send SMS messages using modern C# and .NET. By combining SMSFlow with C#, developers can quickly add scalable SMS communication features to both web and desktop applications. 

Prerequisites 

Before you begin, make sure you have: 

  • An SMSFlow account 
  • Your ClientID 
  • Your ClientSecret 
  • A C# project using .NET 6 or later 

SMSFlow API Endpoints 

SMSFlow uses token-based authentication. You first request an authentication token, then use that token when sending SMS messages. 

Authentication endpoint 

This endpoint returns a token that must be used in the Authorization header for later requests. 

Send messages endpoint 

This endpoint sends one or more SMS messages to a list of contacts. 

Step 1: Create the C# Models 

First, define the request and response models. 

Step 2: Authenticate with SMSFlow 

The authentication request uses your ClientID and ClientSecret. 

Step 3: Send an SMS Message 

After receiving the token, use it as a bearer token when calling the bulk messages endpoint. 

Step 4: Full Working Example 

Here is a complete example showing authentication and message sending together. 

Sending Multiple Messages 

The messages array allows you to send SMSes to multiple recipients in one request. 

Scheduling SMS Delivery 

To schedule SMS delivery, provide a UTC date and time in StartDeliveryUtc. 

Handling Opt-Outs 

The CheckOptOuts field determines whether SMSFlow should check if a recipient has opted out. 

When set to true, SMSFlow will not send messages to contacts marked as opted out. 

Error Handling 

Always wrap API calls in a try-catch block so your application can handle failed requests gracefully. 

Best Practices 

When integrating SMSFlow into a C# application: 

  • Store your ClientID and ClientSecret securely. 
  • Do not hardcode credentials in production code. 
  • Use environment variables or a secure secrets manager. 
  • Always use UTC when scheduling messages. 
  • Set CheckOptOuts to true unless there is a specific reason not to. 
  • Log failed requests for troubleshooting. 
  • Validate mobile numbers before sending messages. 

Conclusion 

The SMSFlow API makes it easy to send SMS messages from a C# application. By authenticating with your ClientID and ClientSecret, retrieving a bearer token, and posting a message batch to the bulk messages endpoint, developers can quickly integrate SMS communication into their systems. 

Whether you are sending appointment reminders, delivery updates, marketing campaigns, or system alerts, SMSFlow provides straightforward API that works well with modern C# applications. 

Want to learn more, contact us here.  

Unlock the potential of Bulk SMS

Be the master of your bulk SMS strategy with our tactical Playbook to drive repeat purchases and sales.
Try it for free