Consensus Messages

Send a consensus message to hedera through your API with the option of using webhooks for waiting synchronously for finality.

post
Create new consensus message

https://hedera-serverless-consensus.vercel.app/api/consensus/message/
This endpoint allows you to send a message to a topic id, you may simply broadcast the message, or wait for consensus to be reached using allow_synchronous_consensus. If you are using testnet or mainnet environments there will be a explorer_url property linking to an external hashgraph explorer for the given transaction.
Request
Response
Request
Headers
Authentication
required
string
The API_SECRET_KEY from th e client's environment variables.
Query Parameters
reference
optional
string
A reference to an internal app idenitier so that after the response it will be easier to link.
allow_synchronous_consensus
optional
boolean
Wait for consensus to be finished to finality before receiving a response.
topic_id
required
string
The id of the topic you want to sent the message to.
message
required
string
The string message that is sent to received a consensus response.
Response
200: OK
New message sent to a topic, using a topic_id and message.
{
"data": {
"reference": "my reference",
"topic_id": "16091",
"transaction_id": "0.0.1156@1598828456.197000000",
"explorer_url": "https://ledger-testnet.hashlog.io/tx/0.0.1156@1598828456.197000000",
"consensus_timestamp": {
"seconds": 1598828466,
"nanos": 501124002
}
}

WARNING: if you have a WEBHOOK_URL set in your client it is recommended that you do not set the allow_synchronous_consensus to false due to the implications of the NodeJS event loop with AWS Lambda.