SMS API

MESSAGING

SendMessage

This method sends an SMS or MMS message to any number of recipients. MMS messages must each be no larger than 1MB in size.

Endpoint

POST:
https://messaging.esendex.us/Messaging.svc/SendMessage

Syntax

SendMessage(Request)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
AttachmentsAttachments for the message. The message must use MMS to have attachments. This value can include either URLs or Media IDs. (Media IDs are for files that you have uploaded to your license key.)Array of String valuesTrue, when sending a message without a Body.17772, https://esendex.us/img/docs/example.jpg
BodyText content for the message.StringTrue, when sending a message without Attachments.This is a sample message.
ConcatenateThe API automatically breaks up long SMS messages into fragments. Use concatenation to reunite the fragments as a single message on the recipient’s device. Note that fragments and concatenation are not used with MMS.BooleanFalseTrue
FromNumber to send the message from. If unspecified, one of your numbers will be chosen automatically. (Contact Esendex to add a number to your account.)StringFalse7575550000
IsUnicodeWhether the message should be sent using Unicode encoding. Note that all MMS messages support Unicode.BooleanFalseTrue
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
PostbackUrlURL to send postbacks to.StringFalsehttp://www.example.com/postback.aspx
ReferenceIDCustom ID of your choice. You can use this ID to filter incoming messages when you read them.StringFalse123
ScheduledDateTimeUTC date/time when message will send. Specified as milliseconds from the epoch of 1970-01-01T00:00:00Z.DateTimeFalse\/Date(1682439497785)\/
SubjectSubject line for the message.StringFalseMessaging Test
ToRecipient number.Array of String valuesTrue7575559999
UseMMSWhether to send as an MMS message. MMS is required when sending attachments.BooleanTrueTrue

Response

Returns: Array of OutgoingMessageResponse objects

ReadMessageStatus

This method reads the status of an incoming or outgoing message.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/ReadMessageStatus?LicenseKey={LICENSEKEY}&MessageId={MESSAGEID}

Syntax

ReadMessageStatus(LicenseKey, MessageID)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
MessageIDUnique ID for message.GUIDTrued73cd74b-8687-4701-8f03-f75b4d4d860d

Response

Returns: OutgoingMessageResponse object

ReadIncomingMessages

This method reads incoming messages. You can retrieve all incoming messages or only unread messages.

Endpoint

POST:
https://messaging.esendex.us/Messaging.svc/ReadIncomingMessages

Syntax

ReadIncomingMessages(Request)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
EndDateUTC date/time of newest messages to read. Specified as milliseconds from the epoch of 1970-01-01T00:00:00Z.DateTimeFalse\/Date(1682439497785)\/
IncomingMessageIDUnique ID of the incoming message.GUIDFalse1627aea5-8e0a-4371-9022-9b504344e724
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
OutgoingMessageIDUnique ID of the outgoing message.GUIDFalse1627aea5-8e0a-4371-9022-9b504344e724
PageNumberNumber of the page to retrieve.IntFalse1
PageSizeNumber of incoming messages per page.IntFalse20
ReferenceIDUnique ID that you assigned to the sent message.StringFalse123
StartDateUTC date/time of oldest messages to read. Specified as milliseconds from the epoch of 1970-01-01T00:00:00Z.DateTimeFalse\/Date(1682439497785)\/
UnreadMessagesOnlyWhether to retrieve all incoming messages or only incoming messages that are unread.BooleanFalsefalse

Response

Returns: Array of IncomingMessageResponse objects

Code Samples

You can use any programming language you want with our API, as long as it can make a REST or SOAP call. Here are examples for some of the most common platforms.

CancelAllMessages

This method cancels all messages scheduled for a future time or date. It has no effect on messages that have already been sent or queued.

Endpoint

POST:
https://messaging.esendex.us/messaging.svc/CancelAllMessages

GET:
https://messaging.esendex.us/messaging.svc/CancelAllMessages?LicenseKey={LICENSEKEY}

Syntax

CancelAllMessages(LicenseKey)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000

Response

Returns: Boolean

Description: Whether the cancellation was successful or not.

CancelMessage

This method cancels a message scheduled for a future time or date. It has no effect on messages that have already been sent or queued.

Endpoint

POST:
https://messaging.esendex.us/messaging.svc/CancelMessage

GET:
https://messaging.esendex.us/messaging.svc/CancelMessage?MessageID={MESSAGEID}

Syntax

CancelMessage(MessageID)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
MessageIDUnique ID of the message to cancel.GUIDTrue1627aea5-8e0a-4371-9022-9b504344e724

Response

Returns: Boolean

Description: Whether the cancellation was successful or not.

AddUnsubscribedNumbers

This method unsubscribes one or more phone numbers from a license key. Unsubscribed numbers will no longer receive any messages you send.

Endpoint

POST:
https://messaging.esendex.us/Messaging.svc/AddUnsubscribedNumbers

Syntax

AddUnsubscribedNumbers(LicenseKey, PhoneNumbers)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
PhoneNumbersThe phone numbers you want to unsubscribe.Array of String valuesTrue7575559999

Response

Returns: Array of UnsubscribedNumberResult objects

GetUnsubscribedNumbers

This method returns a list of all recipient numbers who have opted out of your messaging campaign.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/GetUnsubscribedNumbers?LicenseKey={LICENSEKEY}

Syntax

GetUnsubscribedNumbers(LicenseKey)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000

Response

Returns: Array of UnsubscribedNumber objects

RemoveUnsubscribedNumbers

This method resubscribes one or more phone numbers from a given license key.

Endpoint

POST:
https://messaging.esendex.us/Messaging.svc/RemoveUnsubscribedNumbers

Syntax

RemoveUnsubscribedNumbers(LicenseKey, PhoneNumbers)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
PhoneNumbersOne or more phone numbers to resubscribe.Array of String valuesTrue7575559999

Response

Returns: Array of UnsubscribedNumberResult objects

MEDIA

CreateMediaFromContent

This method adds a media file to a license key using the media’s binary representation.

Endpoint

POST:
https://messaging.esendex.us/Messaging.svc/CreateMediaFromContent

Syntax

CreateMediaFromContent(Request)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
Base64EncodedContentContent of the media file to create. This is binary data that is encoded as a string of base-64 digits.StringTrue
FileNameName of the media file to create.StringTrueMonkeyPic.jpg
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
TagsCategory of the media file.Array of String valuesFalseanimal

Response

Returns: MediaMetadata object

CreateMediaFromUrl

This method adds a media file to a license key from the media’s URL.

Endpoint

POST:
https://messaging.esendex.us/Messaging.svc/CreateMediaFromUrl

Syntax

CreateMediaFromUrl(Request)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
FileNameName of the media file to create.StringTrueMonkeyPic.jpg
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
TagsCategory of the media file.Array of String valuesFalseanimal
UrlWeb location of the file to create.StringTruehttps://esendex.us/img/docs/example.jpg

Response

Returns: MediaMetadata object

GetMedia

This method retrieves the binary representation of a media file that was added to your license key. This is binary data that is encoded as a string of base-64 digits.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/GetMedia?LicenseKey={LICENSEKEY}&MediaId={MEDIAID}

Syntax

GetMedia(LicenseKey, MediaID)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
MediaIDUnique ID of the media file.LongTrue12345678

Response

Returns: String

Sample:
iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAGdYAABnWARjRyu0AAAASSURBVBhXY3gro4IVDSkJGRUAmbtLQUb26xsAAAAASUVORK5CYII=

GetMediaInfo

This method retrieves information about your media files.

Endpoint

POST:
https://messaging.esendex.us/Messaging.svc/GetMediaInfo

Syntax

GetMediaInfo(Request)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
EndDateUTC date/time of newest media to retrieve.DateTimeFalse\/Date(1682439497785)\/
FilenamePatternName of the media.StringFalseMonkey.jpg
FileTypeFile type of the media.StringFalse.jpg
IncomingMessageIdUnique ID of the incoming message with the media.GUIDFalse1627aea5-8e0a-4371-9022-9b504344e724
LicenseKeyLicense key associated with the media.GUIDTrue00000000-0000-0000-0000-000000000000
MaximumFileSizeLargest file size of the media.LongFalse97465
MediaIdUnique ID of the media.LongFalse12345678
MinimumFileSizeSmallest file size of the media.LongFalse97465
OutgoingMessageIDUnique ID of the outgoing message with the media.GUIDFalse1627aea5-8e0a-4371-9022-9b504344e724
PageNumberNumber of the page to retrieve.IntFalse1
PageSizeNumber of media files per page.IntFalse10
StartDateUTC date/time of oldest media to retrieve.DateTimeFalse\/Date(1682439497785)\/
TagsCategory of the media.Array of String valuesFalseanimal

Response

Returns: MediaReply object

RemoveMedia

This method removes a media file from a license key.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/RemoveMedia?LicenseKey={LICENSEKEY}&MediaId={MEDIAID}

Syntax

RemoveMedia(LicenseKey, MediaID)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
MediaIDUnique ID of the media file to remove.LongTrue12345678

Response

Returns: Boolean

Description: Whether the removal was successful or not. This will be true even when the media does not exist.

KEYWORDS

AssignKeyword

This method assigns one or more custom keywords to a license key.

Endpoint

POST:
https://messaging.esendex.us/Messaging.svc?wsdl/AssignKeyword

Syntax

AssignKeyword(Request)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
SMSKeywordsThe keywords you want to add to the license key.Array of KeywordRequestInfo objectsTrue

Response

Returns: SMSKeywordResponse object

GetKeywords

This method returns all custom keywords currently assigned to a license key.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/GetKeywords?LicenseKey={LICENSEKEY}

POST:
https://messaging.esendex.us/Messaging.svc/GetKeywords

Syntax

GetKeywords(LicenseKey)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000

Response

Returns: GetKeywordsResponse object

GetSystemKeywordResponses

This method returns all system keywords for a given number.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/GetSystemKeywordResponses?LicenseKey={LICENSEKEY}&Number={NUMBER}

Syntax

AssignKeyword(LicenseKey, Number)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
NumberOne of your numbers.StringTrue7575550000

Response

Returns: SystemKeywordResponses object

RemoveKeyword

This method removes one or more custom keywords assigned to a given license key.

Endpoint

POST:
https://messaging.esendex.us/Messaging.svc/RemoveKeyword

Syntax

RemoveKeyword(Request)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
SMSKeywordsOne or more keyword requests.Array of KeywordRequestInfo objectsTrue

Response

Returns: RemoveKeywordResponse object

POSTBACKS

GetPostbackSettingsForLicenseKey

This method returns the postback settings for a license key.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/GetPostbackSettingsForLicenseKey?LicenseKey={LICENSEKEY}

Syntax

GetPostbackSettingsForLicenseKey(LicenseKey)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000

Response

Returns: Array of PostbackSettingsResponse objects

GetPostbackSettingsForPhoneNumber

This method returns postback settings for a number.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/GetPostbackSettingsForPhoneNumber?LicenseKey={LICENSEKEY}&PhoneNumber={PHONENUMBER}&Country={COUNTRY}

Syntax

GetPostbackSettingsForPhoneNumber(LicenseKey, PhoneNumber, Country)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
PhoneNumberNumber to check for postback settings.StringTrue7575550000
CountryOrigin country for number.StringTrueUS

Response

Returns: Array of PostbackSettingsResponse objects

SetPostbackEnabledForLicenseKey

This method retrieves postback settings for a given license key.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/SetPostbackEnabledForLicenseKey?LicenseKey={LICENSEKEY}&PostbackType={POSTBACKTYPE}&Enabled={ENABLED}

Syntax

SetPostbackEnabledForLicenseKey(LicenseKey)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
PostbackTypeIndicates whether the postback URL is used for incoming messages, outgoing messages, or delivery receipts.ValueDescription0 – AllUse the postback URL for all messages.1 – DeliveryReceiptUse the postback URL for delivery receipts.2 – IncomingMessageUse the postback URL for incoming messages.3 – OutgoingMessageUse the postback URL for outgoing messages.EnumTrue0 – All
EnabledIndicates whether the postback URL is enabled on the number.BooleanTrueTrue

Response

Returns: SetPostbackEnabledForLicenseKeyResponse object

SetPostbackEnabledForPhoneNumber

This method enables or disables a postback that you have assigned to a given number.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/SetPostbackEnabledForPhoneNumber?LicenseKey={LICENSEKEY}&PhoneNumber={PHONENUMBER}&Country={COUNTRY}&PostBackType={POSTBACKTYPE}&Enabled={ENABLED}

Syntax

SetPostbackEnabledForPhoneNumber(LicenseKey, PhoneNumber, Country, PostbackType, Enabled)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
PhoneNumberNumber for which to enable a postback URL.StringTrue7575550000
CountryOrigin country of the number.StringTrueUS
PostbackTypeIndicates whether the postback URL is used for incoming messages, outgoing messages, or delivery receipts.ValueDescription0 – AllUse the postback URL for all messages.1 – DeliveryReceiptUse the postback URL for delivery receipts.2 – IncomingMessageUse the postback URL for incoming messages.3 – OutgoingMessageUse the postback URL for outgoing messages.EnumTrue0 – All
EnabledIndicates whether the postback URL is enabled on the number.BooleanTrueTrue

Response

Returns: Enum

Sample:
0 – NoError

ValueDescription
0 – NoErrorThe update was successful.
1 – InvalidLicenseKeyThe requested license key is invalid.
2 – InvalidUrlThe requested URL is invalid.
3 – InvalidPhoneNumberThe requested phone number is invalid.
4 – InvalidPostbackTypeThe requested postback type is invalid.
5 – NotFoundThe requested resource was not found.
6 – InvalidCountryThe requested country is invalid.

SetPostbackUrlForLicenseKey

This method assigns a postback URL to a given license key.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/SetPostbackUrlForLicenseKey?LicenseKey={LICENSEKEY}&PostBackType={POSTBACKTYPE}&Url={URL}

Syntax

SetPostbackUrlForLicenseKey(LicenseKey, PostbackType, Url)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
PostbackTypeIndicates whether the postback URL is used for incoming messages, outgoing messages, or delivery receipts.ValueDescription0 – AllUse the postback URL for all messages.1 – DeliveryReceiptUse the postback URL for delivery receipts.2 – IncomingMessageUse the postback URL for incoming messages.3 – OutgoingMessageUse the postback URL for outgoing messages.EnumTrue0 – All
UrlThe URL that information will be posted to.StringTruehttp://www.example.com/postback.aspx

Response

Returns: Enum

Sample:
0 – NoError

ValueDescription
0 – NoErrorThe update was successful.
1 – InvalidLicenseKeyThe requested license key is invalid.
2 – InvalidUrlThe requested URL is invalid.
3 – InvalidPhoneNumberThe requested phone number is invalid.
4 – InvalidPostbackTypeThe requested postback type is invalid.
5 – NotFoundThe requested resource was not found.
6 – InvalidCountryThe requested country is invalid.

SetPostbackUrlForPhoneNumber

This method assigns a postback URL to a given number.

Endpoint

GET:
https://messaging.esendex.us/Messaging.svc/SetPostbackUrlForPhoneNumber?LicenseKey={LICENSEKEY}&PhoneNumber={PHONENUMBER}&Country={COUNTRY}&PostBackType={POSTBACKTYPE}&Url={URL}

Syntax

SetPostbackUrlForPhoneNumber(LicenseKey, PhoneNumber, Country, PostbackType, Url)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
PhoneNumberNumber for which to enable a postback URL.StringTrue7575550000
CountryOrigin country of the number.StringTrueUS
PostbackTypeIndicates whether the postback URL is used for incoming messages, outgoing messages, or delivery receipts.ValueDescription0 – AllUse the postback URL for all messages.1 – DeliveryReceiptUse the postback URL for delivery receipts.2 – IncomingMessageUse the postback URL for incoming messages.3 – OutgoingMessageUse the postback URL for outgoing messages.EnumTrue0 – All
UrlThe URL that information will be posted to.StringTruehttp://www.example.com/postback.aspx

Response

Returns: Enum

Sample:
0 – NoError

ValueDescription
0 – NoErrorThe update was successful.
1 – InvalidLicenseKeyThe requested license key is invalid.
2 – InvalidUrlThe requested URL is invalid.
3 – InvalidPhoneNumberThe requested phone number is invalid.
4 – InvalidPostbackTypeThe requested postback type is invalid.
5 – NotFoundThe requested resource was not found.
6 – InvalidCountryThe requested country is invalid.

TYPES

DeliveryReceiptCode

Indicates the status of an outgoing message. This value is included in the SMSDeliveryReceiptPostback and MMSDeliveryReceiptPostback types.

Type: Enum

Possible Values

ValueDescription
000 – DeliveredToDeviceThe message was delivered to the recipient.
003 – DeliveredToCarrierThe message was delivered to the carrier.
004 – AcceptedThe carrier accepted the message.
005 – UndelivOrDeletedThe carrier attempted but failed to deliver the message. The destination device might be out of network coverage, switched off, or roaming out of the carrier’s supported network.
008 – ExpiredThe message expired at the carrier.
023 – RejectedThe carrier rejected the message.
028 – SenderExceededCarrierThrottleThe message sender has exceeded the carrier’s maximum rate.
029 – RecipientExceededCarrierThrottleThe message recipient has exceeded the carrier’s maximum rate.
030 – SenderAndRecipentExceededCarrierThrottleThe message sender and recipient have exceeded the carrier’s maximum rate.
032 – InvalidMessageFormatOrTextMsgContentSizeExceededThe message is invalidly formatted or too large.
090 – BadAddressThe destination number is not a valid number, so the carrier rejected the message.
091 – InvalidRoutingThe carrier has not approved or provisioned the sending number.
999 – CarrierErrorUnknownThe carrier failed to send the message for an unknown reason.

GetKeywordsResponse

This response is returned by the GetKeywords method.

Type Properties

Property NameDescriptionData TypeSample
ReturnCodeReturn code for the operation. This is always 0 - NoError.Enum0 – NoError
SMSKeywordAll of the custom keywords assigned to the license key.Array of KeywordResponseInfo objects

IncomingMessageResponse

This response is returned by the ReadIncomingMessages method.

Type Properties

Property NameDescriptionData TypeSample
AttachmentsMedia IDs for the message’s attachments.Array of Long values10000001,10000005
FromNumber used to send the message.String7575550000
IncomingMessageIDUnique ID of the incoming message.GUID1627aea5-8e0a-4371-9022-9b504344e724
OutgoingMessageIDUnique ID of the outgoing message.GUID1627aea5-8e0a-4371-9022-9b504344e724
PayloadIncoming message content.StringThank you for your message.
ReceivedDateUTC date/time when the incoming message was received.DateTime\/Date(1682439497785)\/
SubjectSubject of the incoming message.StringReply
ToRecipient number.String7575559999
UdhHeader that shows the number of concatenated messages in their correct order.Array of Byte values81,109,70,122,90,83,65,50,78,67,66,84,100

KeywordResponseInfo

This type is included in the GetKeywordsResponseRemoveKeywordResponse, and SMSKeywordResponse types.

Type Properties

Property NameDescriptionData TypeSample
EntryDateUTC date/time when keyword was added.DateTime\/Date(1682439497785)\/
KeywordKeyword value.StringKeyword27
ReturnCodeReturn code for this keyword.ValueDescription0 – NoError1 – KeywordAddedWhen assigning a keyword, the keyword was successfully added.2 – KeywordAlreadyInUseWhen assigning a keyword, the keyword is already being used.3 – ShortCodeNotAssignedToKey4 – LicenseKeyInvalid5 – KeywordInvalid6 – ShortCodeInvalid7 – KeywordRemovedWhen removing a keyword, the keyword was successfully removed.8 – KeywordNotFound9 – InternalErrorEnum0 – NoError
ShortCodeShort code that this keyword is assigned to.String10101

MediaMetadata

This type is returned by the CreateMediaFromContent and CreateMediaFromUrl methods. It is also included in the MediaReply type.

Type Properties

Property NameDescriptionData TypeSample
FileDateUTC date/time when the media was created.DateTime\/Date(1682439497785)\/
FileNameName of the media file.StringMonkeyPic.jpg
FileSizeSize of the media file, in bytes.Long97465
MediaIdUnique ID of the media file.Long12345678
MimeTypeMedia type (MIME type) of the file.Stringimage/jpeg
TagsCategory of the media file.Array of String valuesMonkey, Animal

MessageStatus

This value is included in the OutgoingMessageResponse type.

Type: Enum

Possible Values

ValueDescription
0 – HoldMessage is on hold and will not be processed until set to ‘Ready’.
200 – SentMessage sent successfully. HTTP equivalent: 200 – OK
201 – ReadyMessage is queued, ready to be processed. HTTP equivalent: 201 – CREATED
202 – ProcessingMessage is being processed by Esendex. HTTP equivalent: 202 – ACCEPTED
400 – InvalidDIDThe number provided is invalid, wrong format, or it cannot send to the destination. HTTP equivalent: 400 – BAD REQUEST
401 – InvalidLicenseKeyThe provided license key is invalid. HTTP equivalent: 401 – UNAUTHORIZED
402 – AccountSuspendedThe account has been suspended. HTTP equivalent: 402 – PAYMENT REQUIRED
403 – StopOnPhoneNumberNo messages can be sent to the destination phone number from the license key. HTTP equivalent: 403 – FORBIDDEN
404 – MissingDIDOrInvalidMessageIDProper number could not be established or MessageID provided is invalid. HTTP equivalent: 404 – NOT FOUND
405 – InvalidDateTimeScheduledDateTime not in UTC. HTTP equivalent: 405 – METHOD NOT ALLOWED
406 – InvalidDestinationDestination phone number invalid. HTTP equivalent: 406 – NOT ACCEPTABLE
411 – NoMessageNo message body provided. HTTP equivalent: 411 – LENGTH REQUIRED
413 – MessageExceedsLimitMessage is too long. HTTP equivalent: 413 – PAYLOAD TOO LARGE
506 – FailedMessage failed to submit to provider.
507 – CancelledMessage cancelled.
508 – FailedByProviderMessage submitted to provider but failed by delivery receipt.

MMSDeliveryReceiptPostback

Esendex will send you a Delivery Receipt postback whenever the status of a message changes.

Type Properties

Property NameDescriptionData TypeSample
DeliveryReceiptLook for this value to identify a Delivery Receipt postback. If present, the value is always 1.Int1
MessageIDThe initial MessageID from your outgoing MMS.Stringf880e00b-3a14-484c-80e7-ca6aa29a2f7a
ReferenceIDThe ReferenceID from your outgoing request, if you specified one.String
FromPhoneNumberThe number that sent your outgoing message.String55555
ToPhoneNumberThe number you sent the message to.String7572373369
DeliveryReceiptMessageThe delivery receipt.StringDeliveredToDevice
CodeThe status code of the delivery receipt.DeliveryReceiptCode000

MMSResponsePostback

Esendex will send you an MMS Response postback whenever we receive an incoming MMS message.

Type Properties

Property NameDescriptionData TypeSample
MMSResponseLook for this value to identify an MMS Response postback. If present, the value is always 1.Int1
MessageIDA unique identifier for this response.String9a35e913-ded0-7574-4642-5f60c550c706
MatchedMessageIDA unique identifier that is populated when the response matches a previous message. An empty identifier (00000000-0000-0000-0000-00000000000) indicates that no previous message was matched.Stringb1aa2a38-d0f8-407f-b76d-635ea818b62d
ReferenceIDThis is populated if the response matches a previous message and you set the ReferenceID field in your outgoing MMS.String123
FromPhoneNumberThe number that sent the response text message.String7575550000
ToPhoneNumberThe number belonging to you that received the text message.String7575449511
ResponseReceiveDateThe UTC date when the message came in.String5%2f8%2f2023+2%3a42%3a36+AM
MessageThe response text message body.StringHello.

MMSSentPostback

Esendex will send you an MMS Sent postback after we send one of your MMS messages to the aggregator for delivery.

Type Properties

Property NameDescriptionData TypeSample
MMSSentLook for this value to identify an MMS Sent postback. If present, the value is always 1.Int1
MessageIDThe initial MessageID from your outgoing MMS.String9a35e913-ded0-7574-4642-5f60c550c706
ReferenceIDThe ReferenceID from your outgoing request, if you specified one.String12345
FromPhoneNumberThe number that sent your outgoing message.String7575550000
ToPhoneNumberThe number you sent the message to.String7575449511
SentTimeThe UTC date when the message got sent out.String5%2f8%2f2023+2%3a42%3a36+AM

OutgoingMessageResponse

This response is returned by the SendMessage and ReadMessageStatus methods.

Type Properties

Property NameDescriptionData TypeSample
AttachmentsComma-separated list of Media IDs for the message’s attachments.String10000001,10000005
FromNumber used to send the message.String7575550000
MessageIDUnique ID of the message.GUID1627aea5-8e0a-4371-9022-9b504344e724
MessageStatusStatus of the message.MessageStatusReady
SentTimeUTC date/time the message was sent.DateTime\/Date(1682439497785)\/
ToRecipient number.String7575559999

PostbackSettingsResponse

This response is returned by the GetPostbackSettingsForLicenseKey and GetPostbackSettingsForPhoneNumber methods.

Type Properties

Property NameDescriptionData TypeSample
CountryOrigin country for number.StringUS
PhoneNumberNumber being checked for postback URL settings.String7575550000
PostbackEnabledIndicates whether the postback URL is enabled on the number.BooleanTrue
PostbackTypeIndicates whether the postback URL is used for incoming messages, outgoing messages, or delivery receipts.ValueDescription0 – AllPostback URL is used for all messages.1 – DeliveryReceiptPostback URL is used for delivery receipts.2 – IncomingMessagePostback URL is used for incoming messages.3 – OutgoingMessagePostback URL is used for outgoing messages.Enum0 – All
PostbackUrlThe URL being used for postbacks.Stringhttp://www.esendex.us/postback.aspx
ReturnCodeIndicates whether an error occurred due to the data in the request.ValueDescription0 – NoErrorThe request was successful.1 – InvalidLicenseKey2 – InvalidUrl3 – InvalidPhoneNumber4 – InvalidPostbackType5 – NotFound6 – InvalidCountryEnum0 – NoError

RemoveKeywordResponse

This response is returned by the RemoveKeyword method.

Type Properties

Property NameDescriptionData TypeSample
ReturnCodeReturn code for the operation. This is always 0 - NoError.EnumNoError
SMSKeywordOne or more keyword responses.Array of KeywordResponseInfo objects

SMSDeliveryReceiptPostback

Esendex will send you a Delivery Receipt postback whenever the status of a message changes.

Type Properties

Property NameDescriptionData TypeSample
DeliveryReceiptLook for this value to identify a Delivery Receipt postback. If present, the value is always 1.Int1
MessageIDThe initial MessageID from your outgoing MMS.Stringf880e00b-3a14-484c-80e7-ca6aa29a2f7a
ReferenceIDThe ReferenceID from your outgoing request, if you specified one.String
FromPhoneNumberThe number that sent your outgoing message.String55555
ToPhoneNumberThe number you sent the message to.String7572373369
DeliveryReceiptMessageThe delivery receipt. The format will vary depending on the carrier.Stringid:1111111111 sub:001 dlvrd:001 submit date:2306132307 done date:2306132307 stat:enroute err:000 text:short message
CodeThe status code of the delivery receipt.DeliveryReceiptCode003
BackupMessageIDThis is the new MessageID of a backup DID message being sent when a short code message fails. This parameter is only present when a short code message is being sent via a DID as a backup.String

SMSIncomingMessage

This type is part of the data returned by the GetUnreadIncomingMessages method.

Type Properties

Property NameDescriptionData TypeSample
FromPhoneNumberPhone number that sent the incoming message.String7575550000
IncomingMessageIDUnique ID for the incoming message.Guid1835fecd-8402-4b02-91a4-5f4f9e036fe6
MatchedMessageIDUnique ID that matches the outgoing MessageID that this message is in response to.Guid1627aea5-8e0a-4371-9022-9b504344e724
MessageContent of the incoming message.StringHi, thanks for the message.
ResponseReceiveDateUTC date/time when the message was received.DateTime\/Date(1682439497785)\/
ToPhoneNumberDestination phone number of the incoming message.String7575551111

SMSRequest

This data type specifies the options for an outgoing SMS message. It is passed to the AdvancedSMSSend method.

Type Properties

Property NameDescriptionData TypeSample
AssignedDIDNumber to send the message from. (Contact Esendex to add a number to your account.)String7575550000
MessageText content for the message.StringThis is a sample message.
PhoneNumbersOne or more recipient numbers.Array of String values7575559999
ReferenceIDCustom ID of your choice. You can use this ID to filter incoming messages when you read them.String123
ScheduledDateTimeUTC date/time when message will send.DateTime\/Date(1682439497785)\/
StatusPostBackURLURL to send postbacks to.Stringhttp://www.example.com/postback.aspx

SMSResponse

This response is returned by the SimpleSMSSendSimpleSMSSendWithPostbackAdvancedSMSSendGetMessageStatus, and GetMessageStatusByReferenceID methods.

Type Properties

Property NameDescriptionData TypeSample
CancelledWhether the SMS message has been cancelled.BooleanFalse
MessageIDUnique ID for every SMS message sent.Guid1627aea5-8e0a-4371-9022-9b504344e724
QueuedWhether the SMS message has been queued by the aggregator.BooleanTrue
ReferenceIDUnique ID that can be set using the AdvancedSMSSend method.String123
SMSErrorIndicates whether there was an error sending the SMS message.ValueDescription0 – NoErrorThe request was successful.1 – STOPfromPhoneNumber2 – LicenseKeyInvalid3 – PhoneNumberInvalid4 – MessageInvalid5 – ScheduledDateTimeIsNotUTC6 – InvalidAssignedDID7 – NotFoundThe message ID is invalid.8 – InternalError9 – ContactEsendexAccountSuspended10 – AssignedDIDRequiredEnum0 – NoError
SMSIncomingMessagesReturns null when part of a Send response.NullNull
SentWhether the SMS message has been sent to the carrier.BooleanFalse
SentDateTimeUTC date/time when the message was sent.DateTime/Date(928164000000-0400)/

SMSResponsePostback

Esendex will send you an SMS Response postback whenever we receive an incoming SMS message.

Type Properties

Property NameDescriptionData TypeSample
SMSResponseLook for this value to identify an SMS Response postback. If present, the value is always 1.Int1
MessageIDA unique identifier for this response.String9a35e913-ded0-7574-4642-5f60c550c706
MatchedMessageIDA unique identifier that is populated when the response matches a previous message. An empty identifier (00000000-0000-0000-0000-00000000000) indicates that no previous message was matched.Stringb1aa2a38-d0f8-407f-b76d-635ea818b62d
ReferenceIDThis is populated if the response matches a previous message and you set the ReferenceID field in your outgoing SMS.String123
FromPhoneNumberThe number that sent the response text message.String7575550000
ToPhoneNumberThe number belonging to you that received the text message.String7575449511
ResponseReceiveDateThe UTC date when the message came in.String5%2f8%2f2023+2%3a42%3a36+AM
MessageThe response text message body.StringHello.

SMSSentPostback

Esendex will send you an SMS Sent postback after we send one of your SMS messages to the aggregator for delivery.

Type Properties

Property NameDescriptionData TypeSample
SMSSentLook for this value to identify an SMS Sent postback. If present, the value is always 1.Int1
MessageIDThe initial MessageID from your outgoing SMS.String9a35e913-ded0-7574-4642-5f60c550c706
ReferenceIDThe ReferenceID from your outgoing request, if you specified one.String12345
FromPhoneNumberThe number that sent your outgoing message.String7575550000
ToPhoneNumberThe number you sent the message to.String7575449511
SentTimeThe UTC date when the message got sent out.String5%2f8%2f2023+2%3a42%3a36+AM

SetPostbackEnabledForLicenseKeyResponse

This response is returned by the SetPostbackEnabledForLicenseKey method.

Type Properties

Property NameDescriptionData TypeSample
CountryOrigin country for number.StringUS
PhoneNumberNumber being checked for postback URL settings.String7575550000
PostbackEnabledIndicates whether the postback URL is enabled on number.BooleanTrue
PostbackTypeIndicates whether the postback URL is used for incoming messages, outgoing messages, or delivery receipts.ValueDescription0 – AllPostback URL is used for all messages.1 – DeliveryReceiptPostback URL is used for delivery receipts.2 – IncomingMessagePostback URL is used for incoming messages.3 – OutgoingMessagePostback URL is used for outgoing messages.Enum0 – All
PostbackUrlThe URL to use for postbacks.Stringhttp://www.esendex.us/postback.aspx
ReturnCodeIndicates whether an error occurred due to the data in the request.ValueDescription0 – NoErrorThe request was successful.1 – InvalidLicenseKey2 – InvalidUrl3 – InvalidPhoneNumber4 – InvalidPostbackType5 – NotFound6 – InvalidCountryEnum0 – NoError

SystemKeywordResponses

This response is returned by the GetSystemKeywordResponses method.

Type Properties

Property NameDescriptionData TypeSample
HelpContent sent in response to the HELP keyword.StringTesting: SMS Notifications. Text STOP to end. Msg&Data Rates may apply. info@example.com
ResumeContent sent in response to the RESUME keyword.StringWelcome to Testing. Reply STOP to cancel. Reply HELP for help. Msg&Data rates may apply. Msg freq per acct setup. info@example.com
StopContent sent in response to the STOP keyword.StringTesting: You have opted out and will no longer receive messages from this service. Reply RESUME to subscribe. info@example.com

UnsubscribedNumber

This response is returned by the GetUnsubscribedNumbers method.

Type Properties

Property NameDescriptionData TypeSample
EntryDateUTC date/time recipient unsubscribed from the campaign.DateTime\/Date(1682439497785)\/
PhoneNumberPhone number removed from the recipient list.String7575559999

UnsubscribedNumberResult

This response is returned by the AddUnsubscribedNumbers and RemoveUnsubscribedNumbers methods.

Type Properties

Property NameDescriptionData TypeSample
PhoneNumberPhone number to remove from the recipient list.String7575559999
ErrorDescription of the unsubscription error.StringInvalid Phone Number
IsSuccessWhether the operation succeeded.BooleanFalse

Let’s start sending, together.