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()
response = client.messages.get(
    message_uuid='66c0d77b-6d5a-441e-8923-aea141608106', )
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#
# Example for Message Get
#
require 'rubygems'
require 'plivo'

include Plivo
include Plivo::Exceptions

api = RestClient.new("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN")

begin
  response = api.messages.get(
    '85ce8068-6fab-4f0a-9dc7-d6c852cdde91'
  )
  puts response
rescue PlivoRESTError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Example for Message get

var plivo = require('plivo');

(function main() {
    'use strict';
    
    // As the auth_id and auth_token are unspecified, Plivo will fetch them from the PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN environment variables.
    var client = new plivo.Client();
    client.messages.get(
        "85ce8068-6fab-4f0a-9dc7-d6c852cdde91", // 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
17
18
<?php
/**
 * Example for Message get
 */
require 'vendor/autoload.php';
use Plivo\RestClient;

$client = new RestClient("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN");

try {
    $response = $client->messages->get(
        '85ce8068-6fab-4f0a-9dc7-d6c852cdde91'
    );
    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
package com.plivo.api.samples.message;

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;

/**
* Example for Message get
*/
class MessageGet {
    public static void main(String [] args) {
        Plivo.init();
        try {
            Message response = Message.getter("85ce8068-6fab-4f0a-9dc7-d6c852cdde91")
                .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
/**
 * Example for Message Get
 */
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("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN");
            try
            {
                var response = api.Message.Get(
                    messageUuid:"85ce8068-6fab-4f0a-9dc7-d6c852cdde91"
                );
                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
// Example for Message get
package main

import "fmt"
import "github.com/plivo/plivo-go"
 
func main() {
	client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
	response, err := client.Messages.Get(
		"85ce8068-6fab-4f0a-9dc7-d6c852cdde91",
	)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Response: %#v\n", response)
}