Documentation Index
Fetch the complete documentation index at: https://plivo.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
- Node
- Ruby
- Python
- PHP
- .NET
- Java
- Go
Overview
This guide shows how to send an SMS text message to any phone number. Businesses send text messages to notify customers about recent information, send alerts, and provide delivery status updates, among other use cases.You can start sending SMS messages either by using our PHLO visual workflow builder or our APIs. Follow the instructions in one of the tabs below.- Using API
Here’s how to use Plivo APIs to send outbound SMS text messages.
Replace the auth placeholders with your authentication credentials from the Plivo console. Replace the phone number placeholders with actual phone numbers in E.164 format (for example, +12025551234). In countries other than the US and Canada you can use a sender ID for the message source. You must have a Plivo phone number to send messages to the US or Canada; you can buy a Plivo number from Phone Numbers > Buy Numbers on the Plivo console or via the Numbers API.
How it works

Prerequisites
To get started, you need a Plivo account — sign up with your work email address if you don’t have one already. If this is your first time using Plivo APIs, follow our instructions to set up a Node.js development environment.Create the send SMS application
Create a file calledsend_sms.js and paste into it this code.var plivo = require('plivo');
(function main() {
'use strict';
var client = new plivo.Client("<auth_id>", "<auth_token>");
client.messages.create(
{
src: "<sender_id>",
dst: "<destination_number>",
text: "Hello, from Node.js!",
}
).then(function (response) {
console.log(response);
});
})();
Note:
We recommend that you store your credentials in the
auth_id and auth_token environment variables to avoid the possibility of accidentally committing them to source control. If you do this, you can initialize the client with no arguments and Plivo will automatically fetch the values from the environment variables. You can use process.env to store environment variables and fetch them when initializing the client.Test
Save the file and run it.node send_sms.js
Overview
This guide shows how to send an SMS text message to any phone number. Businesses send text messages to notify customers about recent information, send alerts, and provide delivery status updates, among other use cases.You can start sending SMS messages either by using our PHLO visual workflow builder or our APIs. Follow the instructions in one of the tabs below.- Using API
Here’s how to use Plivo APIs to send outbound SMS text messages.
Replace the auth placeholders with your authentication credentials from the Plivo console. Replace the phone number placeholders with actual phone numbers in E.164 format] (for example, +12025551234). In countries other than the US and Canada you can use a sender ID for the message source. You must have a Plivo phone number to send messages to the US or Canada; you can buy a Plivo number from Phone Numbers > Buy Numbers on the Plivo console or via the Numbers API.
How it works

Prerequisites
To get started, you need a Plivo account — sign up with your work email address if you don’t have one already. If this is your first time using Plivo APIs, follow our instructions to set up a Ruby development environment.Create the send SMS application
Create a file calledsend_sms.rb and paste into it this code.require "plivo"
include Plivo
api = RestClient.new("<auth_id>","<auth_token>")
response = api.messages.create(
src:"<sender_id>",
dst:"<destination_number>",
text:"Hello, from Ruby!"
)
puts response
Note:
We recommend that you store your credentials in the
auth_id and auth_token environment variables to avoid the possibility of accidentally committing them to source control. If you do this, you can initialize the client with no arguments and Plivo will automatically fetch the values from the environment variables. You can use ENV to store environment variables and fetch them when initializing the client.Test
Save the file and run it.ruby send_sms.rb
Overview
This guide shows how to send an SMS text message to any phone number. Businesses send text messages to notify customers about recent information, send alerts, and provide delivery status updates, among other use cases.You can start sending SMS messages either by using our PHLO visual workflow builder or our APIs. Follow the instructions in one of the tabs below.- Using API
Here’s how to use Plivo APIs to send outbound SMS text messages.
Replace the auth placeholders with your authentication credentials from the Plivo console. Replace the phone number placeholders with actual phone numbers in E.164 format (for example, +12025551234). In countries other than the US and Canada you can use a sender ID for the message source. You must have a Plivo phone number to send messages to the US or Canada; you can buy a Plivo number from Phone Numbers > Buy Numbers on the Plivo console or via the Numbers API.
How it works

Prerequisites
To get started, you need a Plivo account — sign up with your work email address if you don’t have one already. If this is your first time using Plivo APIs, follow our instructions to set up a Python development environment.Create the send SMS application
Create a file calledsend_sms.py and paste into it this code.import plivo
client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.messages.create(
src='<sender_id>',
dst='<destination_number>',
text='Hello, from Python!',)
print(response)
Note:
We recommend that you store your credentials in the
auth_id and auth_token environment variables to avoid the possibility of accidentally committing them to source control. If you do this, you can initialize the client with no arguments and Plivo will automatically fetch the values from the environment variables. You can use os module(os.environ) to store environment variables and fetch them when initializing the client.Test
Save the file and run it.$ python send_sms.py
Overview
This guide shows how to send an SMS text message to any phone number. Businesses send text messages to notify customers about recent information, send alerts, and provide delivery status updates, among other use cases.You can start sending SMS messages either by using our PHLO visual workflow builder or our APIs. Follow the instructions in one of the tabs below.- Using API
Here’s how to use Plivo APIs to send outbound SMS text messages.
Replace the auth placeholders with your authentication credentials from the Plivo console. Replace the phone number placeholders with actual phone numbers in E.164 format (for example, +12025551234). In countries other than the US and Canada you can use a sender ID for the message source. You must have a Plivo phone number to send messages to the US or Canada; you can buy a Plivo number from Phone Numbers > Buy Numbers on the Plivo console or via the Numbers API.
How it works

Prerequisites
To get started, you need a Plivo account — sign up with your work email address if you don’t have one already. If this is your first time using Plivo APIs, follow our instructions to set up a PHP development environment.Create the send SMS application
Create a file calledSendSMS.php and paste into it this code.<?php
require 'vendor/autoload.php';
use Plivo\RestClient;
$client = new RestClient("<auth_id>","<auth_token>");
$response = $client->messages->create(
[
"src" => "<sender_id>",
"dst" => "<destination_number>",
"text" =>"Hello, from PHP!"
]
);
print_r($response);
?>
Note:
We recommend that you store your credentials in the
auth_id and auth_token environment variables to avoid the possibility of accidentally committing them to source control. If you do this, you can initialize the client with no arguments and Plivo will automatically fetch the values from the environment variables. You can use ENV to store environment variables and fetch them when initializing the client.Test
Save the file and run it.php SendSMS.php
Overview
This guide shows how to send an SMS text message to any phone number. Businesses send text messages to notify customers about recent information, send alerts, and provide delivery status updates, among other use cases.You can start sending SMS messages either by using our PHLO visual workflow builder or our APIs. Follow the instructions in one of the tabs below.- Using API
Here’s how to use Plivo APIs to send outbound SMS text messages.
Replace the auth placeholders with your authentication credentials from the Plivo console. Replace the phone number placeholders with actual phone numbers in E.164 format(for example, +12025551234). In countries other than the US and Canada you can use a sender ID for the message source. You must have a Plivo phone number to send messages to the US or Canada; you can buy a Plivo number from Phone Numbers > Buy Numbers on the Plivo console or via the Numbers API.
How it works

Prerequisites
To get started, you need a Plivo account — sign up with your work email address if you don’t have one already. If this is your first time using Plivo APIs, follow our instructions to set up a .NET development environment.Create the send SMS application
In Visual Studio, in the CS project, open the fileProgram.cs and paste into it this code.using System;
using System.Collections.Generic;
using Plivo;
namespace PlivoExamples
{
internal class Program
{
public static void Main(string[] args)
{
var api = new PlivoApi("<auth_id>","<auth_token>");
var response = api.Message.Create(
src: "<sender_id>",
dst: "<destination_number>",
text: "Hello, from .NET!"
);
Console.WriteLine(response);
}
}
}
Note:
We recommend that you store your credentials in the
auth_id and auth_token environment variables to avoid the possibility of accidentally committing them to source control. If you do this, you can initialize the client with no arguments and Plivo will automatically fetch the values from the environment variables. You can use the Environment.SetEnvironmentVariable method to store environment variables and Environment.GetEnvironmentVariable to fetch them when initializing the client.Test
Save the file and run it.Overview
This guide shows how to send an SMS text message to any phone number. Businesses send text messages to notify customers about recent information, send alerts, and provide delivery status updates, among other use cases.You can start sending SMS messages either by using our PHLO visual workflow builder or our APIs. Follow the instructions in one of the tabs below.- Using API
Here’s how to use Plivo APIs to send outbound SMS text messages.
Replace the auth placeholders with your authentication credentials from the Plivo console. Replace the phone number placeholders with actual phone numbers in E.164 format (for example, +12025551234). In countries other than the US and Canada you can use a sender ID for the message source. You must have a Plivo phone number to send messages to the US or Canada; you can buy a Plivo number from Phone Numbers > Buy Numbers on the Plivo console or via the Numbers API.
How it works

Prerequisites
To get started, you need a Plivo account — sign up with your work email address if you don’t have one already. If this is your first time using Plivo APIs, follow our instructions to set up a Java development environment.Create the send SMS application
Create a Java class calledSendSMS and paste into it this code.import java.io.IOException;
import java.net.URL;
import java.util.Collections;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.message.Message;
import com.plivo.api.models.message.MessageCreateResponse;
class SendSMS
{
public static void main(String [] args)
{
Plivo.init("<auth_id>","<auth_token>");
MessageCreateResponse response = Message.creator("<sender_id>","<destination_number>",
"Hello, from Java!")
.create();
System.out.println(response);
}
}
Note:
We recommend that you store your credentials in the
auth_id and auth_token environment variables to avoid the possibility of accidentally committing them to source control. If you do this, you can initialize the client with no arguments and Plivo will automatically fetch the values from the environment variables. You can use <a rel="nofollow" href="https://docs.oracle.com/javase/tutorial/essential/environment/env.html">System.getenv()</a> to store and retrieve environment variables when initializing the client.Test
Overview
This guide shows how to send an SMS text message to any phone number. Businesses send text messages to notify customers about recent information, send alerts, and provide delivery status updates, among other use cases.You can start sending SMS messages either by using our PHLO visual workflow builder or our APIs. Follow the instructions in one of the tabs below.- Using API
Here’s how to use Plivo APIs to send outbound SMS text messages.
Replace the auth placeholders with your authentication credentials from the Plivo console. Replace the phone number placeholders with actual phone numbers in E.164 format (for example, +12025551234). In countries other than the US and Canada you can use a sender ID for the message source. You must have a Plivo phone number to send messages to the US or Canada; you can buy a Plivo number from Phone Numbers > Buy Numbers on the Plivo console or via the Numbers API.
How it works

Prerequisites
To get started, you need a Plivo account — sign up with your work email address if you don’t have one already. If this is your first time using Plivo APIs, follow our instructions to set up a Go development environment.Create the send SMS application
Create a file calledSendSMS.go and paste into it this code.package main
import "fmt"
import "github.com/plivo/plivo-go/v7"
func main() {
client, err := plivo.NewClient("<auth_id>","<auth_token>", &plivo.ClientOptions{})
if err != nil {
fmt.Print("Error", err.Error())
return
}
response, err := client.Messages.Create(
plivo.MessageCreateParams{
Src: "<sender_id>",
Dst: "<destination_number>",
Text: "Hello, from Go!",
},
)
if err != nil {
fmt.Print("Error", err.Error())
return
}
fmt.Printf("Response: %#v\n", response)
}
Note:
We recommend that you store your credentials in the
auth_id and auth_token environment variables to avoid the possibility of accidentally committing them to source control. If you do this, you can initialize the client with no arguments and Plivo will automatically fetch the values from the environment variables. You can use os.Setenv and os.Getenv functions to store environment variables and fetch them when initializing the client.Test
Save the file and run it.go run SendSMS.go