Skip to main content

Fetch messages by IDs

Use the Fetch Messages by ID API to retrieve message details for one or more message IDs.

Request parameters

NameTypeRequired/OptionalDescription
messageIdsstring[]RequiredAn array of message IDs to look up

Request Information

CategoryValue
Http requestPOST
URLhttps://bikapi.bikayi.app/integrations/bikPlatformFunctions-fetchMessagesById
curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-fetchMessagesById' \
--header 'Authorization: Basic AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"messageIds": ["message_id1"],
}'

JSON response example:

{
"status": 200,
"success": true,
"data": {
"messages": [
{
"id": 9749131,
"messageId": "message_id1",
"createdAt": "2024-07-24T08:13:49.363Z",
"receiverId": "4154000",
"status": "failed",
"type": "whatsapp",
"message": "This is the test template carousel for the automation Test message..",
"assetValue": "+919909009000",
"failureReason": "Message Undeliverable."
}
]
}
}

Response parameters

NameTypeDescription
statusnumberHTTP status code
successbooleanIndicates whether the request succeeded
dataBikPlatformMessage[]Array of matching message objects

BikPlatformMessage type

NameTypeDescription
idstringInternal message ID
createdAtstringTimestamp when the message was created (ISO 8601)
messageIdstringWhatsApp message ID
statusstringCurrent delivery status of the message
messagestringThe message content
typestringThe channel type (e.g., whatsapp)
assetValuestringThe associated phone number or other identifier
failureReasonstringThe reason for failure, if applicable

Errors

Error CodeMeaning
400Invalid payload -- Your request is invalid.
401Unauthorized -- User is not authenticated.
404Not Found -- The specified API could not be found.
500Internal Server Error -- We had a problem with our server. Try again later.

Error response example:

{
"status": 200,
"success": true,
"data": {
"messages": [
{
"createdAt": null,
"message": "No messages found for the given messageIds"
}
]
}
}