Ozeki 10 SMS Gateway

C# SMS API receive sms

To receive an SMS with the C# SMS API you need to sign up to the OnMessages received event, and write the event handler method that will process the incoming SMS sent by the Ozeki SMS gateway.

C# sms api receive sms
Figure 1 - C# sms api receive sms

The C#/.Net SMS api receive SMS method

To receive an sms in the the C#/.Net SMS api follow these steps

  • Sign up for the OnMessageReceived event
  • Write the C# event handler to receive the SMS
  • Process the incoming SMS in your C# sms api host application

C# sms api receive sms example:

Client.OnMessageReceived += Client_OnMessageReceived;

static void Client_OnMessageReceived(object sender, OzxArgs<IOzxMessage> e)
    Console.WriteLine("Message received: " + e.Item.ToString());

The e.Item parameter is a full OzxMessage. This means, that you have all the details of the SMS messages in your C# sms api event. These details include the SMS sender ID, the phone number where the SMS was sent to, the SMS text, and the corresponding timestamps.

One of the biggest advantage to using the Ozeki C# SMS API is that you get incoming SMS messages instantly. As soon as they hit the SMS gateway, they are forwarded to your C# SMS client through the established TCP/IP link. This means you will not experience any delays.

If you C# sms api client is not connected to the SMS gateway when the SMS is received, the SMS is stored in the inbox folder of the SMS gateway. This means your incoming messages will not get lost event if the sms softare you have written using the C# sms api is offline. This is due to the fact that Ozeki SMS Gateway is actually an SMS server.

More information