This document contains scenario and reference information that you can use when preparing to use the API with SMS messages. Code samples in this document are .NET 2.0 (C#). For more code samples, visit the ExactTarget Developer Community.
This document is intended for developers using the ExactTarget Web Service API to enable SMS messages.
This document discusses API calls you can use with SMS messages. SMS messages can be created and sent from within the application. See SMS Messages for more information.
Before you can use the ExactTarget API with SMS messages, you must have the following:
The following scenarios cover the most common business processes around triggering SMS messages with code samples.
You use the following code to send an SMS message to a single subscriber, as a response to an MO message or other triggering event.
// ************** Single SEND (SMS)**************
//1. Create SMS triggered send object
ts = new SMSTriggeredSend();
//2. Set up the triggered send definition
ts.SMSTriggeredSendDefinition = new SMSTriggeredSendDefinition();
ts.SMSTriggeredSendDefinition.CustomerKey = "YourSMSSendID";
//3. Set up the subscriber
ts.Subscriber = new Subscriber();
ts.Subscriber.SubscriberKey = "YourSubscriberID";
ts.Number = "18125556911";
ts.Message = "Hello phone";
//4. Invoke the Web Service
results = partnerAPI.Create(new CreateOptions(), new APIObject[] { ts }, out requestID, out status);
You use the following code to send an SMS message to a list, as an MT message.
// ************** List SEND (SMS) **************
//1. Create SMS triggered send object
ts = new SMSTriggeredSend();
//2. Set up the triggered send definition
ts.SMSTriggeredSendDefinition = new SMSTriggeredSendDefinition();
ts.SMSTriggeredSendDefinition.CustomerKey = "YourSMSSendID";
ts.Message = "Hello phone"; //optional
//3. Invoke the Web Service
results = partnerAPI.Create(new CreateOptions(), new APIObject[] { ts }, out requestID, out status);