Get topic message by consensusTimestamp
curl --request GET \
--url https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}import requests
url = "https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"chunk_info": {
"initial_transaction_id": "0.0.10-1234567890-000000321",
"nonce": 3,
"number": 1,
"total": 2,
"scheduled": true
},
"consensus_timestamp": "1234567890.000000001",
"message": "bWVzc2FnZQ==",
"payer_account_id": "0.0.10",
"running_hash": "cnVubmluZ19oYXNo",
"running_hash_version": 2,
"sequence_number": 1,
"topic_id": "0.0.7"
}{
"_status": {
"messages": [
{
"message": "Invalid parameter: account.id"
},
{
"message": "Invalid Transaction id. Please use \\shard.realm.num-sss-nnn\\ format where sss are seconds and nnn are nanoseconds"
}
]
}
}{
"_status": {
"messages": [
{
"message": "Not found"
}
]
}
}Topics
Get topic message by consensusTimestamp
Returns a topic message the given the consensusTimestamp.
GET
/
api
/
v1
/
topics
/
messages
/
{timestamp}
Get topic message by consensusTimestamp
curl --request GET \
--url https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}import requests
url = "https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.mirrornode.hedera.com/api/v1/topics/messages/{timestamp}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"chunk_info": {
"initial_transaction_id": "0.0.10-1234567890-000000321",
"nonce": 3,
"number": 1,
"total": 2,
"scheduled": true
},
"consensus_timestamp": "1234567890.000000001",
"message": "bWVzc2FnZQ==",
"payer_account_id": "0.0.10",
"running_hash": "cnVubmluZ19oYXNo",
"running_hash_version": 2,
"sequence_number": 1,
"topic_id": "0.0.7"
}{
"_status": {
"messages": [
{
"message": "Invalid parameter: account.id"
},
{
"message": "Invalid Transaction id. Please use \\shard.realm.num-sss-nnn\\ format where sss are seconds and nnn are nanoseconds"
}
]
}
}{
"_status": {
"messages": [
{
"message": "Not found"
}
]
}
}Path Parameters
The Unix timestamp in seconds.nanoseconds format, the timestamp at which the associated transaction reached consensus. See unixtimestamp.com for a simple way to convert a date to the 'seconds' part of the Unix time.
Pattern:
^\d{1,10}(\.\d{1,9})?$Response
OK
A Unix timestamp in seconds.nanoseconds format
Pattern:
^\d{1,10}(\.\d{1,9})?$Example:
"1586567700.453054000"
Network entity ID in the format of shard.realm.num
Pattern:
^\d{1,10}\.\d{1,10}\.\d{1,10}$Example:
"0.0.2"
Network entity ID in the format of shard.realm.num
Pattern:
^\d{1,10}\.\d{1,10}\.\d{1,10}$Example:
"0.0.2"
Show child attributes
Show child attributes
Was this page helpful?