View Source Glific.Providers.GupshupContacts (Glific v5.1.6)

Contacts API layer between application and Gupshup

Link to this section Summary

Functions

Fetch opted in contacts data from providers server

Update a contact phone as opted in

Perform the gupshup API call and parse the results for downstream functions. We need to think about if we want to add him to behaviour

Link to this section Functions

Link to this function

fetch_opted_in_contacts(attrs)

View Source
@spec fetch_opted_in_contacts(map()) :: :ok | {:error, String.t()}

Fetch opted in contacts data from providers server

@spec optin_contact(map()) ::
  {:ok, Glific.Contacts.Contact.t()}
  | {:error, Ecto.Changeset.t()}
  | {:error, list()}

Update a contact phone as opted in

Link to this function

validate_opted_in_contacts(result)

View Source
@spec validate_opted_in_contacts(Tesla.Env.result()) ::
  {:ok, list()} | {:error, String.t()}

Perform the gupshup API call and parse the results for downstream functions. We need to think about if we want to add him to behaviour