View Source ActiveCampaign.Http (active_campaign v0.3.0)

The HTTP interface for interacting with the Active Campaign API.

Link to this section Summary

Link to this section Functions

@spec delete(String.t()) :: {:ok, any()} | {:error, any()}
Link to this function

encode_query(enumerable)

View Source
@spec encode_query(map()) :: String.t()

Encodes URL query params.

This differs from URI.encode_query/2 in the following ways:

  • It will encode nested maps
  • It always assumes :www_form encoding
  • It assumes keys do not always need to be :www_form encoded
  • It assume there are no maps inside lists when the map has 0 or more than 1 element

examples

Examples

iex> iex> ActiveCampaign.Http.encode_query(%{a: %{b: :c}, d: :e})
"a[b]=c&d=e"

iex> ActiveCampaign.Http.encode_query(%{ids: [1, 2, 3]})
"ids[]=1&ids[]=2&ids[]=3"
@spec get(String.t()) :: {:ok, any()} | {:error, any()}
@spec patch(String.t(), any()) :: {:ok, any()} | {:error, any()}
Link to this function

post(url_path, body \\ "")

View Source
@spec post(String.t(), any()) :: {:ok, any()} | {:error, any()}
@spec put(String.t(), any()) :: {:ok, any()} | {:error, any()}