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
6
import plivo

client = plivo.RestClient("AUTH_ID","AUTH_TOKEN")
response = client.messages.get(
    message_uuid='bbdc94b8-a250-11e9-97c0-0242ac110005', ) #UUID of the Message
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require "rubygems"
require "plivo"

include Plivo
include Plivo::Exceptions

api = RestClient.new("AUTH_ID", "AUTH_TOKEN")

begin
  response = api.messages.get("638ca086-a2c9-11e9-b2f8-0242ac110004") #message_uuid
  puts response
rescue PlivoRESTError => e
  puts "Exception: " + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
var plivo = require('plivo');

(function main() {
    'use strict';
    var client = new plivo.Client("AUTH_ID", "AUTH_TOKEN");
    client.messages.get("f04534be-a23a-11e9-8761-0242ac110003", // message uuid
).then(function (response) {
        console.log(response);
    }, function (err) {
        console.error(err);
    });
})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
/**
 * Example for Message get
 */
require 'vendor/autoload.php';
use Plivo\RestClient;

$client = new RestClient("AUTH_ID", "AUTH_TOKEN");

try {
    $response = $client->messages->get('a1f4ad1c-a974-11e9-9b64-0242ac110004'); #message_uuid
    print_r($response);
}
catch (PlivoRestException $ex) {
    print_r(ex);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.io.IOException;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.message.Message;
import com.plivo.api.models.message.Message;

class MessageGet
{
    public static void main(String [] args)
    {
        Plivo.init("AUTH_ID", "AUTH_TOKEN");
        try
        {
            // Message UUID
            Message response = Message.getter("8ee72bca-afcb-11e9-a321-0242ac110005")
                    .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("38ae3ede-a9df-11e9-b99b-0242ac110005",) //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
17
18
19
20
21
22
23
24
25
26
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("AUTH_ID", "AUTH_TOKEN");
            try
            {
                var response = api.Message.Get(
                    messageUuid:"c0d5dfac-bdc5-11e9-8ebe-0242ac110006"
                );
                Console.WriteLine(response);
            }
            catch (PlivoRestException e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
        }
    }
}
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