Notifique Elixir SDK

English · Português · Docs: docs.notifique.dev


English

Server-side Notifique SDK for Elixir (v0.2.1).

Install

{:notifique, "~> 0.2.1"}

Then mix deps.get.

Quick start

client = Notifique.new("your-api-key")
{:ok, body} = Notifique.Whatsapp.send_text(client, "instance-id", ["5511999999999"], "Hello!")
IO.inspect(body["data"]["messageIds"])

Send SMS

Notifique.Sms.send(client, %{"to" => ["5511999999999"], "message" => "Hello SMS!"})

Send by channel

ChannelExample
WhatsAppNotifique.Whatsapp.send_text(client, instance_id, to, "Hello!")
SMSNotifique.Sms.send(client, %{...})
EmailNotifique.Email.send(client, %{...})
PushNotifique.Push.send_message(client, %{...})
TelegramNotifique.TypedApi.Telegram.post_v1_telegram_send(telegram, body: %{...})
InstagramNotifique.TypedApi.Instagram.send_message(instagram, body: %{...})
RCSNotifique.TypedApi.Rcs.post_v1_rcs_send(rcs, body: %{...})
VoiceNotifique.TypedApi.Voice.post_v1_voice_calls(voice, body: %{...})

Use api = Notifique.api(client) then Notifique.TypedApi.telegram(api) for typed API namespaces.

Webhooks & logs

api = Notifique.api(client)
Notifique.TypedApi.Webhooks.list_webhooks(Notifique.TypedApi.webhooks(api), opts: [query: %{"limit" => "20"}])
Notifique.TypedApi.Logs.get_v1_logs(Notifique.TypedApi.logs(api), opts: [query: %{"page" => "1"}])

Errors

Returns {:ok, body} or {:error, %{status: code, body: body}}.


Português

SDK server-side Notifique para Elixir (v0.2.1).

Instalação

{:notifique, "~> 0.2.1"}

Depois mix deps.get.

Início rápido

client = Notifique.new("sua-api-key")
{:ok, body} = Notifique.Whatsapp.send_text(client, "instance-id", ["5511999999999"], "Olá!")
IO.inspect(body["data"]["messageIds"])

Enviar SMS

Notifique.Sms.send(client, %{"to" => ["5511999999999"], "message" => "Olá SMS!"})

Enviar por canal

CanalExemplo
WhatsAppNotifique.Whatsapp.send_text(client, instance_id, to, "Olá!")
SMSNotifique.Sms.send(client, %{...})
EmailNotifique.Email.send(client, %{...})
PushNotifique.Push.send_message(client, %{...})
TelegramNotifique.TypedApi.Telegram.post_v1_telegram_send(telegram, body: %{...})
InstagramNotifique.TypedApi.Instagram.send_message(instagram, body: %{...})
RCSNotifique.TypedApi.Rcs.post_v1_rcs_send(rcs, body: %{...})
VozNotifique.TypedApi.Voice.post_v1_voice_calls(voice, body: %{...})

Use api = Notifique.api(client) e Notifique.TypedApi.telegram(api) para namespaces tipados.

Webhooks e logs

api = Notifique.api(client)
Notifique.TypedApi.Webhooks.list_webhooks(Notifique.TypedApi.webhooks(api), opts: [query: %{"limit" => "20"}])
Notifique.TypedApi.Logs.get_v1_logs(Notifique.TypedApi.logs(api), opts: [query: %{"page" => "1"}])

Erros

Retorna {:ok, body} ou {:error, %{status: code, body: body}}.