MPX v0.1.2 Mpx

Wrapper for the (Ministry Platform)[https://www.thinkministry.com/ministryplatform/] api.

For a complete reference to the MP API browse to https://yourhost/ministryplatformapi/swagger

Summary

Functions

Authenticate with Ministry Platform

Wrapper for the Ministry Platform DELETE Api call

Wrapper for the Ministry Platform GET Api call

Wrapper for the Ministry Platform POST Api call

Wrapper for the Ministry Platform PUT Api call

Types

authentication_opts :: [username: String.t, password: String.t, client_id: String.t, client_secret: String.t]
http :: {atom, map | list} | {atom, term}

Functions

authenticate(opts \\ [])

Specs

authenticate(authentication_opts | nil) ::
  {:ok, String.t} |
  {:error, String.t}

Authenticate with Ministry Platform.

Takes a keyword list of options in the shape:

[ username: "mp-username",
  password: "mp-password",
  client_id: "mp-client-id",
  client_secret: "mp-client-secret" ]

If keyword options are not passed in, defaults to configuration parameters:

mpx, mp_username: "mp-username",
     mp_password: System.get_env("MP_PASSWORD"),
     mp_client_id: {:system, "MP_CLIENT_ID"},
     mp_client_secret: "mp-client-secret"

Returns {:ok, token} where token can be used in subsequent calls to the API that need to be authenticated or {:error, reason}

delete(path, auth_token, opts \\ [])

Specs

delete(binary, binary, Mpx.Tables.delete_options) :: http

Wrapper for the Ministry Platform DELETE Api call

Takes optional keyword list of options: [ "$select": "The_columns_to_select", "$filter": "The filter to apply", etc... ] see swagger for a complete list of parameters that the MP rest api takes

Returns an HTTPoison.Response or HTTPoison.Error

get(path, auth_token, opts \\ [])

Specs

get(binary, binary, keyword(binary)) :: http

Wrapper for the Ministry Platform GET Api call.

Takes optional keyword list of options: [ "$select": "The_columns_to_select", "$filter": "The filter to apply", etc... ] See swagger for a complete list of parameters that the MP rest api takes.

Returns an HTTPoison.Response or HTTPoison.Error

post(path, auth_token, data, opts \\ [])

Specs

post(binary, binary, map | list, keyword(binary)) :: http

Wrapper for the Ministry Platform POST Api call

Takes optional keyword list of options: [ "$select": "The_columns_to_select", "$filter": "The filter to apply", etc... ] see swagger for a complete list of parameters that the MP rest api takes.

Returns an HTTPoison.Response or HTTPoison.Error

put(path, auth_token, data, opts \\ [])

Specs

put(binary, binary, map | list, keyword(binary)) :: http

Wrapper for the Ministry Platform PUT Api call

Takes optional keyword list of options: [ "$select": "The_columns_to_select", "$filter": "The filter to apply", etc... ] see the swagger documentation for a complete list of parameters that the MP rest api takes.

Returns an HTTPoison.Response or HTTPoison.Error