In this section, you will learn how to configure your application and establish a connection with the SMPP API.
Note your Account SID and Auth Token, as you will need them in future steps.
Contact your dedicated Account Manager to express interest in the SMPP API.
Set up an SMPP dedicated Account SID in the Console.
Complete the questionnaire:
Receive your credentials: Twilio provides you with the necessary credentials and an integration guide. The information will come via a secure email. Only the "technical contact" specified in the onboarding questionnaire will be able to complete the secure email flow.
Your SMPP API credentials will be provided in the following format (note that the values shown below are examples):
ACXXXXXXXXXXXXXXXX
user123456789123
A1b2C3d4
https://smpp-mo.twilio.com/mo-groups/{YMXXXXXXXX}
5
(default value)20
(default value)Once you've obtained your credentials, you can start using them to establish connection between your client and the SMSC and begin sending messages.
Next, you need to obtain and set up your phone numbers for sending and receiving messages in the Twilio Console. This process involves two steps:
https://smpp-mo.twilio.com/mo-groups/{MO Routing SID}
) where you want to receive incoming messages.POST
from the dropdown menu.POST
request to the IncomingPhoneNumber resource associated with that number. To complete this request, you will need the following information:
Here is an example of how to configure your Twilio phone number to receive incoming messages via the API:
1curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json \2--data-urlencode "SmsUrl=http://www.mysite.com/twilio" \3-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
Navigate to the ShortCode resource page to learn how to configure short code phone numbers to receive incoming messages.
To establish a TCP socket with Twilio, send a request to their Fully Qualified Domain Name (FQDN) via an encrypted port. Ensure you're using TLS version 1.2 or higher from one of the IP addresses allowlisted during onboarding.
During the TLS handshake, public and private keys are exchanged, and Twilio's SMPP service certificate is presented for validation.
Once completed, you'll initiate an SMPP session by issuing a bind_sm
command PDU to establish a persistent connection, enabling the sending of outbound messages and the receiving of inbound messages and delivery receipts.
To connect your client with the SMPP API, please refer to the table below for the required SMPP settings configuration.
Settings | Values | Description |
---|---|---|
Twilio Host | *************** | Twilio SMPP API domain name. This will be provided with your initial onboarding email that also includes your system_id and password . |
Twilio Port | **** | Twilio SMPP API port. This will be provided with your initial onboarding email that also includes your system_id and password . |
SMPP version | 3.4 | SMPP protocol version used by the Twilio SMPP API. |
system_id | Example: 12A34b56C78d91E | A 15 Character long System ID string provided by your Twilio account manager. |
password | Example: i0oLw3pa | A 8 Character long password for your Twilio SMPP account provided by your Twilio account manager. |
Security | TLS v.1.2 and above | Connection encryption protocol. |
If you experience any errors during the initial connection process, please reply to the email where you received your SMPP credentials. Alternatively, you can contact us by opening a new support ticket at help.sms@twilio.com.
If Twilio rejects a bind request during an initial bind attempt, the command_status
field of the bind requests response will be used to communicate an error message.
Twilio SMPP API doesn't send non-SMPP specification errors on bind requests. For a list of errors and brief descriptions, please visit the SMPP Error Codes page.