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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| Attachments | Attachments 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 values | True, when sending a message without a Body. | 17772, https://esendexusa.com/img/docs/example.jpg |
| Body | Text content for the message. | String | True, when sending a message without Attachments. | This is a sample message. |
| Concatenate | The 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. | Boolean | False | True |
| From | Number to send the message from. If unspecified, one of your numbers will be chosen automatically. (Contact Esendex to add a number to your account.) | String | False | 7575550000 |
| IsUnicode | Whether the message should be sent using Unicode encoding. Note that all MMS messages support Unicode. | Boolean | False | True |
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| PostbackUrl | URL to send postbacks to. | String | False | http://www.example.com/postback.aspx |
| ReferenceID | Custom ID of your choice. You can use this ID to filter incoming messages when you read them. | String | False | 123 |
| ScheduledDateTime | UTC date/time when message will send. Specified as milliseconds from the epoch of 1970-01-01T00:00:00Z. | DateTime | False | /Date(1682439497785)/ |
| Subject | Subject line for the message. | String | False | Messaging Test |
| To | Recipient number. | Array of String values | True | 7575559999 |
| UseMMS | Whether to send as an MMS message. MMS is required when sending attachments. | Boolean | True | True |
Response
Returns: Array of OutgoingMessageResponse objects
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| MessageID | Unique ID for message. | GUID | True | d73cd74b-8687-4701-8f03-f75b4d4d860d |
Response
Returns: OutgoingMessageResponse object
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| EndDate | UTC date/time of newest messages to read. Specified as milliseconds from the epoch of 1970-01-01T00:00:00Z. | DateTime | False | /Date(1682439497785)/ |
| IncomingMessageID | Unique ID of the incoming message. | GUID | False | 1627aea5-8e0a-4371-9022-9b504344e724 |
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| OutgoingMessageID | Unique ID of the outgoing message. | GUID | False | 1627aea5-8e0a-4371-9022-9b504344e724 |
| PageNumber | Number of the page to retrieve. | Int | False | 1 |
| PageSize | Number of incoming messages per page. | Int | False | 20 |
| ReferenceID | Unique ID that you assigned to the sent message. | String | False | 123 |
| StartDate | UTC date/time of oldest messages to read. Specified as milliseconds from the epoch of 1970-01-01T00:00:00Z. | DateTime | False | /Date(1682439497785)/ |
| UnreadMessagesOnly | Whether to retrieve all incoming messages or only incoming messages that are unread. | Boolean | False | false |
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.
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
Response
Returns: Boolean
Description: Whether the cancellation was successful or not.
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| MessageID | Unique ID of the message to cancel. | GUID | True | 1627aea5-8e0a-4371-9022-9b504344e724 |
Response
Returns: Boolean
Description: Whether the cancellation was successful or not.
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| PhoneNumbers | The phone numbers you want to unsubscribe. | Array of String values | True | 7575559999 |
Response
Returns: Array of UnsubscribedNumberResult objects
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
Response
Returns: Array of UnsubscribedNumber objects
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| PhoneNumbers | One or more phone numbers to resubscribe. | Array of String values | True | 7575559999 |
Response
Returns: Array of UnsubscribedNumberResult objects
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| Base64EncodedContent | Content of the media file to create. This is binary data that is encoded as a string of base-64 digits. | String | True | |
| FileName | Name of the media file to create. | String | True | MonkeyPic.jpg |
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| Tags | Category of the media file. | Array of String values | False | animal |
Response
Returns: MediaMetadata object
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| FileName | Name of the media file to create. | String | True | MonkeyPic.jpg |
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| Tags | Category of the media file. | Array of String values | False | animal |
| Url | Web location of the file to create. | String | True | https://esendexusa.com/img/docs/example.jpg |
Response
Returns: MediaMetadata object
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| MediaID | Unique ID of the media file. | Long | True | 12345678 |
Response
Returns: String
Sample:
iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAGdYAABnWARjRyu0AAAASSURBVBhXY3gro4IVDSkJGRUAmbtLQUb26xsAAAAASUVORK5CYII=
This method retrieves information about your media files.
Endpoint
POST:https://messaging.esendex.us/Messaging.svc/GetMediaInfo
Syntax
GetMediaInfo(Request)
Request Parameters
| Parameter Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| EndDate | UTC date/time of newest media to retrieve. | DateTime | False | /Date(1682439497785)/ |
| FilenamePattern | Name of the media. | String | False | Monkey.jpg |
| FileType | File type of the media. | String | False | .jpg |
| IncomingMessageId | Unique ID of the incoming message with the media. | GUID | False | 1627aea5-8e0a-4371-9022-9b504344e724 |
| LicenseKey | License key associated with the media. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| MaximumFileSize | Largest file size of the media. | Long | False | 97465 |
| MediaId | Unique ID of the media. | Long | False | 12345678 |
| MinimumFileSize | Smallest file size of the media. | Long | False | 97465 |
| OutgoingMessageID | Unique ID of the outgoing message with the media. | GUID | False | 1627aea5-8e0a-4371-9022-9b504344e724 |
| PageNumber | Number of the page to retrieve. | Int | False | 1 |
| PageSize | Number of media files per page. | Int | False | 10 |
| StartDate | UTC date/time of oldest media to retrieve. | DateTime | False | /Date(1682439497785)/ |
| Tags | Category of the media. | Array of String values | False | animal |
Response
Returns: MediaReply object
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| MediaID | Unique ID of the media file to remove. | Long | True | 12345678 |
Response
Returns: Boolean
Description: Whether the removal was successful or not. This will be true even when the media does not exist.
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| SMSKeywords | The keywords you want to add to the license key. | Array of KeywordRequestInfo objects | True |
Response
Returns: SMSKeywordResponse object
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
Response
Returns: GetKeywordsResponse object
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| Number | One of your numbers. | String | True | 7575550000 |
Response
Returns: SystemKeywordResponses object
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| SMSKeywords | One or more keyword requests. | Array of KeywordRequestInfo objects | True |
Response
Returns: RemoveKeywordResponse object
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
Response
Returns: Array of PostbackSettingsResponse objects
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| PhoneNumber | Number to check for postback settings. | String | True | 7575550000 |
| Country | Origin country for number. | String | True | US |
Response
Returns: Array of PostbackSettingsResponse objects
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| PostbackType | Indicates 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. | Enum | True | 0 – All |
| Enabled | Indicates whether the postback URL is enabled on the number. | Boolean | True | True |
Response
Returns: SetPostbackEnabledForLicenseKeyResponse object
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| PhoneNumber | Number for which to enable a postback URL. | String | True | 7575550000 |
| Country | Origin country of the number. | String | True | US |
| PostbackType | Indicates 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. | Enum | True | 0 – All |
| Enabled | Indicates whether the postback URL is enabled on the number. | Boolean | True | True |
Response
Returns: Enum
Sample:
0 – NoError
| Value | Description |
|---|---|
| 0 – NoError | The update was successful. |
| 1 – InvalidLicenseKey | The requested license key is invalid. |
| 2 – InvalidUrl | The requested URL is invalid. |
| 3 – InvalidPhoneNumber | The requested phone number is invalid. |
| 4 – InvalidPostbackType | The requested postback type is invalid. |
| 5 – NotFound | The requested resource was not found. |
| 6 – InvalidCountry | The requested country is invalid. |
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| PostbackType | Indicates 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. | Enum | True | 0 – All |
| Url | The URL that information will be posted to. | String | True | http://www.example.com/postback.aspx |
Response
Returns: Enum
Sample:
0 – NoError
| Value | Description |
|---|---|
| 0 – NoError | The update was successful. |
| 1 – InvalidLicenseKey | The requested license key is invalid. |
| 2 – InvalidUrl | The requested URL is invalid. |
| 3 – InvalidPhoneNumber | The requested phone number is invalid. |
| 4 – InvalidPostbackType | The requested postback type is invalid. |
| 5 – NotFound | The requested resource was not found. |
| 6 – InvalidCountry | The requested country is invalid. |
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 Name | Description | Data Type | Required | Sample Value |
|---|---|---|---|---|
| LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
| PhoneNumber | Number for which to enable a postback URL. | String | True | 7575550000 |
| Country | Origin country of the number. | String | True | US |
| PostbackType | Indicates 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. | Enum | True | 0 – All |
| Url | The URL that information will be posted to. | String | True | http://www.example.com/postback.aspx |
Response
Returns: Enum
Sample:
0 – NoError
| Value | Description |
|---|---|
| 0 – NoError | The update was successful. |
| 1 – InvalidLicenseKey | The requested license key is invalid. |
| 2 – InvalidUrl | The requested URL is invalid. |
| 3 – InvalidPhoneNumber | The requested phone number is invalid. |
| 4 – InvalidPostbackType | The requested postback type is invalid. |
| 5 – NotFound | The requested resource was not found. |
| 6 – InvalidCountry | The requested country is invalid. |
Indicates the status of an outgoing message. This value is included in the SMSDeliveryReceiptPostback and MMSDeliveryReceiptPostback types.
Type: Enum
Possible Values
| Value | Description |
|---|---|
| 000 – DeliveredToDevice | The message was delivered to the recipient. |
| 003 – DeliveredToCarrier | The message was delivered to the carrier. |
| 004 – Accepted | The carrier accepted the message. |
| 005 – UndelivOrDeleted | The 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 – Expired | The message expired at the carrier. |
| 023 – Rejected | The carrier rejected the message. |
| 028 – SenderExceededCarrierThrottle | The message sender has exceeded the carrier’s maximum rate. |
| 029 – RecipientExceededCarrierThrottle | The message recipient has exceeded the carrier’s maximum rate. |
| 030 – SenderAndRecipentExceededCarrierThrottle | The message sender and recipient have exceeded the carrier’s maximum rate. |
| 032 – InvalidMessageFormatOrTextMsgContentSizeExceeded | The message is invalidly formatted or too large. |
| 090 – BadAddress | The destination number is not a valid number, so the carrier rejected the message. |
| 091 – InvalidRouting | The carrier has not approved or provisioned the sending number. |
| 999 – CarrierErrorUnknown | The carrier failed to send the message for an unknown reason. |
This response is returned by the GetKeywords method.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| ReturnCode | Return code for the operation. This is always 0 - NoError. | Enum | 0 – NoError |
| SMSKeyword | All of the custom keywords assigned to the license key. | Array of KeywordResponseInfo objects |
This response is returned by the ReadIncomingMessages method.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| Attachments | Media IDs for the message’s attachments. | Array of Long values | 10000001,10000005 |
| From | Number used to send the message. | String | 7575550000 |
| IncomingMessageID | Unique ID of the incoming message. | GUID | 1627aea5-8e0a-4371-9022-9b504344e724 |
| OutgoingMessageID | Unique ID of the outgoing message. | GUID | 1627aea5-8e0a-4371-9022-9b504344e724 |
| Payload | Incoming message content. | String | Thank you for your message. |
| ReceivedDate | UTC date/time when the incoming message was received. | DateTime | /Date(1682439497785)/ |
| Subject | Subject of the incoming message. | String | Reply |
| To | Recipient number. | String | 7575559999 |
| Udh | Header that shows the number of concatenated messages in their correct order. | Array of Byte values | 81,109,70,122,90,83,65,50,78,67,66,84,100 |
This type is included in the GetKeywordsResponse, RemoveKeywordResponse, and SMSKeywordResponse types.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| EntryDate | UTC date/time when keyword was added. | DateTime | /Date(1682439497785)/ |
| Keyword | Keyword value. | String | Keyword27 |
| ReturnCode | Return 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 – InternalError | Enum | 0 – NoError |
| ShortCode | Short code that this keyword is assigned to. | String | 10101 |
This type is returned by the CreateMediaFromContent and CreateMediaFromUrl methods. It is also included in the MediaReply type.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| FileDate | UTC date/time when the media was created. | DateTime | /Date(1682439497785)/ |
| FileName | Name of the media file. | String | MonkeyPic.jpg |
| FileSize | Size of the media file, in bytes. | Long | 97465 |
| MediaId | Unique ID of the media file. | Long | 12345678 |
| MimeType | Media type (MIME type) of the file. | String | image/jpeg |
| Tags | Category of the media file. | Array of String values | Monkey, Animal |
This value is included in the OutgoingMessageResponse type.
Type: Enum
Possible Values
| Value | Description |
|---|---|
| 0 – Hold | Message is on hold and will not be processed until set to ‘Ready’. |
| 200 – Sent | Message sent successfully. HTTP equivalent: 200 – OK |
| 201 – Ready | Message is queued, ready to be processed. HTTP equivalent: 201 – CREATED |
| 202 – Processing | Message is being processed by Esendex. HTTP equivalent: 202 – ACCEPTED |
| 400 – InvalidDID | The number provided is invalid, wrong format, or it cannot send to the destination. HTTP equivalent: 400 – BAD REQUEST |
| 401 – InvalidLicenseKey | The provided license key is invalid. HTTP equivalent: 401 – UNAUTHORIZED |
| 402 – AccountSuspended | The account has been suspended. HTTP equivalent: 402 – PAYMENT REQUIRED |
| 403 – StopOnPhoneNumber | No messages can be sent to the destination phone number from the license key. HTTP equivalent: 403 – FORBIDDEN |
| 404 – MissingDIDOrInvalidMessageID | Proper number could not be established or MessageID provided is invalid. HTTP equivalent: 404 – NOT FOUND |
| 405 – InvalidDateTime | ScheduledDateTime not in UTC. HTTP equivalent: 405 – METHOD NOT ALLOWED |
| 406 – InvalidDestination | Destination phone number invalid. HTTP equivalent: 406 – NOT ACCEPTABLE |
| 411 – NoMessage | No message body provided. HTTP equivalent: 411 – LENGTH REQUIRED |
| 413 – MessageExceedsLimit | Message is too long. HTTP equivalent: 413 – PAYLOAD TOO LARGE |
| 506 – Failed | Message failed to submit to provider. |
| 507 – Cancelled | Message cancelled. |
| 508 – FailedByProvider | Message submitted to provider but failed by delivery receipt. |
Esendex will send you a Delivery Receipt postback whenever the status of a message changes.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| DeliveryReceipt | Look for this value to identify a Delivery Receipt postback. If present, the value is always 1. | Int | 1 |
| MessageID | The initial MessageID from your outgoing MMS. | String | f880e00b-3a14-484c-80e7-ca6aa29a2f7a |
| ReferenceID | The ReferenceID from your outgoing request, if you specified one. | String | |
| FromPhoneNumber | The number that sent your outgoing message. | String | 55555 |
| ToPhoneNumber | The number you sent the message to. | String | 7572373369 |
| DeliveryReceiptMessage | The delivery receipt. | String | DeliveredToDevice |
| Code | The status code of the delivery receipt. | DeliveryReceiptCode | 000 |
Esendex will send you an MMS Response postback whenever we receive an incoming MMS message.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| MMSResponse | Look for this value to identify an MMS Response postback. If present, the value is always 1. | Int | 1 |
| MessageID | A unique identifier for this response. | String | 9a35e913-ded0-7574-4642-5f60c550c706 |
| MatchedMessageID | A 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. | String | b1aa2a38-d0f8-407f-b76d-635ea818b62d |
| ReferenceID | This is populated if the response matches a previous message and you set the ReferenceID field in your outgoing MMS. | String | 123 |
| FromPhoneNumber | The number that sent the response text message. | String | 7575550000 |
| ToPhoneNumber | The number belonging to you that received the text message. | String | 7575449511 |
| ResponseReceiveDate | The UTC date when the message came in. | String | 5%2f8%2f2023+2%3a42%3a36+AM |
| Message | The response text message body. | String | Hello. |
Esendex will send you an MMS Sent postback after we send one of your MMS messages to the aggregator for delivery.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| MMSSent | Look for this value to identify an MMS Sent postback. If present, the value is always 1. | Int | 1 |
| MessageID | The initial MessageID from your outgoing MMS. | String | 9a35e913-ded0-7574-4642-5f60c550c706 |
| ReferenceID | The ReferenceID from your outgoing request, if you specified one. | String | 12345 |
| FromPhoneNumber | The number that sent your outgoing message. | String | 7575550000 |
| ToPhoneNumber | The number you sent the message to. | String | 7575449511 |
| SentTime | The UTC date when the message got sent out. | String | 5%2f8%2f2023+2%3a42%3a36+AM |
This response is returned by the SendMessage and ReadMessageStatus methods.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| Attachments | Comma-separated list of Media IDs for the message’s attachments. | String | 10000001,10000005 |
| From | Number used to send the message. | String | 7575550000 |
| MessageID | Unique ID of the message. | GUID | 1627aea5-8e0a-4371-9022-9b504344e724 |
| MessageStatus | Status of the message. | MessageStatus | Ready |
| SentTime | UTC date/time the message was sent. | DateTime | /Date(1682439497785)/ |
| To | Recipient number. | String | 7575559999 |
This response is returned by the GetPostbackSettingsForLicenseKey and GetPostbackSettingsForPhoneNumber methods.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| Country | Origin country for number. | String | US |
| PhoneNumber | Number being checked for postback URL settings. | String | 7575550000 |
| PostbackEnabled | Indicates whether the postback URL is enabled on the number. | Boolean | True |
| PostbackType | Indicates 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. | Enum | 0 – All |
| PostbackUrl | The URL being used for postbacks. | String | http://www.esendex.us/postback.aspx |
| ReturnCode | Indicates whether an error occurred due to the data in the request.ValueDescription0 – NoErrorThe request was successful.1 – InvalidLicenseKey2 – InvalidUrl3 – InvalidPhoneNumber4 – InvalidPostbackType5 – NotFound6 – InvalidCountry | Enum | 0 – NoError |
This response is returned by the RemoveKeyword method.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| ReturnCode | Return code for the operation. This is always 0 - NoError. | Enum | NoError |
| SMSKeyword | One or more keyword responses. | Array of KeywordResponseInfo objects |
Esendex will send you a Delivery Receipt postback whenever the status of a message changes.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| DeliveryReceipt | Look for this value to identify a Delivery Receipt postback. If present, the value is always 1. | Int | 1 |
| MessageID | The initial MessageID from your outgoing MMS. | String | f880e00b-3a14-484c-80e7-ca6aa29a2f7a |
| ReferenceID | The ReferenceID from your outgoing request, if you specified one. | String | |
| FromPhoneNumber | The number that sent your outgoing message. | String | 55555 |
| ToPhoneNumber | The number you sent the message to. | String | 7572373369 |
| DeliveryReceiptMessage | The delivery receipt. The format will vary depending on the carrier. | String | id:1111111111 sub:001 dlvrd:001 submit date:2306132307 done date:2306132307 stat:enroute err:000 text:short message |
| Code | The status code of the delivery receipt. | DeliveryReceiptCode | 003 |
| BackupMessageID | This 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 |
This type is part of the data returned by the GetUnreadIncomingMessages method.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| FromPhoneNumber | Phone number that sent the incoming message. | String | 7575550000 |
| IncomingMessageID | Unique ID for the incoming message. | Guid | 1835fecd-8402-4b02-91a4-5f4f9e036fe6 |
| MatchedMessageID | Unique ID that matches the outgoing MessageID that this message is in response to. | Guid | 1627aea5-8e0a-4371-9022-9b504344e724 |
| Message | Content of the incoming message. | String | Hi, thanks for the message. |
| ResponseReceiveDate | UTC date/time when the message was received. | DateTime | /Date(1682439497785)/ |
| ToPhoneNumber | Destination phone number of the incoming message. | String | 7575551111 |
This data type specifies the options for an outgoing SMS message. It is passed to the AdvancedSMSSend method.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| AssignedDID | Number to send the message from. (Contact Esendex to add a number to your account.) | String | 7575550000 |
| Message | Text content for the message. | String | This is a sample message. |
| PhoneNumbers | One or more recipient numbers. | Array of String values | 7575559999 |
| ReferenceID | Custom ID of your choice. You can use this ID to filter incoming messages when you read them. | String | 123 |
| ScheduledDateTime | UTC date/time when message will send. | DateTime | /Date(1682439497785)/ |
| StatusPostBackURL | URL to send postbacks to. | String | http://www.example.com/postback.aspx |
This response is returned by the SimpleSMSSend, SimpleSMSSendWithPostback, AdvancedSMSSend, GetMessageStatus, and GetMessageStatusByReferenceID methods.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| Cancelled | Whether the SMS message has been cancelled. | Boolean | False |
| MessageID | Unique ID for every SMS message sent. | Guid | 1627aea5-8e0a-4371-9022-9b504344e724 |
| Queued | Whether the SMS message has been queued by the aggregator. | Boolean | True |
| ReferenceID | Unique ID that can be set using the AdvancedSMSSend method. | String | 123 |
| SMSError | Indicates 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 – AssignedDIDRequired | Enum | 0 – NoError |
| SMSIncomingMessages | Returns null when part of a Send response. | Null | Null |
| Sent | Whether the SMS message has been sent to the carrier. | Boolean | False |
| SentDateTime | UTC date/time when the message was sent. | DateTime | /Date(928164000000-0400)/ |
Esendex will send you an SMS Response postback whenever we receive an incoming SMS message.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| SMSResponse | Look for this value to identify an SMS Response postback. If present, the value is always 1. | Int | 1 |
| MessageID | A unique identifier for this response. | String | 9a35e913-ded0-7574-4642-5f60c550c706 |
| MatchedMessageID | A 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. | String | b1aa2a38-d0f8-407f-b76d-635ea818b62d |
| ReferenceID | This is populated if the response matches a previous message and you set the ReferenceID field in your outgoing SMS. | String | 123 |
| FromPhoneNumber | The number that sent the response text message. | String | 7575550000 |
| ToPhoneNumber | The number belonging to you that received the text message. | String | 7575449511 |
| ResponseReceiveDate | The UTC date when the message came in. | String | 5%2f8%2f2023+2%3a42%3a36+AM |
| Message | The response text message body. | String | Hello. |
Esendex will send you an SMS Sent postback after we send one of your SMS messages to the aggregator for delivery.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| SMSSent | Look for this value to identify an SMS Sent postback. If present, the value is always 1. | Int | 1 |
| MessageID | The initial MessageID from your outgoing SMS. | String | 9a35e913-ded0-7574-4642-5f60c550c706 |
| ReferenceID | The ReferenceID from your outgoing request, if you specified one. | String | 12345 |
| FromPhoneNumber | The number that sent your outgoing message. | String | 7575550000 |
| ToPhoneNumber | The number you sent the message to. | String | 7575449511 |
| SentTime | The UTC date when the message got sent out. | String | 5%2f8%2f2023+2%3a42%3a36+AM |
This response is returned by the SetPostbackEnabledForLicenseKey method.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| Country | Origin country for number. | String | US |
| PhoneNumber | Number being checked for postback URL settings. | String | 7575550000 |
| PostbackEnabled | Indicates whether the postback URL is enabled on number. | Boolean | True |
| PostbackType | Indicates 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. | Enum | 0 – All |
| PostbackUrl | The URL to use for postbacks. | String | http://www.esendex.us/postback.aspx |
| ReturnCode | Indicates whether an error occurred due to the data in the request.ValueDescription0 – NoErrorThe request was successful.1 – InvalidLicenseKey2 – InvalidUrl3 – InvalidPhoneNumber4 – InvalidPostbackType5 – NotFound6 – InvalidCountry | Enum | 0 – NoError |
This response is returned by the GetSystemKeywordResponses method.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| Help | Content sent in response to the HELP keyword. | String | Testing: SMS Notifications. Text STOP to end. Msg&Data Rates may apply. [email protected] |
| Resume | Content sent in response to the RESUME keyword. | String | Welcome to Testing. Reply STOP to cancel. Reply HELP for help. Msg&Data rates may apply. Msg freq per acct setup. [email protected] |
| Stop | Content sent in response to the STOP keyword. | String | Testing: You have opted out and will no longer receive messages from this service. Reply RESUME to subscribe. [email protected] |
This response is returned by the GetUnsubscribedNumbers method.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| EntryDate | UTC date/time recipient unsubscribed from the campaign. | DateTime | /Date(1682439497785)/ |
| PhoneNumber | Phone number removed from the recipient list. | String | 7575559999 |
This response is returned by the AddUnsubscribedNumbers and RemoveUnsubscribedNumbers methods.
Type Properties
| Property Name | Description | Data Type | Sample |
|---|---|---|---|
| PhoneNumber | Phone number to remove from the recipient list. | String | 7575559999 |
| Error | Description of the unsubscription error. | String | Invalid Phone Number |
| IsSuccess | Whether the operation succeeded. | Boolean | False |