View Source PlacetelAPI.Api.Calls (placetel_api v2.0.0)

API calls for all endpoints tagged Calls.

Link to this section Summary

Functions

Delete a call Delete a call by its ID

Fetch all incoming calls Provides a list of all calls on a specific day (date) or today.

Retrieve a call Fetches a call by its ID

Initate a call Initates a call

Link to this section Functions

Link to this function

delete_calls_id(connection, id, opts \\ [])

View Source
@spec delete_calls_id(Tesla.Env.client(), integer(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Delete a call Delete a call by its ID

parameters

Parameters

  • connection (PlacetelAPI.Connection): Connection to server
  • id (integer()): Call ID
  • opts (keyword): Optional parameters

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

get_calls(connection, opts \\ [])

View Source
@spec get_calls(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [PlacetelAPI.Model.Call.t()]} | {:error, Tesla.Env.t()}

Fetch all incoming calls Provides a list of all calls on a specific day (date) or today.

parameters

Parameters

  • connection (PlacetelAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :"filter[date]" (Date.t): YYYY-MM-DD, defaults to today.
    • :"filter[from_number]" (String.t):
    • :"filter[to_number]" (String.t):
    • :"filter[type]" (String.t):
    • :order (String.t):
    • :page (integer()): Page of results to fetch.
    • :per_page (integer()): Number of results to return per page.

returns

Returns

  • {:ok, [%Call{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

get_calls_id(connection, id, opts \\ [])

View Source
@spec get_calls_id(Tesla.Env.client(), integer(), keyword()) ::
  {:ok, PlacetelAPI.Model.Call.t()} | {:error, Tesla.Env.t()}

Retrieve a call Fetches a call by its ID

parameters

Parameters

  • connection (PlacetelAPI.Connection): Connection to server
  • id (integer()): Call ID
  • opts (keyword): Optional parameters

returns

Returns

  • {:ok, PlacetelAPI.Model.Call.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

post_calls(connection, calls, opts \\ [])

View Source
@spec post_calls(Tesla.Env.client(), PlacetelAPI.Model.PostCalls.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Initate a call Initates a call

parameters

Parameters

  • connection (PlacetelAPI.Connection): Connection to server
  • calls (PostCalls):
  • opts (keyword): Optional parameters

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure