Fetch messages by IDs
Use the Fetch Messages by ID API to retrieve message details for one or more message IDs.
Request parameters
| Name | Type | Required/Optional | Description |
|---|---|---|---|
messageIds | string[] | Required | An array of message IDs to look up |
Request Information
| Category | Value |
|---|---|
| Http request | POST |
| URL | https://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
| Name | Type | Description |
|---|---|---|
status | number | HTTP status code |
success | boolean | Indicates whether the request succeeded |
data | BikPlatformMessage[] | Array of matching message objects |
BikPlatformMessage type
| Name | Type | Description |
|---|---|---|
id | string | Internal message ID |
createdAt | string | Timestamp when the message was created (ISO 8601) |
messageId | string | WhatsApp message ID |
status | string | Current delivery status of the message |
message | string | The message content |
type | string | The channel type (e.g., whatsapp) |
assetValue | string | The associated phone number or other identifier |
failureReason | string | The reason for failure, if applicable |
Errors
| Error Code | Meaning |
|---|---|
| 400 | Invalid payload -- Your request is invalid. |
| 401 | Unauthorized -- User is not authenticated. |
| 404 | Not Found -- The specified API could not be found. |
| 500 | Internal 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"
}
]
}
}