Slack v0.0.12 Slack.Request

Summary

Macros

Define a method method that makes a GET request to the module’s base endpoint plus the method name: e.g. baseEndpoint.methodName

Define a method method that makes a POST request to the module’s base endpoint plus the method name: e.g. baseEndpoint.methodName

Define a method method that makes a request (the block must return a call to an HTTPoison request method)

Macros

defget(method)

Define a method method that makes a GET request to the module’s base endpoint plus the method name: e.g. baseEndpoint.methodName.

defpost(method)

Define a method method that makes a POST request to the module’s base endpoint plus the method name: e.g. baseEndpoint.methodName.

defrequest(signature, list)

Define a method method that makes a request (the block must return a call to an HTTPoison request method).

The body of a successful response will be pattern matched against Slack’s standard %{"ok" => true} message format, and will return {:ok, body} when the body matches %{"ok" => true}, or {:error, response} otherwise.

In the case of an actual failed request, {:error, HTTPoison.Error.t} will be returned.