WhatsApp Business Cloud

Describe the problem/error/question

While using the WhatsApp business cloud, I have to use the option to send a template.
The optional templates and send phone number(or ID) are not extracted automatically from whatsapp, so I need to use expressions to call them, the sender phone number works fine, but when trying to use expression for the relevant template I need, I get an error, as n8n expects the template name but meta expects both template name and the language code. I wanted to check what is the right format for the expression as I couldn’t find it anywhere.

What is the error message (if any)?

Bad request - please check your parameters
The parameter template[‘language’][‘code’] is required.

Please share your workflow

{
“nodes”: [
{
“parameters”: {
“formTitle”: “צור קשר”,
“formDescription”: “צור איתנו קשר”,
“formFields”: {
“values”: [
{
“fieldLabel”: “הכנס את שמך”,
“placeholder”: “הכנס שם מלא”,
“requiredField”: true
},
{
“fieldLabel”: “הכנס טלפון נייד”,
“placeholder”: “הכנס נייד”,
“requiredField”: true
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.formTrigger”,
“typeVersion”: 2.2,
“position”: [
-880,
0
],
“id”: “4a6d840a-5559-4851-ac7d-c787921ad514”,
“name”: “On form submission”,
“webhookId”: “94c2a00b-0b46-4a3c-a72d-6e6e69d5ee19”
},
{
“parameters”: {
“operation”: “create”,
“base”: {
“__rl”: true,
“value”: “appcmLuCq5aFf2UUd”,
“mode”: “list”,
“cachedResultName”: “Main Table”,
“cachedResultUrl”: “Airtable
},
“table”: {
“__rl”: true,
“value”: “tbllz2PdnQiNO6OEa”,
“mode”: “list”,
“cachedResultName”: “לקוחות”,
“cachedResultUrl”: “Airtable
},
“columns”: {
“mappingMode”: “defineBelow”,
“value”: {},
“matchingColumns”: ,
“schema”: [
{
“id”: “Mobile”,
“displayName”: “Mobile”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “string”,
“readOnly”: false,
“removed”: false
},
{
“id”: “Full Name”,
“displayName”: “Full Name”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “string”,
“readOnly”: false,
“removed”: false
},
{
“id”: “דירות שהלקוח מחפש”,
“displayName”: “דירות שהלקוח מחפש”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “array”,
“readOnly”: false,
“removed”: false
},
{
“id”: “דירות שהלקוח מציע”,
“displayName”: “דירות שהלקוח מציע”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “array”,
“readOnly”: false,
“removed”: false
},
{
“id”: “Status”,
“displayName”: “Status”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “options”,
“options”: [
{
“name”: “השארת פרטים ראשונית”,
“value”: “השארת פרטים ראשונית”
},
{
“name”: “אובחן”,
“value”: “אובחן”
},
{
“name”: “ממתין להתאמה”,
“value”: “ממתין להתאמה”
},
{
“name”: “בתהליך”,
“value”: “בתהליך”
}
],
“readOnly”: false,
“removed”: false
},
{
“id”: “Notes”,
“displayName”: “Notes”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “string”,
“readOnly”: false,
“removed”: false
},
{
“id”: “Email”,
“displayName”: “Email”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “string”,
“readOnly”: false,
“removed”: false
},
{
“id”: “Gender”,
“displayName”: “Gender”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “options”,
“options”: [
{
“name”: “זכר”,
“value”: “זכר”
},
{
“name”: “נקבה”,
“value”: “נקבה”
},
{
“name”: “אחר”,
“value”: “אחר”
},
{
“name”: “מעדיף לא להגיד”,
“value”: “מעדיף לא להגיד”
}
],
“readOnly”: false,
“removed”: false
},
{
“id”: “Record ID”,
“displayName”: “Record ID”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “string”,
“readOnly”: true,
“removed”: true
}
],
“attemptToConvertTypes”: false,
“convertFieldsToString”: false
},
“options”: {}
},
“type”: “n8n-nodes-base.airtable”,
“typeVersion”: 2.1,
“position”: [
-460,
0
],
“id”: “38294e37-b337-4abd-bdb5-b1e2f4253504”,
“name”: “Airtable4”,
“credentials”: {
“airtableTokenApi”: {
“id”: “oupGlIcLSgkhGI35”,
“name”: “Airtable 2 Token”
}
}
},
{
“parameters”: {
“phoneNumberId”: “={{ 588461694344563 }}”,
“recipientPhoneNumber”: “={{ "972"+$json[‘הכנס טלפון נייד’] }}”,
“template”: “=={{ { name: "nadlanist", language: { code: "he" } } }}”,
“requestOptions”: {}
},
“type”: “n8n-nodes-base.whatsApp”,
“typeVersion”: 1,
“position”: [
-700,
0
],
“id”: “a1baebe5-1638-4d32-bcc7-df332aa047cb”,
“name”: “WhatsApp Business Cloud”,
“credentials”: {
“whatsAppApi”: {
“id”: “CehGhjw9abnhtWMD”,
“name”: “WhatsApp Final permament”
}
}
}
],
“connections”: {
“On form submission”: {
“main”: [
[
{
“node”: “WhatsApp Business Cloud”,
“type”: “main”,
“index”: 0
}
]
]
},
“Airtable4”: {
“main”: [

]
},
“WhatsApp Business Cloud”: {
“main”: [
[
{
“node”: “Airtable4”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “100f47e41e7242bfa8d07ad6be06d9b4ff3a4f6965d2e470dfe2de5637fcddb4”
}
}

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Eyal_Jacoby_Miller,

The documentation you need is here:

The JSON would look something like this:

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "template",
  "template": {
    "name": "TEMPLATE_NAME",
    "language": {
      "code": "LANGUAGE_CODE"
    },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "image",
            "image": {
              "link": "IMAGE_URL"
            }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "TEXT_PARAMETER"
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "quick_reply",
        "index": "0",
        "parameters": [
          {
            "type": "payload",
            "payload": "BUTTON_PAYLOAD"
          }
        ]
      }
    ]
  }
}

Also take a look at this template for a working example:

If my reply answers your question, please remember to mark it as a solution.

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