gabrieldwight / Whatsapp-Business-Cloud-Api-Net

This is C# wrapper of whatsapp business cloud api for .NET
MIT License
283 stars 104 forks source link

New Authentication Messages not supported #44

Closed borrmann closed 1 year ago

borrmann commented 1 year ago

The WhatsApp Cloud API for sending authentication messages has changed and I think authentication messages are not supported with current version anymore. Here is the link to the docs how a authentication message looks like now:

WhatsApp Cloud Docu

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "<CUSTOMER_PHONE_NUMBER>",
  "type": "template",
  "template": {
    "name": "<TEMPLATE_NAME>",
    "language": {
      "code": "<TEMPLATE_LANGUAGE_CODE>"
    },
    "components": [
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "<ONE-TIME PASSWORD>"
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "url",
        "index": "0",
        "parameters": [
          {
            "type": "text",
            "text": "<ONE-TIME PASSWORD>"
          }
        ]
      }
    ]
  }
}

The TextMessageComponent currently only takes TextMessageParameters, but to send a one-time password other options should be addable to the List of TextMessageComponents

gabrieldwight commented 1 year ago

I will add implementation for the authentication message template with the new change.

gabrieldwight commented 1 year ago

Added the implementation of the authentication message template

image