View Source PlacetelAPI.Api.Contacts (placetel_api v2.0.1)

API calls for all endpoints tagged Contacts.

Link to this section Summary

Functions

Deletes a contact Deletes a contact by its ID

Get all contacts Provides a list of all contacts

Retrieve a contact Fetches a contact by its ID

Create a contact Creates a contact

Update a contact Updates a contact for a given ID

Link to this section Functions

Link to this function

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

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

Deletes a contact Deletes a contact by its ID

parameters

Parameters

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

returns

Returns

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

get_contacts(connection, opts \\ [])

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

Get all contacts Provides a list of all contacts

parameters

Parameters

  • connection (PlacetelAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :"filter[speeddial]" (integer()):
    • :"filter[first_name]" (String.t):
    • :"filter[last_name]" (String.t):
    • :"filter[company]" (String.t):
    • :"filter[email]" (String.t):
    • :"filter[email_work]" (String.t):
    • :"filter[phone_work]" (String.t):
    • :"filter[mobile_work]" (String.t):
    • :"filter[phone]" (String.t):
    • :"filter[mobile]" (String.t):
    • :"filter[blocked]" (boolean()):
    • :"search[number]" (String.t):
    • :page (integer()): Page of results to fetch.
    • :per_page (integer()): Number of results to return per page.

returns

Returns

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

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

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

Retrieve a contact Fetches a contact by its ID

parameters

Parameters

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

returns

Returns

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

post_contacts(connection, contacts, opts \\ [])

View Source

Create a contact Creates a contact

parameters

Parameters

  • connection (PlacetelAPI.Connection): Connection to server
  • contacts (PostContacts):
  • opts (keyword): Optional parameters

returns

Returns

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

put_contacts_id(connection, id, contacts, opts \\ [])

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

Update a contact Updates a contact for a given ID

parameters

Parameters

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

returns

Returns

  • {:ok, PlacetelAPI.Model.Contact.t} on success
  • {:error, Tesla.Env.t} on failure