When you tried to send a message to a WhatsApp number via API, you got success response but the message was not received at the destination number. There are many reasons which can make this happen, one of the common problems is that you are sending a message with session message type, but there's no opened session in your destination number.
Example of cURL Session Message type :
You cannot send that kind of message if the session has not been opened.
So, how to activate or open the session so you can send that message?
There are two ways a session can be opened:
- The customer initiates sending a message to the business number (CI)
If the customer starts the conversation first, you can directly reply with a session message.
- The business initiates sending a message to the customer, and the customer has to reply with a message to a business (BI)
Sending a message to a customer whose session hasn't been opened yet, you need to send a template message. The session won't be opened until the customer replies to your message.
Example of cURL Template Message Type:
Why is it different?
Because the price that will be charged is also different for each initiation scenario. Here's an article about the price you can refer to New WhatsApp Business API Pricing
How to check if a session has been opened for a specific WhatsApp number?
You can check whether the destination number has an active session or not using below cURL:
curl --location --request POST 'https://multichannel.qiscus.com/api/v2/wa_sessions/show' \
--header 'Content-Type: application/json' \
--header 'Qiscus-App-Id: your_appID' \
--header 'Qiscus-Secret-Key: your_secret_key' \
Example response if the destination number has an active session:
Example response if the destination number has no active session:
Please note. Another reason why your session message can't be received even though there is an active session is because the last message from the customer is more than 24 hours.