Skip to main content

Get a specific message information

This endpoint will let you get information about a message you sent or received using 2Chat.

Parameters

These are path parameters that should go in the URL you use to invoke the endpoint.

ParameterDescriptionExample
Session KeyThe session key the message belongs toWW-WPN66037eca-9ad1-4c96-9eff-526a90a48c77-5215511112222@c.us
Message UUIDThe UUID of the message you want information fromMSG205dec10-523d-4ab3-b739-fd56e7cdeba2

Obtaning message information

Assuming you want to obtain information about a message you sent that has MSG205dec10-523d-4ab3-b739-fd56e7cdeba2 as UUID, and is part of the conversation with session key WW-WPN66037eca-9ad1-4c96-9eff-526a90a48c77-5215511112222@c.us. To get it, you must make a GET request to:

https://api.p.2chat.io/open/whatsapp/message/WW-WPN66037eca-9ad1-4c96-9eff-526a90a48c77-5215511112222@c.us/MSG205dec10-523d-4ab3-b739-fd56e7cdeba2.

tip

Every time you make a request to send a message using this API, we reply with the message's UUID. You can store and use this value later to obtain information about that message.

Invocation

curl --location --request GET 'https://api.p.2chat.io/open/whatsapp/message/WW-WPN66037eca-9ad1-4c96-9eff-526a90a48c77-5215511112222@c.us/MSG205dec10-523d-4ab3-b739-fd56e7cdeba2' \
--header 'X-User-API-Key: your_api_key_here' \
--data-raw ''

Response

The API will return whether it succeded or not to queue the message for sending

{
"success": true,
"message": {
"id": "MSG205dec10-523d-4ab3-b739-fd56e7cdeba2",
"uuid": "MSG205dec10-523d-4ab3-b739-fd56e7cdeba2",
"session_key": "WW-WPN66037eca-9ad1-4c96-9eff-526a90a48c77-5215511112222@c.us",
"message": {
"text": "the content of the message"
},
"created_at": "2024-04-02T23:02:03Z",
"remote_phone_number": "+5215511112222",
"sent_by": "agent",
"is_from_flow_run": false,
"is_from_api": false,
"is_from_chatter": true,
"is_from_agent": false,
"wa_msg_id": "3A8AE0BEDA97E2F99557",
"wa_msg_ack": 3,
"sent": true,
"received": true,
"read": true,
"read_at": "2024-04-02T23:03:15Z",
}
}
FieldDescription
idThe unique identifier of the message
uuidSame as id
timestampTimestamp of the message in UTC
session_keyThe chat session key that corresponds to this message
messageThe payload of the message
message.textThe text content of the message, if present
message.media.urlThe 2Chat-hosted media file URL sent or received
message.media.typeThe type of media message
message.media.mime_typeThe MIME type of the message
remote_phone_numberThe WhatsApp phone number of the other end of the conversation
channel_phone_numberThe WhatsApp phone number where the message arrived
sent_byWho sent the message. E.g.: api, agent, user
is_from_flow_runtrue if the message was sent by a flow reply
is_from_apitrue if the message was sent using 2Chat's API
is_from_chattertrue if the message was sent by the remote party of the conversation, i.e., not you or an agent using 2Chat
is_from_agenttrue if the message was sent by you, any of your agents using 2Chat, or someone sending messages directly from the WhatsApp application
wa_msg_idInternal ID WhatsApp gave to this message on their network
wa_msg_ack0: message created, 1: message sent, 2: message received, 3: message read
senttrue if the message was sent
receivedtrue if the message was received by the recipient
readtrue if the recipient of the message read it, and has read notifications enabled
read_atSet to a UTC+0 date/time of when the message was read by the recipient