SMSFactor.Metrics (SMSFactor v0.5.0)

View Source

Wrappers around Metrics section of SMSFactor API.

Summary

Types

Params for getting consumption.

Types

consumption_params()

@type consumption_params() :: %{required(atom()) => String.t()}

Params for getting consumption.

  • date_start : Add a filter to retrieve consumption of which send date is after this date. Date format must be as follow: Y-m-d
  • date_end : Add a filter to retrieve consumption of which send date is before this date. Date format must be as follow: Y-m-d
  • country : Add a filter to retrieve your consumption for specific country. You can retrieve the consumption for multiple countries separated by a comma. Countries must be provided in alpha2 format. country=FR,CH
  • sub_account_id : Add a filter to retrieve the consumption of a specific sub account.

Example

%{
  date_start: "2021-01-01",
  date_end: "2021-01-31",
  country: "FR,CH",
  sub_account_id: "1234567890"
}

Functions

get_consumption(client, params)

@spec get_consumption(Tesla.Client.t(), consumption_params()) :: Tesla.Env.result()