nexmo-elixir

An experimental Elixir client library for Nexmo

MIT License

Downloads
684
Stars
6

Nexmo Elixir Client Library

This is a work in progress Elixir client library for Nexmo. Functionality will be added for each Nexmo API service. Currently, this library supports the Account, Applications, Number Insight and SMS Nexmo APIs.

Installation

Hex

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

def deps do
  [
    {:nexmo, "~> 0.4.0", hex: :nexmo_elixir}
  ]
end

Environment Variables

The client library requires environment variables to be supplied in order to enable its functionality. You can find a sample .env file in the root directory of the project. You need to supply your API credentials and the host names for the API endpoints in the .env file.

Your Nexmo API credentials:

  • NEXMO_API_KEY
  • NEXMO_API_SECRET

API host names:

  • ACCOUNT_API_ENDPOINT="https://rest.nexmo.com/account"
  • NUMBER_INSIGHT_API_ENDPOINT="https://api.nexmo.com/ni"
  • SECRETS_API_ENDPOINT="https://api.nexmo.com/accounts"
  • SMS_API_ENDPOINT="https://rest.nexmo.com/sms/json"

Documentation

Testing

The tests for Nexmo Elixir can be found in /test/. Each API service has its own testing suite and can be found in /test/#{name_of_service}, for example the SMS tests can be found in /test/sms. To run the testing suite execute mix test from the command line.

Appreciation

This project is built utilizing the wisdom and experience of earlier Nexmo Elixir projects, including from KindyNowApp, cbetta and adamrobbie. Thank you all for your examples of interacting with Nexmo using Elixir!

License

This project is licensed under the MIT License.