How to Send Your First SMS With GatewayAPI and cURL

Back to all posts
How to Send Your First SMS With GatewayAPI and cURL

In this blog post, we will guide you through the process of sending SMS messages using GatewayAPI and cURL. This guide is perfect for those who are new to API usage or just want to learn how to effectively communicate with your users or customers via SMS.

SMS messaging offers an effective and direct communication channel that can be used for everything from marketing and critical alerts to daily notifications. With a high delivery and open rate, SMS ensures that your message reaches your target audience and is actually seen.

Preparation

Before you start, you need access to the GatewayAPI dashboard. Here you can find the necessary cURL code sample that we will use. The code sample from your dashboard will contain your unique API token.

This example shows how you can send a simple “Hello World” SMS to a phone number. 

Let’s break it down into the individual steps.

Step 1: Select and copy the cURL code sample

Select and copy the code example into your preferred editor to start the deployment process. 

Step 2: Customize the code sample

When you paste the code sample into your editor, there are a few changes you can make to customize the SMS:

  • Sender ID: In the sender field, you can change the text to a name or title that will appear as the sender. Keep in mind that you can use 11 characters or less and that it cannot contain special characters.
  • The message: Within the quotation marks you can write your own message text. Initially, we recommend avoiding special characters. However, you can experiment with these later when you are more familiar with the system. Note that if you want to include links in the message, these must be whitelisted before sending.
  • Recipient: In the recipients section, replace the example with the phone number you want to send the SMS to. Remember to include the country code first (no plus sign or zero).

Step 3: Send your message

After making the necessary changes, you are now ready to send your SMS. Paste the customized command into your terminal and press “Enter”. You will now get a confirmation in the terminal that your message has been sent and the costs associated with the sending.

Do you need additional features or help?

In addition to this blog post, you can also watch our instructional video that guides you through the entire process of sending SMS messages using cURL and GatewayAPI. 

On our YouTube channel you can also find a wealth of instructional videos to help you get the most out of GatewayAPI. If you need additional features, troubleshooting help, information about error codes, etc. you can go to our documentation where you can find everything you need.

Three fun facts about cURL

  1. cURL (Client URL) was first released in 1996 by Daniel Stenberg. It started as a small project to retrieve exchange rates for an IRC bot. Today, it is one of the most widely used open-source tools in the world and is included in virtually every major operating system.
  2. Did you know that cURL is built into many modern cars? It is used in infotainment systems and other integrated software solutions that require data exchange. 
  3. cURL has an impressive ability to retrieve data – everything from simple files to complex API responses. For example, you can use cURL to retrieve random images from the web. Perfect for a little break in your workday!
2025_02_07-GatewayAPI-Blogpost-how_to_send_sms_with_curl-Celebrate@2x

There you go!

Congratulations! You have now sent your first SMS via GatewayAPI using cURL. This is just the beginning and there are many opportunities to integrate SMS functionality into your applications or services to optimize communication with your users.

global_sms_gatewayapi-2023-1200x628px@2x

Global SMS gateway

GatewayAPI has some of the lowest prices in most of the world combined with an intuitive user interface, world-class support and a solid uptime of over 99.99% on average. If you don’t have an account yet, you can create a free account in under two minutes here: Go to GatewayAPI or write to sales@gatewayapi.com.