MPX v0.1.7 Mpx.Http

Provides the base http functionality for Ministry PLatform access including GET, POST, PUT and DELETE

Summary

Types

t()

Specifies what is returned from all of the HTTP calls

Functions

Attempts to authenticate a client against MP

Attempts to get a token from MP based on the username/password/client_id/client_secret passed in

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

t :: {atom, map | list} | {atom, term}

Specifies what is returned from all of the HTTP calls

Functions

authenticate_client(opts)

Specs

authenticate_client(client_id: String.t, client_secret: String.t) :: {:ok | :error, String.t}

Attempts to authenticate a client against MP

authenticate_user(opts \\ [])

Specs

authenticate_user(Mpx.Authentication.authentication_opts | []) :: {:ok | :error, String.t}

Attempts to get a token from MP based on the username/password/client_id/client_secret passed in

If an empty list is passed as the authentication options, attempts to use the configuration file

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

Specs

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

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)) :: t

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)) :: t

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)) :: t

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