Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on sending messages #36

Closed
hamadmj opened this issue May 11, 2016 · 3 comments
Closed

Error on sending messages #36

hamadmj opened this issue May 11, 2016 · 3 comments

Comments

@hamadmj
Copy link

hamadmj commented May 11, 2016

I keep getting this error when attempting to create a message. I'd appreciate some guidance.

iex(11)> ExTwilio.Message.create(%{from: "+14782200451", to: "xxx", body: "test"})
** (HTTPotion.HTTPError) {:EXIT, {:function_clause, [{:ibrowse, :ensure_bin, [%{body: "test", from: "+14782200452", to: "xxx"}], [file: 'src/ibrowse.erl', line: 522]}, {:ibrowse, :do_send_req, 7, [file: 'src/ibrowse.erl', line: 475]}, {:ibrowse, :try_routing_request, 14, [file: 'src/ibrowse.erl', line: 366]}, {ExTwilio.Api, :request, 3, [file: 'lib/ex_twilio/api.ex', line: 19]}, {ExTwilio.Api, :create, 3, [file: 'lib/ex_twilio/api.ex', line: 65]}, {:erl_eval, :do_apply, 6, [file: 'erl_eval.erl', line: 670]}, {:elixir, :erl_eval, 3, [file: 'src/elixir.erl', line: 215]}, {:elixir, :eval_forms, 4, [file: 'src/elixir.erl', line: 203]}, {IEx.Evaluator, :handle_eval, 6, [file: 'lib/iex/evaluator.ex', line: 135]}, {IEx.Evaluator, :do_eval, 4, [file: 'lib/iex/evaluator.ex', line: 128]}, {IEx.Evaluator, :eval, 4, [file: 'lib/iex/evaluator.ex', line: 108]}, {IEx.Evaluator, :loop, 3, [file: 'lib/iex/evaluator.ex', line: 27]}, {IEx.Evaluator, :init, 3, [file: 'lib/iex/evaluator.ex', line: 18]}]}}
    lib/ex_twilio/api.ex:19: ExTwilio.Api.handle_response/1
    lib/ex_twilio/api.ex:65: ExTwilio.Api.create/3
@danielberkompas
Copy link
Owner

Have you followed all the installation steps in the README? In particular, have you added :ex_twilio to the list of applications in your mix.exs file?

@techgaun
Copy link
Contributor

@hamadmj pretty sure you are sending data in incorrect format.
Try the following

data = [
      from: "+1...",
      to: "+1...",
      body: "Test msg"
    ]
ExTwilio.Message.create(data)

@danielberkompas
Copy link
Owner

@hamadmj @techgaun is correct. Let me know if you continue to have problems with this. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants