/
IMChannel: log inspection

IMChannel: log inspection

IMChannel

IMChannel is dedicated exclusively to interactions with the Infobip WhatsApp channel. It does not require a connection to MongoDB for settings, as these are provided directly by ctlive. However, it necessitates a connection to Redis, which serves as an in-memory database for storing information.

In the event that a WhatsApp message fails to generate a contact, or if outbound messages are undelivered, it is advisable to consult the IMChannel logs. This protocol applies to any other issues concerning individual WhatsApp messages.

Format

Logs display the function name in square brackets, followed by a specific message related to that function.

imchannel | [IMCHANNEL] [onMessage] Message received {"results":[{"from":"351927482662","to":"447860099299","integrationType":"WHATSAPP","receivedAt":"2025-02-27T15:44:57.000+0000","messageId":"wamid.HBgMMzUxOTI3NDgyNjYyFQIAEhggNEVERTc4NzZBNzJFNTYyRTJFQjZDQzQ3OTdDRTA0RjIA", "pairedMessageId":null,"callbackData":null,"message":{"text":"Oh well","type":"TEXT"},"contact":{"name":"Teresa Gomes"},"price":{"pricePerMessage":0,"currency":"SEK"}}],"messageCount":1,"pendingMessageCount":0}

Use Cases

Incoming Message

An incoming WhatsApp message from a customer is logged with the onMessage tag and follows this structure:

imchannel | [IMCHANNEL] [onMessage] Message received {"results":[{"from":"39123456789","to":"44123456789","integrationType":"WHATSAPP","receivedAt":"2025-02-27T15:44:57.000+0000","messageId":"wamid.HBgMMzUxOTI3NDgyNjYyFQIAEhggNEVERTc4NzZBNzJFNTYyRTJFQjZDQzQ3OTdDRTA0RjIA", "pairedMessageId":null,"callbackData":null,"message":{"text":"Oh well","type":"TEXT"},"contact":{"name":"Username1"},"price":{"pricePerMessage":0,"currency":"SEK"}}],"messageCount":1,"pendingMessageCount":0}

This log captures the complete message received from the provider, including the sender and recipient numbers, the timestamp, and the messageId, which is useful for direct verification on the Infobip portal in the history section.

Outbound Message

To locate the message payload sent to Infobip, search for the sendMessage tag:

imchannel | [IMCHANNEL] [sendMessage] request to [https://xxxx.api.infobip.com/omni/1/advanced] Data [{"scenarioKey":"AAAAAAAAAAAABC63903B684B3E46C5DD869","destinations":[{"to":{"phoneNumber":"39123456789"}}],"whatsApp":{"text":"Service Message - Chat Closed Success."}}] with api key header

This log reveals the complete message, including the URL (which varies for each Infobip account), the scenarioKey (unique to each WhatsApp number), and the WhatsApp message being sent.

Response

The Infobip response is logged as follows, indicating whether the message request has been accepted:

Outbound Multimedia Messages

Images, documents, and audio files sent to customers are delivered in a two-step process.

First Step: A message containing only metadata and a URL to retrieve the content, with the response coming from Infobip:

Second Step: Infobip retrieves the content of the multimedia file. The ID specified in the URL of the previous message (https://siotunnel.ei.eilabonline.biz/tenantname/imchannel/getImageMessage/bb8b8717-5b71-45a7-be04-af9cb746661b) is utilized.

Infobip always requests the same message twice, first using the HEAD method and then the GET method.

Related content

Channel API
Channel API
More like this
Infobip Whatsapp messages not generating a contact
Infobip Whatsapp messages not generating a contact
More like this