Bandwidth.Resources.Domains.Endpoints
An Endpoint resource represents an entity that can register with the Application Platform SIP Registrar and place and receive calls. This can be a device like a phone or a pad, or it can be a softphone on a computer.
Summary↑
create(client, domain_id, endpoint) | Create an endpoint associated with the specified domain |
delete(client, domain_id, endpoint_id) | Delete a specific endpoint |
find(client, domain_id, endpoint_id) | Get information about a specific endpoint |
list(client, domain_id) | Get a list of endpoints associated with a domain |
Functions
Specs:
- create(Client.t, binary, Map.t) :: Client.response
Create an endpoint associated with the specified domain.
Example:
endpoint = %{
name: "test-device",
description: "this is a test",
domain_id: "some-domain-id",
application_id: "some-application-id",
enabled: true,
credentials: {
password: "some-password"
}
}
case Bandwidth.Resources.Domains.Endpoints.create(client, "some-domain-id", endpoint) do
{:ok, {201, _, _}} -> IO.puts "Endpoint created"
{:error, reason} -> IO.puts "Error: #{reason}"
end
Specs:
- delete(Client.t, binary, binary) :: Client.response
Delete a specific endpoint.
Example:
case Bandwidth.Resources.Domains.Endpoints.delete(client, "some-domain-id", "some-endpoint-id") do
{:ok, {200, _, _}} -> IO.puts "Endpoint deleted"
{:error, reason} -> IO.puts "Error: #{reason}"
end
Specs:
- find(Client.t, binary, binary) :: Client.response
Get information about a specific endpoint.
Example:
case Bandwidth.Resources.Domains.Endpoints.find(client, "some-domain-id", "some-endpoint-id") do
{:ok, {200, endpoint, _}} -> IO.inspect endpoint
{:error, reason} -> IO.puts "Error: #{reason}"
end
Specs:
- list(Client.t, binary) :: Client.response
Get a list of endpoints associated with a domain.
Example:
case Bandwidth.Resources.Domains.Endpoints.list(client, "some-domain-id") do
{:ok, {200, endpoints, _}} -> IO.inspect endpoints
{:error, reason} -> IO.puts "Error: #{reason}"
end