# WhatsappApi

Cliente para comunicar con el servicio de Whatsapp

## Installation

If [available in Hex](, the package can be installed
by adding `whatsapp_api` to your list of dependencies in `mix.exs`:

def deps do
    {:wax, "~> 0.4.1}

Setup default parser in `config.ex`

config :whatsapp_api, parser: Whatsapp.Parser

## Using GenServer Auth

defmodule MyApp.Application do
  use Application

  alias Whatsapp.Models.WhatsappProvider

  # See
  # for more information on OTP Applications
  def start(_type, _args) do
    import Supervisor.Spec

    children = [
      worker(Whatsapp.Auth.Server, [[
          name: "My company",
          url: "",
          username: "username",
          password: "password"

    opts = [strategy: :one_for_one, name: MyApp.Supervisor]
    Supervisor.start_link(children, opts)

Now you can use the provider name to authenticate

iex> %{"contacts" => [%{"wa_id" => wa_id}] = WhatsappApi.check("5566295500", "My company")
iex> message = wa_id, body: "Hi!")
iex> WhatsappApi.send(message, "My company")

## Without GenServer Auth

iex> message = "wa_id", body: "Hi!")
iex> auth_header = [{"Authorization", "Bearer #{token}"}]
iex> Whatsapp.Api.Messages.send({"", auth_header, message)

Documentation can be generated with [ExDoc](
and published on [HexDocs]( Once published, the docs can
be found at [](