Add voice and SMS to your app in 15 minutes

View More

Send and Receive Text Messages

import plivo

client = plivo.RestClient()
message_created = client.messages.create(
    src='the_source_number',
    dst='the_destination_number',
    text='Hello, world!')
require 'rubygems'
require 'plivo'

include Plivo

client = RestClient.new
message_created = client.messages.create(
  'your_source_number',
  ['your_destination_number'],
  'Hello, world!'
)
let plivo = require('plivo');
let client = new plivo.Client();

client.messages.create(
  'your_source_number',
  'your_destination_number',
  'Hello, world!'
).then(function(message_created) {
  console.log(message_created)
});
require 'vendor/autoload.php';
use Plivo\RestClient;

$client = new RestClient();
$message_created = $client->messages->create(
    'the_source_number',
    ['the_destination_number'],
    'Hello, world!'
);
package com.plivo.api.samples.message;

import java.io.IOException;
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 MessageCreate {
    public static void main(String [] args) {
        Plivo.init();
        try {
            MessageCreateResponse response = Message.creator(
                "the_source_number",
                Collections.singletonList("the_destination_number"),
                "Hello, world!")
                    .create();

            System.out.println(response);
        } catch (PlivoRestException | IOException e) {
            e.printStackTrace();
        }
    }
}
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;

namespace PlivoExamples
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var api = new PlivoApi("your_auth_id", "your_auth_token");
            var response = api.Message.Create(
                src:"the_source_number",
                dst:new List{"the_destination_number"},
                text:"Hello, world!"
            );
            Console.WriteLine(response);
        }
    }
}
package main

import "github.com/plivo/plivo-go/plivo"

func main()  {
  client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
  if err != nil {
    panic(err)
  }
  client.Messages.Create(plivo.MessageCreateParams{
    Src: "the_source_number",
    Dst: "the_destination_number",
    Text: "Hello, world!",
  })
}
import plivo

client = plivo.RestClient()
call_made = client.calls.create(
    from_='the_from_number',
    to_='the_to_number',
    answer_url='https://s3.amazonaws.com/static.plivo.com/answer.xml',
    answer_method='GET')
require 'rubygems'
require 'plivo'

include Plivo

client = RestClient.new
call_made = client.calls.create(
  'your_source_number',
  ['your_destination_number'],
  'https://s3.amazonaws.com/static.plivo.com/answer.xml',
  'GET'
)
let plivo = require('plivo');
let client = new plivo.Client();

client.calls.create(
  'your_source_number',
  'your_destination_number',
  'https://s3.amazonaws.com/static.plivo.com/answer.xml', {
    'answer_method': 'GET'
  }
).then(function(call_created) {
  console.log(call_created)
});
require 'vendor/autoload.php';
use Plivo\RestClient;

$client = new RestClient();
$call_made = $client->calls->create(
    'the_source_number',
    ['the_destination_number'],
    'https://s3.amazonaws.com/static.plivo.com/answer.xml',
    'GET'
);
package com.plivo.api.samples.call;

import java.io.IOException;
import java.util.Collections;

import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.call.Call;
import com.plivo.api.models.call.CallCreateResponse;

/**
* Example for Call create
*/
class CallCreate {
    public static void main(String [] args) {
        Plivo.init();
        try {
            CallCreateResponse response = Call.creator("the_from_number",
                Collections.singletonList("the_to_number"),
                "http://s3.amazonaws.com/static.plivo.com/answer.xml")
                    .answerMethod("GET")
                    .create();

            System.out.println(response);
        } catch (PlivoRestException | IOException e) {
            e.printStackTrace();
        }
    }
}
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;

namespace PlivoExamples
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var api = new PlivoApi("your_auth_id", "your_auth_token");
            var response = api.Call.Create(
                to:new List{"the_to_number"},
                from:"the_from_number",
                answerMethod:"GET",
                answerUrl:"http://s3.amazonaws.com/static.plivo.com/answer.xml"
            );
            Console.WriteLine(response);
        }
    }
}
package main

import "github.com/plivo/plivo-go/plivo"

func main()  {
  client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
  if err != nil {
    panic(err)
  }
  client.Calls.Create(plivo.CallCreateParams{
    From: "the_source_number",
    To: "the_destination_number",
    AnswerURL: "https://s3.amazonaws.com/static.plivo.com/answer.xml",
    AnswerMethod: "GET",
  })
}

Make and Receive Voice Calls

Other developers like you built these!

You can build one too. Select the use case you want to build and get started.

View More

You can use Plivo's APIs in any language that can send HTTPS requests.

For starters, we have server-side SDKs for the following 7 languages.

View More