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. Plivo has a throughput of 1 SMS per second. That is, Plivo will send 1 SMS every second for each 'src' (source) number in the API request.

To get the details of a Single Messages, make an HTTP GET request to the Message API by passing the Message UUID.

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

Prerequisites

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.

Code

importplivoauth_id="Your AUTH_ID"auth_token="Your Auth_TOKEN"p=plivo.RestAPI(auth_id,auth_token)# Message UUID for which the details will be retrieved
params={'message_uuid':'0936ec98-7c4c-11e4-9bd8-22000afa12b9'}# Fetch the details
response=p.get_message(params)# Prints all the details of a message
printstr(response)# Prints the number of SMS units
# print "Your SMS was split into %s units" % response[1]['units']
# Prints the status of the message
# print response[1]['message_state']

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

require'rubygems'require'plivo'includePlivoAUTH_ID="Your AUTH_ID"AUTH_TOKEN="Your AUTH_TOKEN"p=RestAPI.new(AUTH_ID,AUTH_TOKEN)# Message UUID for which the details will be retrievedparams={'record_id'=>'0936ec98-7c4c-11e4-9bd8-22000afa12b9'}# Fetch the detailsresponse=p.get_message(params)# Prints all the details of a messageputsresponse# Prints the number of SMS units# puts "Your SMS was split into %s units" % response[1]['units']# Prints the status of the message# puts response[1]['message_state']

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

varplivo=require('plivo');varp=plivo.RestAPI({authId:'Your AUTH_ID',authToken:'Your AUTH_TOKEN'});// Message UUID for which the details will be retrievedvarparams={'record_id':'005bcdf3-b1b9-4487-b8d3-59efb41431ca'};// Fetch the detailsp.get_message(params,function(status,response){console.log('Status: ',status);console.log('API Response:\n',response);console.log('Units:',response['units']);console.log('Status:',response['message_state']);});

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

<?phprequire'vendor/autoload.php';usePlivo\RestAPI;$auth_id="Your AUTH_ID";$auth_token="Your AUTH_TOKEN";$p=newRestAPI($auth_id,$auth_token);// Message UUID for which the details will be retrieved$params=array('record_id'=>'0936ec98-7c4c-11e4-9bd8-22000afa12b9');// Fetch the details$response=$p->get_message($params);// Print the responseprint_r($response['response']);// Print the number of SMS unitsprint"Units : {$response['response']['units']}";// Print the status of the messageprint"Message State : {$response['response']['message_state']}";?>

packagecom.plivo.test;importjava.util.LinkedHashMap;importcom.plivo.helper.api.client.*;importcom.plivo.helper.api.response.message.MessageResponse;importcom.plivo.helper.exception.PlivoException;publicclassGetDetails{publicstaticvoidmain(String[]args){StringauthId="Your AUTH_ID";StringauthToken="Your AUTH_TOKEN";RestAPIapi=newRestAPI(authId,authToken,"v1");LinkedHashMap<String,String>parameters=newLinkedHashMap<String,String>();// Message UUID for which the details will be retrievedparameters.put("record_id","0936ec98-7c4c-11e4-9bd8-22000afa12b9");try{Messagemsg=api.getMessage(parameters);// Prints all the details of a messageSystem.out.println(msg);// Prints the number of SMS units// System.out.println("Units : " + msg.units);// Prints the state of the message// System.out.println("Message State : " + msg.messageState);}catch(PlivoExceptione){System.out.println(e.getLocalizedMessage());}}}

usingSystem;usingSystem.Collections.Generic;usingSystem.Reflection;usingRestSharp;usingPlivo.API;namespaceGet_Details{classProgram{staticvoidMain(string[]args){RestAPIplivo=newRestAPI("Your AUTH_ID","Your AUTH_TOKEN");IRestResponse&lt;Message&gt;resp=plivo.get_message(newDictionary&lt;string,string&gt;(){// Message UUID for which the details will be retrieved{"record_id","1aead330-8ff9-11e4-9bd8-22000afa12b9"}});// Prints all the details of a messageConsole.Write(resp.Content);// Print the status of the message// Console.Write("Message State : {0}", resp.Data.message_state);Console.ReadLine();}}}