Retrieve a message

Retrieves a Message Detail Record (MDR).

API Endpoint

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

Arguments

No arguments need to be passed.

Returns

This API call returns the message detail record for the message identified by the message_uuid specified in the request URL.

Response

HTTP Status Code: 200

{
  "api_id": "035eeada-6df1-11e6-b608-06a72a185e87",
  "error_code": "200",
  "from_number": "18552828641",
  "message_direction": "outbound",
  "message_state": "failed",
  "message_time": "2016-08-17 21:22:36+05:30",
  "message_type": "sms",
  "message_uuid": "2a340179-e8a9-4b1d-ae2c-9f346e7b6d7d",
  "resource_uri": "/v1/Account/{auth_id}/Message/2a340179-e8a9-4b1d-ae2c-9f346e7b6d7d/",
  "to_number": "19352326448",
  "total_amount": "0.00000",
  "total_rate": "0.00350",
  "units": 1
}

Example Request

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
10
11
12
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);
    //Prints only the message_uuid
    console.log(response.messageUuid);
  },);
})();
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
19
20
21
22
23
24
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
17
18
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}/
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)
}