1.0.12 • Published 2 years ago

pinnacle_whatsapp_plugin v1.0.12

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago
   npm install pinnacle_whatsapp_plugin
const pinnacle= require('pinnacle_whatsapp_plugin');
const apikey  = "<Your API Key>";
{
  "from": "<Your Waba Number>",
  "to": "<Contact Number>",
  "type": "text",
  "message": {
    "text": "<Msg>"
  }
}
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "image",
  "message": {
    "url": "<image url>",
    "caption": "<caption>",
    "filename": "<filename>"
  }
}
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "video",
  "message": {
    "url": "<video url>",
    "caption": "<caption>",
    "filename": "<filename>"
  }
}
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "interactive",
  "message": {
    "interactive": {
      "type": "list",
      "header": {
        "type": "text",
        "text": "Test Header"
      },
      "body": {
        "text": "msgtext"
      },
      "footer": {
        "text": "Test Footer"
      },
      "action": {
        "button": "Button1",
        "sections": [
          {
            "title": "Section1",
            "rows": [
              {
                "id": "1",
                "title": "Row1",
                "description": "Desc1"
              }
            ]
          },
          {
            "title": "Section2",
            "rows": [
              {
                "id": "2",
                "title": "Row2",
                "description": "Desc2"
              }
            ]
          }
        ]
      }
    }
  }
}
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "interactive",
  "message": {
    "interactive": {
      "type": "button",
      "header": {
        "type": "text",
        "text": "this is header"
      },
      "body": {
        "text": "this is body"
      },
      "footer": {
        "text": "this is footer"
      },
      "action": {
        "buttons": [
          {
            "type": "reply",
            "reply": {
              "id": "1",
              "title": "Button 1"
            }
          },
          {
            "type": "reply",
            "reply": {
              "id": "2",
              "title": "Button 2"
            }
          }
        ]
      }
    }
  }
}
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "contact",
  "message": {
    "contacts": {
      "name": {
        "first_name": "<first_name>",
        "last_name": "<last_name>"
      },
      "phones": [
        {
          "phone": "<phone>",
          "type": "<type>"
        },
        {
          "phone": "<phone>",
          "type": "<type>"
        }
      ]
    }
  }
}
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "location",
  "message": {
    "longitude": "<longitude>",
    "latitude": "<latitude>",
    "name": "<location name>",
    "address": "<loaction address>"
  }
}
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "sticker",
  "message": {
    "url": "<sticker URL>",
    "caption": "Test Sticker",
    "filename": "<filename>"
  }
}
   pinnacle.send_session_msg (apikey, Payload).then((repositories) => {
       console.log(repositories)
    });
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "template",
  "message": {
    "templateid": "<template id>",
    "placeholders": ["<placeholders>"]
  }
}
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "template",
  "message": {
    "templateid": "<template id>",
    "url": "<image url>",
    "placeholders": ["<placeholders>"]
  }
}
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "template",
  "message": {
    "templateid": "<template id>",
    "url": "<video url>",
    "placeholders": ["<placeholders>"]
  }
}
{
  "from": "<wabanumber>",
  "to": "<contact number>",
  "type": "template",
  "message": {
    "templateid": "<template id>",
    "url": "<document url>",
    "placeholders": ["<placeholders>"]
  }
}
   pinnacle.send_template_msg (apikey, Payload).then((repositories) => {
       console.log(repositories)
    });
{
  "code": "200",
  "status": "SUCCESS",
  "message": "Message Processed Successfully",
  "data": {
    "messageid": "<messageid>"
  }
}