MPX v0.1.7 Mpx
Wrapper for the Ministry Platform api.
For a complete reference to the MP API browse to https://yourhost/ministryplatformapi/swagger
Usage
Currently only a few endpoints are supported:
/tables
(get and delete)/tables/:id
(get)
Set configuration options to authenticate with MP in your config.exs. You can use {:system, "ENV_NAME"}
for runtime configuration.
config :mpx,
mp_base_url: {:system, "MP_HOST"},
mp_username: System.get_env("MP_USERNAME"),
mp_password: {:system, "MP_PASSWORD"},
mp_client_id: {:system, "MP_CLIENT_ID"},
mp_client_secret: {:system, "MP_CLIENT_SECRET"}
Now call
{:ok, token} = Mpx.Authentication.authenticate()
to get a reuseable authentication token.
If you prefer not to use elixir configuration to setup you user credentials:
{:ok, token} = Mpx.Authentication.authenticate(
username: "username",
password: "password",
client_id: "clientid",
client_secret: "clientsecret")
Querying Table Data
see Mpx.Tables
Summary
Functions
DEPRECATED
Functions
Specs
authenticate(Mpx.Authentication.authentication_opts | nil) ::
{:ok, String.t} |
{:error, String.t}
DEPRECATED
Instead please use Mpx.Authentication.authenticate/1