Skip to content

Instantly share code, notes, and snippets.

@EsendexDev
Last active December 20, 2015 03:29
Show Gist options
  • Save EsendexDev/6064032 to your computer and use it in GitHub Desktop.
Save EsendexDev/6064032 to your computer and use it in GitHub Desktop.
Getting Inbox messages using the Esendex .Net SDK - Full details here: http://developers.esendex.com/
const int pageNumber = 1;
const int pageSize = 20;
var credentials = new EsendexCredentials("Username", "Password");
var inboxService = new InboxService(credentials);
var messageBodyService = new MessageBodyService(credentials);
var receivedMessages = inboxService.GetMessages(pageNumber, pageSize);
foreach (var message in receivedMessages.Messages)
{
Console.WriteLine("Message Id: {0} from {1}", message.Id, message.Originator.PhoneNumber);
messageBodyService.LoadBodyText(message.Body);
Console.WriteLine("Message: {0}", message.Body.BodyText);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment