Send a Whatsapp Campaign

With the Routee Whatsapp API you can send Campaign messages to your customers in a number of ways:

{
    "from": "WABAphone",
    "to":  "recipientPhone",
    "body": {
        "text": "hi!"
    }
}
{
    "from": "WABAphone",
    "to": "recipientPhone",
    "body": {
        "caption": "Caption paired with imageURL, documentURL, videoURL",
        "imageURL": "https://cdn.mycdn/image.png"
    }
}
{
    "from": "WABAphone",
    "to": "recipientPhone",
    "body": {
        "caption": "Caption paired with imageURL, documentURL, videoURL",
        "videoURL": "https://cdn.mycdn/video.wav"
    }
}
{
    "from": "WABAphone",
    "to": "recipientPhone",
    "body": {
        "audioURL": "https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.mp4"
    }
}
{
    "from": "WABAphone",
    "to": "recipientPhone",
    "body": {
        "stickerURL": "https://i.morioh.com/200819/34781d77.webp"
    }
}
{
    "from": "WABAphone",
    "to": "recipientPhone",
    "body": {
        "longitude": -30,
        "latitude": 30,
        "locationName": "hey 🏖️! check this ",
        "locationAddress": "my address"
    }
}
{
    "from": "WABAphone",
    "to": "recipientPhone",
    "body": {
        "documentURL": "https://www.worlddocument.org/sites/default/files/gallery/documents/1496495/dc7b0062bd68eef78918a4f1efba3aba.At%2520The%2520Shack%2520%25232.doc",
        "caption": "Doc title", 
        "filename": "1496495/dc7b0062bd68eef78918a4f1efba3aba.At%2520The%2520Shack%2520%25232.doc"
    }
}
{
  "from": "WABAphone",
  "to": "recipientPhone",
  "body": {
    "template":{
            "templateId":"account_verification",
              "language": {
                "code": "en"
            },
            "parameters": [
                {
                "default": "verification"
                },
                {
                "default": "878778"
                }
            ]
        }
    }
}
{
  "from": "WABAphone",
  "to": "recipientPhone",
    "body": {
    "template":{
            "templateId" : "pickup_point",
              "language": {
                "code": "en"
            },
            "components": [
        {
            "type" : "header",
            "parameters" : [
                {
              "type": "location",
              "location": {
                "latitude": 51.5005765,
                "longitude": 7.4954884
              }
            }
            ]
        },
        {
            "type": "body",
            "parameters": [
            {
              "type" : "text",
              "text": "text 1"
            },
            {
               "type" : "text",
              "text": "text 2"
            },
            {
                "type": "text",
              "text": "text 3"
            }
          ]
        }
    ]
        }
    }
}
{
  "from": "WABAphone",
  "to": "recipientPhone",
  "body": {
    "template":{
        "templateId" : "event_rating",
          "language": {
                "code": "en"
            },
    "components": [
        {
            "type" : "body",
            "parameters" : [
                {
              "type": "text",
              "text": "text 1"
            },
            {
              "type": "text",
              "text": "text 2"
            }
            ]
        },
        {"type" : "button",
           "subType" : "quick_reply",
           "index": 0,
           "parameters" : [{"type":"payload", "payload": "event-id-1233"}]        
        },
        {"type" : "button",
           "subType" : "quick_reply",
           "index": 1,
           "parameters" : [{"type":"payload", "payload": "event-id-1233"}]        
        },
        {"type" : "button",
           "subType" : "quick_reply",
           "index": 2,
           "parameters" : [{"type":"payload", "payload": "event-id-1233"}]        
        }
    ]
    }
  }
}
{
  "from": "WABAphone",
  "to": "recipientPhone",
  "body": {
    "template":{
        "templateId" : "parcel_storage_place",
          "language": {
                "code": "en"
            },
        "components": [
        {
            "type" : "header",
            "parameters" : [
                {
              "type": "media",
              "media": {
                "url": "https://www.publicdomainpictures.net/pictures/70000/velka/parcel-1384599612Lor.jpg",
                "type": "image"
              }
            }
            ]
        },
        {
            "type": "body",
            "parameters": [
            {
              "type" : "text",
              "text": "Peter"
            },
            {
               "type" : "text",
              "text": "123"
            }
          ]
        }
    ]
    }
  }
}
{
  "from": "WABAphone",
  "to": "recipientPhone",
  "body": {
    "template":{
        "templateId" : "issue_solved",
          "language": {
                "code": "en"
            },
    "components": [
        {
            "type" : "body",
            "parameters" : [
                {
              "type": "text",
              "text": "Peter"
            },
            {
              "type": "text",
              "text": "with your dishwasher"
            }
            ]
        },
        {"type" : "button",
           "subType" : "url",
           "index": 0,
           "parameters" : [{"type" :"text", "text" : "224f1bb5-1cda-48b0-997f-0cf73b00a4df"}]       
        }
    ]
    }
  }
}

In the above example the Template also contains a Button that performs a call, this particular button is declared only when submitting for a template. When using the template the button is not added at all.

{
  "from": "WABAphone",
  "to": "recipientPhone",
  "body": {
    "template":{
        "templateId" : "menu",
          "language": {
                "code": "en"
            },
    "components": [
        {
            "type" : "header",
            "parameters" : [
                {
              "type": "media",
              "media": {
                "url": "https://cdn.glitch.com/8098eb51-b92c-45a4-ac8b-9ed130b8eb5b%2FPersona-Template.pdf?v=1603960154638",
                "type": "document",
                "filename": "tyntec background.pdf"
              }
            }
            ]
        },
        {
            "type": "body",
            "parameters": [
            {
              "type" : "text",
              "text": "Peter"
            }
          ]
        }
    ]
    }
  }
}
{
  "from": "WABAphone",
  "to": "recipientPhone",
  "body": {
    "template":{
        "templateId" : "instructions",
          "language": {
                "code": "en"
            },
    "components": [
        {
            "type" : "header",
            "parameters" : [
                {
              "type": "media",
              "media": {
                "url": "https://cdn.glitch.com/8098eb51-b92c-45a4-ac8b-9ed130b8eb5b%2Fvideo.mp4?v=1589446343732",
                "type": "video"
              }
            }
            ]
        },
        {
            "type": "body",
            "parameters": [
            {
              "type" : "text",
              "text": "Peter"
            }
          ]
        }
    ]
    }
  }
}
{
  "from": "WABAphone",
  "to": "recipientPhone",
  "body": {
    "template":{
        "templateId" : "surveilance_report",
          "language": {
                "code": "en"
            },
    "components": [
        {
            "type" : "header",
            "parameters" : [
                {
              "type": "media",
              "media": {
                "url": "https://cdn.glitch.com/8098eb51-b92c-45a4-ac8b-9ed130b8eb5b%2Fvideo.mp4?v=1589446343732",
                "type": "video"
              }
            }
            ]
        },
        {
            "type": "body",
            "parameters": [
            {
              "type" : "text",
              "text": "Peter"
            },
            {
              "type" : "text",
              "text": "Factory one"
            }
          ]
        },
        {"type" : "button",
           "subType" : "quick_reply",
           "index": 0,
           "parameters" : [{"type":"payload", "payload": "event-id-1233"}]        
        },
        {"type" : "button",
           "subType" : "quick_reply",
           "index": 1,
           "parameters" : [{"type":"payload", "payload": "event-id-1233"}]        
        },
        {"type" : "button",
           "subType" : "quick_reply",
           "index": 2,
           "parameters" : [{"type":"payload", "payload": "event-id-1233"}]        
        }
    ]
    }
  }
}