Skip to content

Latest commit

 

History

History
58 lines (46 loc) · 1.64 KB

README.md

File metadata and controls

58 lines (46 loc) · 1.64 KB

Websms

GitHub license .github/workflows/elixir.yml Hex.pm Version Coverage Status

websms.ch client

Installation

The package can be installed by adding websms to your list of dependencies in mix.exs:

def deps do
  [
    {:websms, "~> 0.1.0"}
  ]
end

Usage

Send Text Message

{:ok,
  {200, %{smsCount: 0, statusCode: 2000, statusMessage: "OK", transferId: _}, _client}} =
    Websms.post_smsmessaging_text(%{
      body: %{
        messageContent: "Test",
        test: true,
        recipientAddressList: ["+41787245790"]
      },
      headers: %{"authorization" => "Bearer #{@auth_token}"}
    })

Send Binary Message

{:ok,
  {200, %{smsCount: 0, statusCode: 2000, statusMessage: "OK", transferId: _}, _client}} =
    Websms.post_smsmessaging_binary(%{
      body: %{
        messageContent: [Base.encode64("Test")],
        test: true,
        recipientAddressList: ["+41787245790"]
      },
      headers: %{"authorization" => "Bearer #{@auth_token}"}
    })

Documentation can be generated with ExDoc and published on HexDocs. The docs can be found at https://hexdocs.pm/websms.