C# SMS API accepted for delivery

When you send an SMS with the C# SMS API the fist step you take is pass it to the Ozeki SMS gateway for delivery. The sms gateway will immediately decide whether your SMS is accepted or not. If your SMS text messages is accepted for delivery it will be added to the outbox folder of the C# sms api user.

C# sms api, text message accepted for delivery
Figure 1 - C# sms api - message accepted for delivery

The C#/.Net SMS api message accepted event

When an sms is sent by the C# SMS api the following procedure occurs: The sms is sent, it is accepted by the sms gateway and stored in the outbox folder, that acts as an SMS message queue. Next it is sent to the mobile network. The first information you receive for the sent SMS is the OnMessageAcceptedForDelivery event. This event is returned by the SMS gateway to the C# SMS API client application immediately after the SMS is sent.

To handle the OnMessageAcceptedForDelivery event in the C# SMS API use these steps:

  • Write the C# event handler for the OnMessageAcceptedForDelivery event
  • Send an SMS in your C# sms api host application, and record the sms message ID
  • Process the incoming OnMessageAcceptedForDelivery event using the sms messages ID in your C# sms api code

C# sms api sms accepted event example:

Client.OnMessageAcceptedForDelivery += Client_OnMessageAcceptedForDelivery;

static void Client_OnMessageAcceptedForDelivery(object sender, OzxArgs<string> e)
    Console.WriteLine("Message accepted for delivery. ID: " + e.Item.ToString());

The OnMessageAcceptedForDelivery is returned by the SMS gateway in an OZX pdu, to notify the C# sms client about the fact, that the SMS was successfully added to the SMS outbox folder of the C# SMS API user.

The OnMessageAcceptedForDelivery event happens before the SMS is sent to the mobile network.

If for any reason the SMS is not accepted, the OnMessageAcceptedForDelivery event is triggered. Such event can happen for example if the C# sms api user runs out of sms credits, or if the disk becomes full on the SMS gateway. Note that the Ozeki SMS gateway is also an SMS Server, which means, that it does SMS store and forward. You can read more about the difference between an SMS gateway and an SMS server at ozeki.hu.

More information