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

client = plivo.RestClient("AUTH_ID","AUTH_TOKEN")
response = client.messages.get(
    message_uuid='c0d5dfac-bdc5-11e9-8ebe-0242ac110006', ) #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("c0d5dfac-bdc5-11e9-8ebe-0242ac110006") #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("c0d5dfac-bdc5-11e9-8ebe-0242ac110006", // 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
<?php
require 'vendor/autoload.php';
use Plivo\RestClient;

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

try {
    $response = $client->messages->get('c0d5dfac-bdc5-11e9-8ebe-0242ac110006'); #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("c0d5dfac-bdc5-11e9-8ebe-0242ac110006")
                    .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
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}/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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(
		"c0d5dfac-bdc5-11e9-8ebe-0242ac110006",
	) //message-uuid
	if err != nil {
		panic(err)
	}
	fmt.Printf("Response: %#v\n", response)
}