Coder Social home page Coder Social logo

piusalfred / whatsapp Goto Github PK

View Code? Open in Web Editor NEW
28.0 3.0 4.0 17.2 MB

golang wrapper for whatsapp cloud api

License: MIT License

Makefile 0.17% Go 99.83%
bot whatsapp whatsapp-api whatsapp-bot whatsapp-clo whatsapp-api-go whatsapp-cloud-api-client

whatsapp's Introduction

whatsapp

NOTE: This is a work in progress. The API is not yet stable and is subject to change.

implemented

  • send text message
  • send image message
  • send location message
  • send contact message
  • send template message
  • react to message
  • mark message as read
  • webhooks

SETUP

pre requisites

To be able to test/use this api you need Access Token, Phone number ID and Business ID. For that tou need to register as a Meta Developer. You can register here https://developers.facebook.com/docs/development/register

Then create an application here https://developers.facebook.com/docs/development/create-an-app and configre it to enable access to WhatsApp Business Cloud API.

You can manage your apps here https://developers.facebook.com/apps/

From Whatsapp Developer Dashboard you can try and send a test message to your phone number. to be sure that everything is working fine before you start using this api.

When all the above is done you can start using this api.

whatsapp's People

Contributors

bcmmbaga avatar piusalfred avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

whatsapp's Issues

Index value is omitted on request payload, if index value is 0.

I am passing button with index 0 in template message but in request payload its omitted.

buttonParams := []*models.TemplateParameter{{
	Type: "text",
	Text: "1234",
}}
components := []*models.TemplateComponent{
	{
	    Type:       "button",
	    SubType:    "url",
	    Index:      0,
	    Parameters: buttonParams,
	},
}

Generated payload

{"messaging_product":"whatsapp","to":"+***********","recipient_type":"individual","type":"template","template":{"name":"templ1","language":{"code":"en_US"},"components":[{"type":"button","sub_type":"url","parameters":[{"type":"text","text":"1234"}]}]}}

I debugged issue and found that its because of `omitempty` defined in TemplateComponent struct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.