Sending a Message
Sending a Message
Sending your first message to the SMSC is very easy. You can interact with the SMSC HTTP API by sending it an HTTP POST or GET request.
API Endpoint
The endpoint for the API is:
https://smsc.txtnation.com:8093/sms/send_sms.php
The HTTP GET or POST variables you need to send us are as follows:
Variable | Type | Contents |
---|---|---|
|
String |
The MSISDN to which you are sending the message. This should be in full international format without leading zeros or + sign. |
|
String |
The message that you want to send as the contents of the SMS. |
|
String |
The sender ID for the message you are sending. Your SMS will appear to have been sent from this number on the handset. |
|
Integer |
The delivery notification flag should be set to |
|
Integer |
The type of message that is being sent:
|
|
String |
The username that you decided on during sign up to the SMSC. |
|
String |
The password that you choose during sign up to the SMSC. |
Server Replies
When you have sent the message via HTTP the receiving server will reply with an acknowledgement of the request in the same HTTP session. If the operation was a success, you will receive a message like the following:
Operation success: 6019287381992219
The number returned here should be recorded to match up any subsequent delivery reports.
If the operation was not successful we will reply with an error message detailing why the SMS could not be sent. For example, Operation fail: Route Error
would be returned if the message could not be routed.
Request Throttling
By default, requests from each account are throttled on a requests-per-second basis. If you exceed this limit at any time you will receive an UNDELIVERABLE
error, followed by a numeric code that indicates which throttle has been exceeded.
Error code | Description |
---|---|
|
Charging failure. Make sure that you have enough credits to send all the messages! |
|
The upstream SMPP throttle was exceeded. |
|
The internal throttle limit was exceeded. |
|
Unspecified throttling error. |
Retrying Messages
When sending messages to our SMSC API gateway, you may experience unsuccessful submissions with statuses according to the above or general service or platform errors. These should be logged and, where possible, associated with the correct outbound MT SMS message.
In certain cases you may be able to retry the message but this will often depend on the agreements with the operators in a given country.