Get Details of a Single Message

Once the Message API request is successful, your SMS will be put into a queue to be sent to its destination.

To get the details of a Single Messages, make an HTTP GET request to the Message API by passing the Message UUID.

GET https://api.plivo.com/v1/Account/{auth_id}/Message/{message_uuid}/

Getting Started

  1. Sign up for a free Plivo trial account.
  2. Check out our server-side SDKs page and install the right helper based on the programming language you want to use.
Note: Long SMS messages are automatically split and concatenated into a seamless user experience. When checking Message Logs and Delivery Reports for long SMS messages that are split, look for the `ParentMessageUUID`, which is the same in all split messages and identical to the UUID of the first message in the split sequence of messages.
Advanced Hack: See the Message API page for full details of the API.

Implementation

  1. Copy the relevant code below into a text file and save it.
  2. Replace Your AUTH_ID and Your AUTH_TOKEN with the AUTH ID and AUTH TOKEN found on your Plivo dashboard.
  3. Add the unique message_uuid found in the response of the message you sent. See a Sample Response.

Code

1
2
3
4
5
import plivo

client = plivo.RestClient("auth_id", "auth_token")
response = client.messages.get(message_uuid='your_message_uuid',)
print(response)
1
2
3
4
5
6
7
8
require "rubygems"
require "plivo"

include Plivo

api = RestClient.new("auth_id", "auth_token")
response = api.messages.get("your_message_uuid")
puts response
1
2
3
4
5
6
7
8
9
var plivo = require('plivo');

(function main() {
    'use strict';
    var client = new plivo.Client("auth_id", "auth_token");
    client.messages.get("your_message_uuid", ).then(function (response) {
        console.log(response);
    }, );
})();
1
2
3
4
5
6
7
8
<?php
require 'vendor/autoload.php';
use Plivo\RestClient;

$client = new RestClient("auth_id", "auth_token");
$response = $client->messages->get('your_message_uuid');
print_r($response);
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.io.IOException;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.message.Message;

class MessageGet {
    public static void main(String[] args) {
        Plivo.init("auth_id", "auth_token");
        try {
            Message response = Message.getter("your_message_uuid").get();

            System.out.println(response);

        } catch (PlivoRestException | IOException e) {
            e.printStackTrace();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package main

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

func main() {
	client, err := plivo.NewClient("auth_id", "auth_token", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
	response, err := client.Messages.Get("your_message_uuid")
	if err != nil {
		panic(err)
	}
	fmt.Printf("Response: %#v\n", response)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
using System;
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.Get(messageUuid: "your_message_uuid");
            Console.WriteLine(response);
        }
    }
}
1
2
curl -i --user auth_id:auth_token \
    https://api.plivo.com/v1/Account/{auth_id}/Message/{message_uuid}/

Next Step

Learn how to handle SMS delivery reports.

  1. Send a Single SMS
  2. Send a Long SMS
  3. Send Multiple (Bulk) SMS
  4. Send an SMS with Alphanumeric Sender ID
  5. Receive an SMS
  6. Reply to an Incoming SMS
  7. Forward an Incoming SMS
  8. Get Details of all Messages
  9. Get Details of a Single Message
  10. Handling SMS Delivery Reports
  11. Forward SMS to Email