Latest Legacy

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": "85a704c8-e47a-11eb-9a69-0242ac110004",
    "carrier_fees": "0.04",
    "carrier_fees_rate": "0.04",
    "error_code": "000",
    "from_number": "17087654321",
    "is_domestic": "false",
    "mcc": "312",
    "message_direction": "outbound",
    "message_state": "delivered",
    "message_time": "2021-07-13 13:04:06.799021+05:30",
    "message_type": "sms",
    "message_uuid": "b48d95dc-e3ac-11eb-a9c2-0242ac110005",
    "mnc": "650",
    "powerpack_id": "1d5f3dd8-b207-4738-b59f-3c2ac7d3461c",
    "resource_uri": "/v1/Account/{auth_id}/Message/b48d95dc-e3ac-11eb-a9c2-0242ac110005/",
    "to_number": "12401234567",
    "total_amount": "0.00140",
    "total_rate": "0.00140",
    "tendlc_campaign_id": "CD4WJJD",
    "tendlc_registration_status": "registered",
    "destination_country_iso2": "US",
    "units": 1,
    "replaced_sender": "17087654321",
    "is_domestic": false,
    "dlt_entity_id": "",
    "dlt_template_id": "",
    "dlt_template_category": "",
    "requester_ip": "192.168.0.1",
    "destination_network": "verizon", 
    "conversation_id": "2b89d38b573b5ca0a1e85ba3b8d159fc",
    "conversation_origin": "authentication",
    "conversation_expiration_timestamp": "2024-02-13 01:21:00-08:00", 
    "log": "number_only"

}

Example Request

1
2
3
4
5
6
7
import plivo

client = plivo.RestClient(auth_id="<auth_id>", auth_token="auth_token")

# Get MDR
response = client.messages.get(message_uuid='d6d17dd2-b9fe-4cf8-acfd-c6a8b959ea38')
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'rubygems'
require 'plivo'

include Plivo
include Plivo::Exceptions

# Environment
api = RestClient.new("<auth_id>", "<auth_token>")

# GET MDR
begin
response = api.messages.get("c9d8f08d-4f1f-4765-b7e4-83e0d35a36c5")
puts response
rescue PlivoRESTError => e
    puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
let plivo = require('plivo')

let client = new plivo.Client('<auth_id>','<auth_token>');

// Get MDR
client.messages.get("62085fe8-9b8a-4c9d-9527-5996e94333ab")
.then(function(response) {
    console.log(response);
}).catch(function(error) {
    console.log(error);
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
require 'vendor/autoload.php';
use Plivo\RestClient;

// ENVIORNMENT
$client = new RestClient("<auth_id>", "<auth_token>");

// Get MDR
try {
    $response = $client->messages->get('c9d8f08d-4f1f-4765-b7e4-83e0d35a36c5');
    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
package com.plivo.examples;
import java.io.IOException;

import com.plivo.api.Plivo;
import com.plivo.api.models.message.Message;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.exceptions.PlivoValidationException;

public class Sample {

	public static void main(String[] args) throws PlivoValidationException {
        Plivo.init("<auth_id>", "<auth_token>");

        // Get MDR
		try {
		Message response = Message.getter("62085fe8-9b8a-4c9d-9527-5996e94333ab").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
27
28
29
30
31
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;

namespace dotnet_sdk
{
    class Sms
    {
        static void Main(string[] args)
        {
            // ENVIRONMENT
            var api = new PlivoApi("<auth_id>","<auth_token>");

            // Get MDR
            try
            {   
                Console.WriteLine("Get MDR");
                var response = api.Message.Get(
                messageUuid: "d6af1134-ab76-11ed-bf27-0242ac110003"
            );
                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
19
20
21
22
23
24
25
package main

import (
	"fmt"

	plivo "github.com/plivo/plivo-go"
)

func main() {

	// ENVIRONMENT
	client, err := plivo.NewClient("<auth_id>", "<auth_token>",
		&plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}

	// GET MDR
	response, err := client.Messages.Get("e0f9ab26-bec2-4f21-b1f0-47014e15e268")
	if err != nil {
		panic(err)
	}
	fmt.Printf("Response: %#v\n", response)

}