Getting Started Sending SMS
Developers are encouraged to view the Quick Starts, including screencasts, on Github: See Sending your first SMS.
Vonage's RESTful API connects you to carriers in over 200 countries around the world. It's easy to use and takes just minutes to connect.
Before You Begin
You will need:
- A Vonage API account.
- API key and your API secret from the Vonage API account dashboard.
- The phone number you registered with, will act as the destination number. Note: While your account is in trial mode, you will only be able to send test messages to a maximum of 5 test numbers that you have verified on your own.
- Sender ID, which is the From information that will appear on the recipient’s handset. For US and Canadian destinations this must be a pre-approved phone number, which we will have provided you automatically when you sign up. SMS Features Overview (Outbound) will provide more information on the Sender ID restrictions per the Country regulations.
Format your Destination Number
Make sure you format your mobile number correctly, with the country code and without spaces or plus signs or leading zeros. Here is an example of how a number should be formatted:
This is the format for any destination number that will receive SMS from your application, both local and international. Be sure to verify local carrier restrictions for any messages you would like to send by reviewing our Country-Specific Features and Restrictions articles.
Prepare your Message
Now it’s time to compose your message body. For your first message, we suggest you send plain text. Note that until you have made your first top-up we will include [FREE SMS DEMO, TEST MESSAGE] in your SMS.
As with all parameters, your message body must always be URL encoded. For type=unicode message body should be also UTF8 encoded (URL and UTF8). Simply plug your message body into this website to format it properly: http://www.string-functions.com/urlencode.aspx.
Put It All Together
Now, copy the below link, paste it into the address bar of your favorite web browser, and replace values with your actual API key, API secret, Sender ID, destination number, and message body into this URL. Upon hitting Enter you should receive a text almost immediately.
Congratulations! You've just sent your first text using the Vonage API.
- Use scripts to send large volumes of messages from your server using pre-built libraries.
- Set up your Webhook URL and your API Settings in your Vonage API account dashboard to receive delivery receipts.
- Receive inbound messages using a Vonage long virtual number.
- Check out projects such as Voice API, Verify, or Number Insight.
Article is closed for comments.