Skip to main content

Fetch messages by IDs

You can use the fetch messages by ID API to get the message IDs.

Request parameters

NameTypeRequired/OptionalDescription
messageIdsstring[]RequiredList of message ids

Request Information

CategoryValue
Http requestPOST
URLhttps://bikapi.bikayi.app/integrations/bikPlatformFunctions-message/fetchMessagesById
curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-message/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
statusnumberResponse status
successbooleanIs successful response or not
dataBikPlatformMessage[]List of messages if found

BikPlatformMessage Type

NameTypeDescription
idstringMessage ID
createdAtstringMessage created date
messageIdstringWhatsapp message ID
statusstringMessage status
messagestringMessage details
typestringMessage type
assetValuestringPhone number or any other details
failureReasonstringFailed reason if any

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"
}
]
}
}