DEV Community

Cover image for Using TextBelt SMS with Elixir
Byron Salty
Byron Salty

Posted on • Edited on

Using TextBelt SMS with Elixir

I was recently introduced to the SMS service TextBelt which is a pre-pay and simplified service to provide the ability to send and receive SMS messages from code.

However, the site did not provide any examples of how to connect their service with projects coded in Elixir.

Sending SMS with TextBelt and Elixir

    # Add HTTPoison and Poison to your project dependencies
    params = %{
      phone: "5555555555",
      message: "Hello, world!",
      key: "textbelt"
    }

    HTTPoison.post(post_url, 
      Poison.encode!(params), 
      [{"Content-type", "application/json"}])
Enter fullscreen mode Exit fullscreen mode

Top comments (0)