Skip to content

Instantly share code, notes, and snippets.

See: https://github.com/esendex/esendex-node-sdk
client := esendex.New("username", "password")
messages, err := client.Sent()
client := esendex.New("username", "password")
response, _ := client.Sent()
for _, message := range response.Messages {
body, _ := client.Body(message)
fmt.Printf("MessageID: %s\nMessage: %s\n\n", message.ID, body.Text)
}
client := esendex.New("username", "password")
messages, err := client.Received()
client := esendex.New("username", "password").Account("accountRef")
client.Send([]esendex.Message{
{MessageType: "Voice", To: "07123456789", Body: "Hello!"},
})
client := esendex.New("username", "password").Account("accountRef")
client.Send([]esendex.Message{
{To: "07123456789", Body: "Hello!"},
{To: "07987654321", Body: "Goodbye!"},
})
client := esendex.New("username", "password").Account("accountRef")
scheduleTime := time.Now().UTC().Add(6 * time.Hour)
client.SendAt(scheduleTime, []esendex.Message{
{To: "07123456789", Body: "Hello!"},
})
@EsendexDev
EsendexDev / CreateAndScheduleSMS.vb
Last active November 4, 2015 10:39
Creating and scheduling single SMS messages using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Dim accountReference = "EX0000123"
Dim messagingService = New MessagingService("Username", "Password")
Dim singleMessage = New SmsMessage("447123456789", "Message Body", accountReference)
'Schedules a message to be sent on 31/10/2015 at 15:22
messagingService.SendScheduledMessage(singleMessage, New System.DateTime(2015, 10, 31, 15, 22, 0))
@EsendexDev
EsendexDev / CreateAndSendMultiVoice.vb
Last active November 4, 2015 10:38
Creating and sending multiple voice messages using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Dim accountReference = "EX0000123"
Dim messagingService = New MessagingService("Username", "Password")
Dim multipleMessages = New VoiceMessageCollection
'Important! Do not forget to set the account reference on the messages collection.
'This should be the same as the account reference for the individual messages
multipleMessages.AccountReference = accountReference
multipleMessages.Items.Add(New VoiceMessage("447123456789", "Message Body", accountReference))
multipleMessages.Items.Add(New VoiceMessage("447456789123", "Message Body", accountReference))
@EsendexDev
EsendexDev / CreateAndSendVoice.vb
Created September 4, 2015 15:19
Creating and sending single voice messages using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Dim accountReference = "EX0000123"
Dim messagingService = New MessagingService("Username", "Password")
Dim singleMessage = New VoiceMessage("447123456789", "Message Body", accountReference)
messagingService.SendMessage(singleMessage)