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

Contacts API layer between application and Airtel

Link to this section Summary

Functions

Fetch opted in contacts data from providers server

Update a contact phone as opted in

Perform the airtel API call and parse the results for downstream functions

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 airtel API call and parse the results for downstream functions