- Node
- Ruby
- Python
- PHP
- .NET
- Java
- Go
Overview
This guide shows how to send an MMS message to any phone number. Businesses can make messages more meaningful by using MMS instead of SMS and including images, audio, and video to provide context.You can start sending MMS 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 MMS 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 MMS application
Create a file calledsend_mms.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!",
type: "mms",
media_urls: ["[https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif](https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif)"],
media_ids: ["801c2056-33ab-499c-80ef-58b574a462a2"]
}
).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_mms.js
Overview
This guide shows how to send an MMS message to any phone number. Businesses can make messages more meaningful by using MMS instead of SMS and including images, audio, and video to provide context.You can start sending MMS 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 MMS 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 MMS application
Create a file calledsend_mms.rb and paste into it this code.require 'rubygems'
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!",
media_urls:["[https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif](https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif)"],
media_ids:["801c2056-33ab-499c-80ef-58b574a462a2"],
type: "mms"
)
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
ruby send_mms.rb
Overview
This guide shows how to send an MMS message to any phone number. Businesses can make messages more meaningful by using MMS instead of SMS and including images, audio, and video to provide context.You can start sending MMS 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 MMS 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 MMS application
Create a file calledsend_mms.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>',
media_ids=['801c2056-33ab-499c-80ef-58b574a462a2'],
media_urls=['[https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif](https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif)'],
type_='mms')
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_mms.py
Overview
This guide shows how to send an MMS message to any phone number. Businesses can make messages more meaningful by using MMS instead of SMS and including images, audio, and video to provide context.You can start sending MMS 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 MMS 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 MMS application
Create a file calledSendMMS.php and paste into it this code.<?php
require 'vendor/autoload.php';
use Plivo\RestClient;
$client = new RestClient("<auth_id>","<auth_token>");
$client->client->setTimeout(40);
$mediaURLs = ["[https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif](https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif)"];
$mediaIDs = ["801c2056-33ab-499c-80ef-58b574a462a2"];
$response = $client->messages->create(
[
"src" => "<sender_id>",
"dst" => "<destination_number>",
"text" =>"Hello, from PHP!",
"type" => "mms",
"media_urls" => $mediaURLs,
"media_ids" => $mediaIDs
]);
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 process.env to store environment variables and fetch them when initializing the client.Test
Save the file and run it.php SendMMS.php
Overview
This guide shows how to send an MMS message to any phone number. Businesses can make messages more meaningful by using MMS instead of SMS and including images, audio, and video to provide context.You can start sending MMS 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 MMS 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 MMS 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;
using Plivo.Exception;
namespace SdkTestDotnet
{
class Program
{
static void Main(string[] args)
{
var api = new PlivoApi("<auth_id>","<auth_token>");
try
{
var response = api.Message.Create(
src:"<sender_id>",
dst:new List<String>{"<destination_number>"},
text:"Hello, from .NET!",
type:"mms",
media_urls: new string[]{"[https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif](https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif)"},
media_ids: new String[]{"801c2056-33ab-499c-80ef-58b574a462a2"}
);
Console.WriteLine(response);
}
catch (PlivoRestException e)
{
Console.WriteLine("Exception: " + e.Message);
}
}
}
}
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 MMS message to any phone number. Businesses can make messages more meaningful by using MMS instead of SMS and including images, audio, and video to provide context.You can start sending MMS 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 MMS 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 MMS application
Once you have the above prerequisites set, You can follow the below instructions to create an app to send an outbound MMS to deliver your message.Create a Java class calledSendMMS and paste into it this code.package com.plivo.api;
import java.io.IOException;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.media.Media;
public class SendMMS {
public static void main(String[] args) {
Plivo.init("<auth_id>", "<auth_token>");
MessageCreateResponse response = Message.creator("<sender_id>",Collections.singletonList("<destination_number>"),
"Hello, from Java!").type(MessageType.MMS)
.media_urls(new String[]{"[https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif](https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif)"})
.media_ids(new String[]{"801c2056-33ab-499c-80ef-58b574a462a2"})
.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 System.getenv() to store and retrieve environment variables when initializing the client.Test
Overview
This guide shows how to send an MMS message to any phone number. Businesses can make messages more meaningful by using MMS instead of SMS and including images, audio, and video to provide context.You can start sending MMS 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 MMS 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.Save the file and run it.
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 MMS application
Create a file calledSendMMS.go and paste into it this code.package main
import (
"fmt"
plivo "[github.com/plivo/plivo-go/v7](https://github.com/plivo/plivo-go/v7)"
)
func main() {
client, err := plivo.NewClient("<auth_id>","<auth_token>",
&plivo.ClientOptions{})
if err != nil {
panic(err)
}
createResp, err := client.Messages.Create(plivo.MessageCreateParams{
Src: "<sender_id>",
Dst: "<destination_number>",
Text: "Hello, from Go!",
Type: "mms",
MediaUrls: []string{"[https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif](https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif)"},
MediaIds: []string{"801c2056-33ab-499c-80ef-58b574a462a2"},
})
if err != nil {
panic(err)
}
fmt.Printf("Response: %#v\n", createResp)
}
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.go run SendMMS.go