Message text cannot be sent with messengerType <whatsapp>

Good afternoon,

I am trying to send an agentless outbound message through API, but I am getting a 400 error that I cannot investigate due to the lack of information.

API endpoint:

/api/v2/conversations/messages/agentless

The body of the request:

{
  "fromAddress": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "toAddress": "XXXXXXXXXXX",
  "toAddressMessengerType": "whatsapp",
  "textBody": "Testing",
  "useExistingActiveConversation": false
}

Response:

{
    "message": "Bad request: Message text cannot be sent with messengerType <whatsapp>",
    "code": "bad.request",
    "status": 400,
    "messageWithParams": "Bad request: {details}",
    "messageParams": {
        "details": "Message text cannot be sent with messengerType <whatsapp>"
    },
    "contextId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "details": [],
    "errors": []
}

I think the body is fine and I don't know how to proceed. Can you help me?

Thanks!

Hi,

Can you please doublecheck the format of your toAddress format and make sure you are not using an e164 type.

The messaging address of the recipient of the message. For an SMS messenger type, the phone number address must be in E.164 format. E.g. +13175555555 or +34234234234. For WhatsApp messenger type, use a WhatsApp ID of a phone number. E.g for a E.164 formatted phone number +13175555555, a WhatsApp ID would be 13175555555

If that is correct, I am afraid you will need to open a Care ticket. We can't diagnose individual customer errors if the body looks correct. The Care team would need to open a ticket.

Thanks,
John Carnell
Director, Developer Engagement.

Hi,

I confirm that the format of the toAddress field value is correct. I'm going to open a ticket to Care as you suggest.

Thank you.

Hi @mr.Adevinto you cannot use textBody with Whatsapp agentless API for customer outreach. This is a limitation on Whatsapp side. you would need to use messagingTemplate instead. Please see the doc on the api explorer https://apicentral.genesys.cloud/api-explorer#post-api-v2-conversations-messages-agentless

messagingTemplate
(MessagingTemplateRequest) The messaging template to use in the case of WhatsApp messenger type. This field is required when using WhatsApp messenger type.

Also please see Add a WhatsApp template message - Genesys Cloud Resource Center for more information on template setup

Hello,

Indeed textBody does not work for this type of message and neither does a Standard canned response. Finally I tried with a Message template response type and it worked.

Thanks for the answers!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.