Socket
Socket
Sign inDemoInstall

github.com/masewo/whatsapp-cloud-api

Package Overview
Dependencies
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/masewo/whatsapp-cloud-api


Version published

Readme

Source

Whatsapp Cloud API Wrapper for Golang

About

Lightweight Whatsapp Cloud API Wrapper v14.0 for Golang with no dependency.

Made this cause I haven't found any reliable whatsapp cloud api wrapper for golang

Content

  • Install
  • Usage
  • Getting the Whatsapp Cloud API Access
  • FAQ
  • Usage

Install

go get github.com/febriliankr/whatsapp-cloud-api

or if you want to use specific version

go get github.com/febriliankr/whatsapp-cloud-api@v1.0.2

Usage

Create an instance of the Whatsapp Cloud API Client

wa := whatsapp.NewWhatsapp(token, myPhoneID)

Modifying instance

  • Changing the language wa.Language = TemplateLanguage{ Code: "id" }
  • Changing the API version wa.APIVersion = "v14.0"
  • Changing the Whatsapp Phone ID wa.PhoneNumberID = WHATSAPP_PHONE_ID

Send a templated message

With one parameter

parameters := wa.GenerateTemplateParameters("text", "48884")
components := wa.TemplateComponent("body", parameters)
res, err := wa.SendWithTemplate("RECEIVER_PHONE_NUMBER", "your_template_name", components)

with no parameter

res, err := wa.SendWithTemplate("RECEIVER_PHONE_NUMBER", "your_template_name", nil)

Send a plain text message

Sending plain text message to a phone number that has messaged your WhatsApp Business account in the past 24 hours.

res, err := wa.SendText("RECEIVER_PHONE_NUMBER", "your_message")

Check more usage example in example/example.go

Getting the Whatsapp Cloud API Access

Official documentation:

FAQ

Tutorial for Myself!

Releasing new version

$ git commit -m "hello: changes for v1.0.0"
$ git tag v1.0.0
$ git push origin v1.0.0

FAQs

Last updated on 22 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc