Huge news!Announcing our $20M Series A led by Andreessen Horowitz.Learn more
Socket
Socket
Log inDemoInstall

github.com/masewo/whatsapp-cloud-api

Package Overview
Dependencies
1
Maintainers
0
Issues
File Explorer

github.com/masewo/whatsapp-cloud-api

    v0.0.0-20230122212550-3a56b9191620

Version published
Maintainers
0

Readme

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 installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install
SocketSocket SOC 2 Logo

Product

  • Package Issues
  • 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