AT&T API Platform SDK for Microsoft®  2.3.3
Wrapper classes that allow developers to build robust applications using .NET
 All Classes Namespaces Functions Enumerations Properties
In-application Messaging From Mobile Number Service Cookbook

Overview

This cookbook shows you how to develop an In-application Messaging From Mobile Number Service application using the Platform SDK for Microsoft.
The Platform SDK for Microsoft provides the following methods:

  • Send Message
  • Get Message Headers
  • Get Message Content

To use these methods in an application, perform the following steps:

  1. Add a reference to the SDK as shown in the About the Cookbooks section and import the ATT_MSSDK.MOBOv1, ATT_MSSDK.MIMv1 namespaces.
  2. Create an instance of RequestFactory with the scope type RequestFactory.ScopeTypes.IMMN, as shown in the About the Cookbooks section.
  3. Invoke the In-application Messaging From Mobile Number Service methods using the RequestFactory instance.

Sending a message

To send Short Message Service (SMS) or Multimedia Messaging Service (MMS) on behalf of subscribers, invoke the SendMessage method using the RequestFactory instance by passing the addresses, message content and attachments (attachments are optional) as parameters. The AT&T Platform will retrieve the MSISDN of the subscribers from the consent mechanism and then append it as the source address in the request. The recipients (maximum of ten) can be email address, short code or mobile numbers or combination of email address, short code or/and mobile numbers. Application will make a single API call and the AT&T Platform will figure out if the message is SMS or MMS based on the content and then select the correct transport mechanism accordingly.

 string addresses = "xxxxxxxxx";
 List<string> attachments = null;
 attachments.Add("xxxxxxxxxxx");
 attachments.Add("xxxxxxxxxxx");
 string message = "xxxxx xxxxx xxx xxxxxxxxxx";
 SendMessageResponse response = this.requestFactory.SendMessage(addresses, attachments, message);

Getting Message Headers

To request a block of subscriber message headers from the AT&T Platform, invoke the GetMessageHeaders method using the RequestFactory instance by passing a count and an optional index value for referencing the starting record of the query as shown in the following code example. The initial request must only contain the count parameter.

 GetMessageHeadersResponse response = this.requestFactory.GetMessageHeaders(10);

Getting Message Content

To request message content from the AT&T Platform, invoke the GetMessage method using the RequestFactory instance by passing a content identifier and an associated message identifier. The GetMessage method uses the information returned by the GetMessageHeaders method to fetch one or more subscriber messages from the AT&T Platform.

 GetMessageContentResponse response = this.requestFactory.GetMessage("S10","1");