milkpotion v0.0.4 Milkpotion.Base.Url

This module contains url builder functions. These are mainly thought for internal use.

Summary

Functions

Builds an auth using your api key with the given permisions

Builds the request url for calling RTM’s /rest endopoint with the given method. Any params will be attached to the request as query parameters

Functions

init_auth(permissions)

Specs

init_auth(binary) :: binary

Builds an auth using your api key with the given permisions.

Returns a complete rest call uri.

Examples

iex> Milkpotion.Url.init_auth "read"
"https://www.rememberthemilk.com/services/auth/?api_key=<your_key>&api_sig=<sig>&perms=read"
rest(method, auth_token, params \\ %{})

Specs

rest(binary, nil | binary, map) :: binary

Builds the request url for calling RTM’s /rest endopoint with the given method. Any params will be attached to the request as query parameters.

Returns a complete rest call uri.

Examples

iex> Milkpotiom.Base.Url.rest "rtm.test.echo", "sample_token", %{"ping" => "pong"}
"https://api.rememberthemilk.com/services/rest/?method=rtm.test.echo&api_key=<your_key>&auth_token=sample_token&ping=pong&api_sig=<sig>"