Bandwidth.Resources.Applications
The Applications resource lets you define call and message handling applications. You write an application on your own servers and have Bandwidth API send events to it by configuring a callback URL.
Summary↑
create(client, application) | Create an application |
delete(client, id) | Delete an application |
find(client, id) | Get information about an application |
list(client, params \\ []) | Get a list of your applications |
update(client, id, application) | Make changes to an application |
Functions
Specs:
- create(Client.t, Map.t) :: Client.response
Create an application.
Example:
application = %{ name: "my-awesome-app" }
case Bandwidth.Resources.Applications.create(client) do
{:ok, {201, _, _}} -> IO.puts "Application created"
{:error, reason} -> IO.puts "Error: #{reason}"
end
Specs:
- delete(Client.t, binary) :: Client.response
Delete an application.
Example:
case Bandwidth.Resources.Applications.delete(client, "some-application-id") do
{:ok, {200, _, _}} -> IO.puts "Application deleted"
{:error, reason} -> IO.puts "Error: #{reason}"
end
Specs:
- find(Client.t, binary) :: Client.response
Get information about an application.
Example:
case Bandwidth.Resources.Applications.find(client, "some-application-id") do
{:ok, {200, application, _}} -> IO.inspect application
{:ok, {404, _, _}} -> IO.puts "Application not found"
{:error, reason} -> IO.puts "Error: #{reason}"
end
Specs:
- list(Client.t, Client.params) :: Client.response
Get a list of your applications.
Example:
case Bandwidth.Resources.Applications.list(client) do
{:ok, {200, applications, _}} -> IO.inspect applications
{:error, reason} -> IO.puts "Error: #{reason}"
end
Specs:
- update(Client.t, binary, Map.t) :: Client.response
Make changes to an application.
Example:
application = %{ incomingCallUrl: "https://foo.com/calls" }
case Bandwidth.Resources.Applications.update(client, "some-application-id", application) do
{:ok, {200, _, _}} -> IO.puts "Application updated"
{:error, reason} -> IO.puts "Error: #{reason}"
end